19 #include "../mesh/mesh.h"
20 #include "../shapeset/shapeset.h"
22 #include "../mesh/traverse.h"
23 #include "../quadrature/quad_all.h"
24 #include "../boundary_conditions/essential_boundary_conditions.h"
26 using namespace Hermes::Algebra::DenseMatrixOperations;
32 template<
typename Scalar>
class Adapt;
33 template<
typename Scalar>
class DiscreteProblem;
104 template<
typename Scalar>
115 virtual bool isOkay()
const;
123 virtual void set_element_order(
int id,
int order);
126 virtual void set_element_orders(
int* elem_orders);
129 int get_element_order(
int id)
const;
133 void set_uniform_order(
int order,
std::string marker = HERMES_ANY);
137 void adjust_element_order(
int order_change,
int min_order);
140 void adjust_element_order(
int horizontal_order_change,
int vertical_order_change,
unsigned int horizontal_min_order,
unsigned int vertical_min_order);
144 void unrefine_all_mesh_elements(
bool keep_initial_refinements =
true);
147 void update_element_orders_after_refinement();
150 virtual void set_shapeset(
Shapeset* shapeset) = 0;
153 int get_num_dofs()
const;
156 static int get_num_dofs(Hermes::vector<
const Space<Scalar>*> spaces);
157 static int get_num_dofs(Hermes::vector<
Space<Scalar>*> spaces);
163 Mesh* get_mesh()
const;
166 void set_mesh(
Mesh* mesh);
169 void set_mesh_seq(
int seq);
179 void update_essential_bc_values();
184 bool save(
const char *filename)
const;
190 virtual void get_element_assembly_list(
Element* e,
AsmList<Scalar>* al,
unsigned int first_dof = 0)
const;
210 virtual Space<Scalar>* create_ref_space(
bool assign_dofs =
true);
224 const Mesh* ref_mesh;
225 unsigned int order_increase;
230 virtual void set_element_order_internal(
int id,
int order);
238 virtual int assign_dofs(
int first_dof = 0,
int stride = 1);
241 static int assign_dofs(Hermes::vector<
Space<Scalar>*> spaces);
245 static void update_essential_bc_values(Hermes::vector<
Space<Scalar>*> spaces,
double time);
251 virtual SpaceType get_type()
const = 0;
253 static Node* get_mid_edge_vertex_node(
Element* e,
int i,
int j);
256 void distribute_orders(
Mesh* mesh,
int* parents);
259 virtual int get_edge_order(
Element* e,
int edge)
const;
262 int get_max_dof()
const;
265 bool is_up_to_date()
const;
268 void get_boundary_assembly_list(
Element* e,
int surf_num,
AsmList<Scalar>* al,
unsigned int first_dof = 0)
const;
272 void set_uniform_order_internal(
int order,
int marker);
278 int get_vertex_functions_count();
280 int get_edge_functions_count();
282 int get_bubble_functions_count();
288 static const int H2D_UNASSIGNED_DOF = -2;
289 static const int H2D_CONSTRAINED_DOF = -1;
301 int default_tri_order, default_quad_order;
302 int vertex_functions_count, edge_functions_count, bubble_functions_count;
303 int first_dof, next_dof;
320 Scalar* edge_bc_proj;
321 Scalar* vertex_bc_coef;
336 NodeData() : dof(0), edge_bc_proj(NULL) {}
342 ElementData() : changed_in_last_adaptation(
true) {};
345 bool changed_in_last_adaptation;
353 virtual int get_edge_order_internal(
Node* en)
const;
362 virtual void resize_tables();
364 void update_orders_recurrent(
Element* e,
int order);
366 virtual void reset_dof_assignment();
367 virtual void assign_vertex_dofs() = 0;
368 virtual void assign_edge_dofs() = 0;
369 virtual void assign_bubble_dofs() = 0;
372 virtual void get_boundary_assembly_list_internal(
Element* e,
int surf_num,
AsmList<Scalar>* al)
const = 0;
381 void precalculate_projection_matrix(
int nv,
double**& mat,
double*& p);
387 virtual void update_constraints();
391 virtual void post_assign();
401 template<
typename T>
friend class OGProjectionNOX;
403 template<
typename T>
friend class Solution;
413 friend class Adapt<Scalar>;