19 #include "../shapeset/shapeset.h"
21 #include "../boundary_conditions/essential_boundary_conditions.h"
22 #include "../mesh/traverse.h"
23 #include "../quadrature/quad_all.h"
24 #include "algebra/dense_matrix_operations.h"
33 template<
typename Scalar>
34 class HERMES_API
SpaceSharedPtr :
public std::tr1::shared_ptr < Hermes::Hermes2D::Space<Scalar> >
48 template<
typename Scalar>
56 virtual std::vector<SpaceSharedPtr<Scalar> > get_spaces();
61 template<
typename Scalar>
class Adapt;
131 template<
typename Scalar>
142 virtual void init(
Shapeset* shapeset,
int p_init,
bool assign_dofs_init =
true) = 0;
152 #pragma region Getters
153 inline int get_element_order(
int id)
const {
155 return edata[
id].order;
159 int get_num_dofs()
const;
167 MeshSharedPtr get_mesh()
const;
170 virtual SpaceType get_type()
const = 0;
174 int get_vertex_functions_count();
176 int get_edge_functions_count();
178 int get_bubble_functions_count();
190 virtual int get_edge_order(
Element* e,
int edge)
const;
193 int get_max_dof()
const;
201 #pragma region Setters
202 virtual void set_shapeset(
Shapeset* shapeset,
bool clone =
false) = 0;
206 void set_mesh(MeshSharedPtr mesh);
209 void set_mesh_seq(
int seq);
215 #pragma region Order setting
216 virtual void set_element_order(
int id,
int order,
int order_v = -1);
222 void set_uniform_order(
int order,
std::string marker = HERMES_ANY);
226 void adjust_element_order(
int order_change,
int min_order);
229 void adjust_element_order(
int horizontal_order_change,
int vertical_order_change,
unsigned int horizontal_min_order,
unsigned int vertical_min_order);
233 void set_uniform_order_internal(
int order,
int marker);
241 virtual int assign_dofs(
int first_dof = 0);
247 #pragma region Mesh handling
248 void unrefine_all_mesh_elements(
bool keep_initial_refinements =
true);
256 static void unrefine_all_mesh_elements(std::vector<
SpaceSharedPtr<Scalar> > spaces,
bool keep_initial_refinements =
true);
259 #pragma region Boundary conditions
264 void update_essential_bc_values();
271 #pragma region Save & Load
272 void save(
const char *filename)
const;
275 void save_bson(
const char* filename)
const;
281 void load(
const char *filename);
287 void load_bson(
const char *filename);
328 MeshSharedPtr ref_mesh;
329 unsigned int order_increase;
336 virtual void set_element_order_internal(
int id,
int order,
int order_v = -1);
339 void distribute_orders(MeshSharedPtr mesh,
int* parents);
342 bool is_up_to_date()
const;
344 static Node* get_mid_edge_vertex_node(
Element* e,
unsigned char i,
unsigned char j);
347 virtual bool isOkay()
const;
348 inline std::string getClassName()
const {
return "Space"; }
354 static const int H2D_UNASSIGNED_DOF = -2;
356 static const int H2D_CONSTRAINED_DOF = -1;
393 Scalar* edge_bc_proj;
394 Scalar* vertex_bc_coef;
410 NodeData() : dof(0), edge_bc_proj(nullptr) {}
416 ElementData() : changed_in_last_adaptation(
true) {};
420 bool changed_in_last_adaptation;
433 virtual int get_edge_order_internal(
Node* en)
const;
441 void unrefine_all_mesh_elements_internal(
bool keep_initial_refinements,
bool only_unrefine_space_data);
450 virtual void resize_tables();
452 void update_orders_recurrent(
Element* e,
int order);
455 virtual void reset_dof_assignment();
456 virtual void assign_vertex_dofs() = 0;
457 virtual void assign_edge_dofs() = 0;
458 virtual void assign_bubble_dofs() = 0;
461 virtual void get_boundary_assembly_list_internal(
Element* e,
int surf_num,
AsmList<Scalar>* al)
const = 0;
469 std::vector<typename Space<Scalar>::BaseComponent*> bc_data_base_components;
471 void precalculate_projection_matrix(
int nv,
double**& mat,
double*& p);
477 virtual void update_constraints();
481 virtual void post_assign();
500 template<
typename T>
friend class OGProjectionNOX;
501 template<
typename T>
friend class Solution;
511 friend class Adapt < Scalar > ;
::xsd::cxx::tree::id< char, ncname > id
C++ type corresponding to the ID XML Schema built-in type.
int first_dof
For equation systems.
int ndof
Number of degrees of freedom (dimension of the space).
int vertex_functions_count
For statistics.
int mesh_seq
Tracking changes - mesh.
Stores one element of a mesh.
Class for (global) orthogonal projecting. If the projection is not necessary (if a solution belongs t...
std::vector< Scalar * > bc_data_projections
Used for bc projection.
Used to pass the instances of Space around.
Stores one node of a mesh.
::xsd::cxx::tree::time< char, simple_type > time
C++ type corresponding to the time XML Schema built-in type.
bool own_shapeset
true if default shapeset is created in the constructor, false if shapeset is supplied by user...
Determines the position on an element surface (edge in 2D and Face in 3D).
Visualizes the basis functions of a space.
unsigned int seq_assigned
Tracking changes - mark call to assign_dofs().
NodeData * ndata
node data table
Should be exactly the same as is the count of enum ShapesetType.
Represents an exact solution of a PDE.
int esize
element data table size
Class for creating reference space.
ElementData * edata
element data table
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
Displays the polynomial degrees of elements.
This class is a one-thread (non-DG) assembly worker.
Represents a finite element space over a domain.
MeshSharedPtr mesh
FE mesh.
Provides methods of integration order calculation.
This class characterizes a neighborhood of a given edge in terms of adjacent elements and provides me...
EssentialBCs< Scalar > * essential_bcs
Boundary conditions.
Represents the solution of a PDE.
unsigned int seq
Tracking changes.
int nsize
node data table size