16 #include "mesh_function.h"
22 template<
typename Scalar>
23 MeshFunction<Scalar>::MeshFunction()
31 template<
typename Scalar>
32 MeshFunction<Scalar>::MeshFunction(
const Mesh *mesh) :
36 this->refmap =
new RefMap;
39 template<
typename Scalar>
40 MeshFunction<Scalar>::~MeshFunction()
43 if(this->overflow_nodes != NULL)
45 for(
unsigned int i = 0; i < this->overflow_nodes->get_size(); i++)
46 if(this->overflow_nodes->present(i))
47 ::free(this->overflow_nodes->get(i));
48 delete this->overflow_nodes;
52 template<
typename Scalar>
56 if(this->mesh == NULL)
60 if(this->mesh->get_max_element_id() < 0)
61 throw Hermes::Exceptions::Exception(
"Internal exception.");
62 this->mesh->get_element(this->mesh->get_max_element_id() - 1);
71 template<
typename Scalar>
76 template<
typename Scalar>
77 void MeshFunction<Scalar>::reinit()
83 template<
typename Scalar>
84 int MeshFunction<Scalar>::get_edge_fn_order(
int edge)
89 template<
typename Scalar>
90 const Mesh* MeshFunction<Scalar>::get_mesh()
const
95 template<
typename Scalar>
96 RefMap* MeshFunction<Scalar>::get_refmap(
bool update)
99 this->update_refmap();
103 template<
typename Scalar>
104 void MeshFunction<Scalar>::set_refmap(RefMap* refmap_to_set)
107 this->refmap = refmap_to_set;
110 template<
typename Scalar>
114 throw Exceptions::NullException(1);
116 refmap->set_quad_2d(quad_2d);
119 template<
typename Scalar>
123 mode = e->get_mode();
124 refmap->set_active_element(e);
128 template<
typename Scalar>
131 if(this->overflow_nodes != NULL) {
132 for(
unsigned int i = 0; i < this->overflow_nodes->get_size(); i++)
133 if(this->overflow_nodes->present(i))
134 ::free(this->overflow_nodes->get(i));
135 delete this->overflow_nodes;
137 this->nodes =
new LightArray<typename Function<Scalar>::Node *>;
138 this->overflow_nodes = this->nodes;
141 template<
typename Scalar>
148 template<
typename Scalar>
155 template<
typename Scalar>
161 template<
typename Scalar>
162 void MeshFunction<Scalar>::update_refmap()
164 refmap->force_transform(this->sub_idx, this->ctm);
167 template<
typename Scalar>
168 void MeshFunction<Scalar>::force_transform(uint64_t sub_idx, Trf* ctm)
170 this->sub_idx = sub_idx;
174 template class HERMES_API MeshFunction<double>;
175 template class HERMES_API MeshFunction<std::complex<double> >;