10 #ifndef CMZN_ELEMENT_HPP__
11 #define CMZN_ELEMENT_HPP__
13 #include "zinc/element.h"
14 #include "zinc/field.hpp"
15 #include "zinc/differentialoperator.hpp"
16 #include "zinc/node.hpp"
35 cmzn_elementbasis_id id;
43 explicit Elementbasis(cmzn_elementbasis_id element_basis_id) :
48 id(cmzn_elementbasis_access(elementBasis.id))
53 cmzn_elementbasis_id temp_id = cmzn_elementbasis_access(elementBasis.id);
56 cmzn_elementbasis_destroy(&
id);
66 cmzn_elementbasis_destroy(&
id);
137 return cmzn_elementbasis_get_dimension(
id);
149 return static_cast<FunctionType>(cmzn_elementbasis_get_function_type(
id, chartComponent));
162 return cmzn_elementbasis_set_function_type(
id, chartComponent,
163 static_cast<cmzn_elementbasis_function_type>(functionType));
173 return cmzn_elementbasis_get_number_of_nodes(
id);
190 return cmzn_elementbasis_get_number_of_functions(
id);
203 return cmzn_elementbasis_get_number_of_functions_per_node(
id, nodeNumber);
211 class Elementtemplate;
231 explicit Element(cmzn_element_id element_id) :
236 id(cmzn_element_access(element.id))
243 cmzn_element_destroy(&
id);
306 cmzn_element_id temp_id = cmzn_element_access(element.id);
309 cmzn_element_destroy(&
id);
400 return cmzn_element_get_dimension(
id);
412 return cmzn_element_get_identifier(
id);
425 return cmzn_element_set_identifier(
id, identifier);
445 return static_cast<ShapeType>(cmzn_element_get_shape_type(
id));
459 inline bool operator==(
const Element& a,
const Element& b)
461 return a.getId() == b.getId();
475 cmzn_elementtemplate_id id;
483 explicit Elementtemplate(cmzn_elementtemplate_id element_template_id) :
484 id(element_template_id)
488 id(cmzn_elementtemplate_access(elementTemplate.id))
493 cmzn_elementtemplate_id temp_id = cmzn_elementtemplate_access(elementTemplate.id);
496 cmzn_elementtemplate_destroy(&
id);
506 cmzn_elementtemplate_destroy(&
id);
525 cmzn_elementtemplate_id
getId()
const
537 return static_cast<Element::ShapeType>(cmzn_elementtemplate_get_element_shape_type(
id));
555 return cmzn_elementtemplate_set_element_shape_type(
id,
556 static_cast<cmzn_element_shape_type>(shapeType));
566 return cmzn_elementtemplate_get_number_of_nodes(
id);
579 return cmzn_elementtemplate_set_number_of_nodes(
id, numberOfNodes);
594 return cmzn_elementtemplate_define_field_element_constant(
595 id, field.
getId(), componentNumber);
625 const Elementbasis& basis,
int nodeIndexesCount,
const int *nodeIndexesIn)
627 return cmzn_elementtemplate_define_field_simple_nodal(
628 id, field.
getId(), componentNumber, basis.
getId(),
629 nodeIndexesCount, nodeIndexesIn);
654 return cmzn_elementtemplate_set_map_node_value_label(
id, field.
getId(),
655 componentNumber, basisNodeIndex, nodeFunctionIndex,
656 static_cast<cmzn_node_value_label
>(nodeValueLabel));
679 int basisNodeIndex,
int nodeFunctionIndex,
int versionNumber)
681 return cmzn_elementtemplate_set_map_node_version(
id, field.
getId(),
682 componentNumber, basisNodeIndex, nodeFunctionIndex, versionNumber);
695 return Node(cmzn_elementtemplate_get_node(
id, localNodeIndex));
709 return cmzn_elementtemplate_set_node(
id, localNodeIndex, node.
getId());
722 cmzn_elementiterator_id id;
730 explicit Elementiterator(cmzn_elementiterator_id element_iterator_id) :
731 id(element_iterator_id)
735 id(cmzn_elementiterator_access(elementIterator.id))
740 cmzn_elementiterator_id temp_id = cmzn_elementiterator_access(elementIterator.id);
743 cmzn_elementiterator_destroy(&
id);
753 cmzn_elementiterator_destroy(&
id);
776 return Element(cmzn_elementiterator_next(
id));
799 explicit Mesh(cmzn_mesh_id mesh_id) : id(mesh_id)
803 id(cmzn_mesh_access(mesh.id))
810 cmzn_mesh_destroy(&
id);
826 cmzn_mesh_id temp_id = cmzn_mesh_access(mesh.id);
829 cmzn_mesh_destroy(&
id);
862 return cmzn_mesh_contains_element(
id, element.
getId());
889 return Element(cmzn_mesh_create_element(
id, identifier, elementTemplate.
getId()));
922 return cmzn_mesh_define_element(
id, identifier, elementTemplate.
getId());
933 return cmzn_mesh_destroy_all_elements(
id);
946 return cmzn_mesh_destroy_element(
id, element.
getId());
962 return cmzn_mesh_destroy_elements_conditional(
id,
963 conditionalField.
getId());
974 return Element(cmzn_mesh_find_element_by_identifier(
id, identifier));
1001 return cmzn_mesh_get_dimension(
id);
1019 return Mesh(cmzn_mesh_get_master_mesh(
id));
1031 return cmzn_mesh_get_name(
id);
1041 return cmzn_mesh_get_size(
id);
1046 inline bool operator==(
const Mesh& a,
const Mesh& b)
1048 return cmzn_mesh_match(a.getId(), b.getId());
1053 return Mesh(cmzn_element_get_mesh(
id));
1067 explicit MeshGroup(cmzn_mesh_group_id mesh_id) :
Mesh(reinterpret_cast<cmzn_mesh_id>(mesh_id))
1080 return (cmzn_mesh_group_id)(id);
1093 return cmzn_mesh_group_add_element(
1094 reinterpret_cast<cmzn_mesh_group_id>(
id), element.
getId());
1109 return cmzn_mesh_group_add_elements_conditional(
1110 reinterpret_cast<cmzn_mesh_group_id>(
id), conditionalField.
getId());
1120 return cmzn_mesh_group_remove_all_elements(reinterpret_cast<cmzn_mesh_group_id>(
id));
1133 return cmzn_mesh_group_remove_element(reinterpret_cast<cmzn_mesh_group_id>(
id),
1149 return cmzn_mesh_group_remove_elements_conditional(
1150 reinterpret_cast<cmzn_mesh_group_id>(
id), conditionalField.
getId());
1157 return MeshGroup(cmzn_mesh_cast_group(
id));
1169 cmzn_meshchanges_id id;
1177 explicit Meshchanges(cmzn_meshchanges_id meshchanges_id) :
1182 id(cmzn_meshchanges_access(meshchanges.id))
1187 cmzn_meshchanges_id temp_id = cmzn_meshchanges_access(meshchanges.id);
1189 cmzn_meshchanges_destroy(&
id);
1197 cmzn_meshchanges_destroy(&
id);
1221 return cmzn_meshchanges_get_element_change_flags(
id, element.
getId());
1232 return cmzn_meshchanges_get_number_of_changes(
id);
1242 return cmzn_meshchanges_get_summary_element_change_flags(
id);
1248 return cmzn_element_merge(
id, elementTemplate.
getId());
Definition: element.hpp:288
int addElement(const Element &element)
Definition: element.hpp:1091
Definition: element.hpp:332
Definition: element.hpp:292
A single finite element from a mesh.
Definition: element.hpp:219
Definition: element.hpp:89
Definition: element.hpp:97
int setElementShapeType(enum Element::ShapeType shapeType)
Definition: element.hpp:553
Definition: element.hpp:266
int addElementsConditional(const Field &conditionalField)
Definition: element.hpp:1107
Definition: element.hpp:336
int destroyAllElements()
Definition: element.hpp:931
ValueLabel
Definition: node.hpp:84
int defineElement(int identifier, const Elementtemplate &elementTemplate)
Definition: element.hpp:920
A set of basis functions that can apply over an element of a given dimension.
Definition: element.hpp:31
Elementtemplate createElementtemplate()
Definition: element.hpp:871
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:49
Definition: element.hpp:262
bool isValid() const
Definition: element.hpp:762
ShapeType
Definition: element.hpp:318
Differentialoperator getChartDifferentialoperator(int order, int term)
Definition: element.hpp:988
int removeAllElements()
Definition: element.hpp:1118
int getDimension()
Definition: element.hpp:135
Mesh getMesh() const
Definition: element.hpp:1051
int getNumberOfFunctions()
Definition: element.hpp:188
Definition: element.hpp:328
Definition: element.hpp:115
int setNumberOfNodes(int numberOfNodes)
Definition: element.hpp:577
cmzn_mesh_group_id getId() const
Definition: element.hpp:1078
int getNumberOfFunctionsPerNode(int nodeNumber)
Definition: element.hpp:201
Definition: element.hpp:358
Definition: element.hpp:272
int ChangeFlags
Definition: element.hpp:279
Describes the derivative of a field to evaluate.
Definition: differentialoperator.hpp:26
Node getNode(int localNodeIndex)
Definition: element.hpp:693
Definition: element.hpp:300
int setMapNodeVersion(const Field &field, int componentNumber, int basisNodeIndex, int nodeFunctionIndex, int versionNumber)
Definition: element.hpp:678
bool isValid() const
Definition: element.hpp:252
Element::ChangeFlags getElementChangeFlags(const Element &element)
Definition: element.hpp:1219
bool isValid() const
Definition: element.hpp:515
int defineFieldSimpleNodal(const Field &field, int componentNumber, const Elementbasis &basis, int nodeIndexesCount, const int *nodeIndexesIn)
Definition: element.hpp:624
Definition: element.hpp:351
QuadratureRule
Definition: element.hpp:368
Definition: element.hpp:298
int removeElement(const Element &element)
Definition: element.hpp:1131
Definition: element.hpp:326
cmzn_field_id getId() const
Definition: field.hpp:101
An iterator for looping through all the elements in a mesh.
Definition: element.hpp:718
Definition: element.hpp:100
MeshGroup castGroup()
Definition: element.hpp:1155
Element findElementByIdentifier(int identifier)
Definition: element.hpp:972
Definition: element.hpp:296
A description of element shape and field definitions.
Definition: element.hpp:471
int getDimension()
Definition: element.hpp:398
FunctionType
Definition: element.hpp:85
cmzn_element_id getId() const
Definition: element.hpp:388
ChangeFlag
Definition: element.hpp:260
Definition: element.hpp:345
enum FunctionType getFunctionType(int chartComponent)
Definition: element.hpp:147
cmzn_mesh_id getId() const
Definition: element.hpp:840
bool containsElement(const Element &element)
Definition: element.hpp:860
Definition: element.hpp:268
bool isValid() const
Definition: element.hpp:1205
int getSize()
Definition: element.hpp:1039
int defineFieldElementConstant(const Field &field, int componentNumber)
Definition: element.hpp:592
bool isValid() const
Definition: element.hpp:819
Definition: element.hpp:294
Definition: element.hpp:349
cmzn_node_id getId() const
Definition: node.hpp:140
Definition: element.hpp:347
A subset of a master mesh.
Definition: element.hpp:1061
char * getName()
Definition: element.hpp:1029
Definition: element.hpp:320
int destroyElementsConditional(const Field &conditionalField)
Definition: element.hpp:960
Container/manager of fields and domains within a region.
Definition: fieldmodule.hpp:133
Definition: element.hpp:322
int destroyElement(const Element &element)
Definition: element.hpp:944
int getNumberOfChanges()
Definition: element.hpp:1230
int getNumberOfNodes()
Definition: element.hpp:564
Definition: element.hpp:91
Definition: element.hpp:356
Mesh getMasterMesh()
Definition: element.hpp:1017
Definition: element.hpp:94
cmzn_elementbasis_id getId() const
Definition: element.hpp:125
Element::ChangeFlags getSummaryElementChangeFlags()
Definition: element.hpp:1240
Definition: element.hpp:270
cmzn_elementtemplate_id getId() const
Definition: element.hpp:525
Definition: element.hpp:286
PointSamplingMode
Definition: element.hpp:343
Definition: element.hpp:264
int getNumberOfNodes()
Definition: element.hpp:171
Definition: element.hpp:370
int setNode(int localNodeIndex, const Node &node)
Definition: element.hpp:707
Element next()
Definition: element.hpp:774
enum Element::ShapeType getElementShapeType()
Definition: element.hpp:535
enum ShapeType getShapeType()
Definition: element.hpp:443
int removeElementsConditional(const Field &conditionalField)
Definition: element.hpp:1147
int setMapNodeValueLabel(const Field &field, int componentNumber, int basisNodeIndex, int nodeFunctionIndex, Node::ValueLabel nodeValueLabel)
Definition: element.hpp:651
Elementiterator createElementiterator()
Definition: element.hpp:904
Point object used to represent finite element nodes.
Definition: node.hpp:38
Definition: element.hpp:290
Definition: element.hpp:87
int merge(const Elementtemplate &elementTemplate)
Definition: element.hpp:1246
int setIdentifier(int identifier)
Definition: element.hpp:423
Definition: element.hpp:378
int getIdentifier()
Definition: element.hpp:410
Definition: element.hpp:334
Definition: element.hpp:107
bool isValid() const
Definition: element.hpp:75
FaceType
Definition: element.hpp:284
Element createElement(int identifier, const Elementtemplate &elementTemplate)
Definition: element.hpp:887
Definition: element.hpp:372
A finite element mesh consisting of a set of elements of fixed dimension.
Definition: element.hpp:787
Definition: element.hpp:324
int getDimension()
Definition: element.hpp:999
Fieldmodule getFieldmodule() const
Definition: fieldmodule.hpp:1729
Object describing changes to a mesh in a fieldmoduleevent.
Definition: element.hpp:1165
Definition: element.hpp:330
int setFunctionType(int chartComponent, FunctionType functionType)
Definition: element.hpp:160