10 #ifndef CMZN_ELEMENT_HPP__
11 #define CMZN_ELEMENT_HPP__
13 #include "opencmiss/zinc/element.h"
14 #include "opencmiss/zinc/field.hpp"
15 #include "opencmiss/zinc/differentialoperator.hpp"
16 #include "opencmiss/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);
310 cmzn_element_id temp_id = cmzn_element_access(element.id);
313 cmzn_element_destroy(&
id);
404 return cmzn_element_get_dimension(
id);
416 return cmzn_element_get_identifier(
id);
429 return cmzn_element_set_identifier(
id, identifier);
449 return static_cast<ShapeType>(cmzn_element_get_shape_type(
id));
463 inline bool operator==(
const Element& a,
const Element& b)
465 return a.getId() == b.getId();
479 cmzn_elementtemplate_id id;
487 explicit Elementtemplate(cmzn_elementtemplate_id element_template_id) :
488 id(element_template_id)
492 id(cmzn_elementtemplate_access(elementTemplate.id))
497 cmzn_elementtemplate_id temp_id = cmzn_elementtemplate_access(elementTemplate.id);
500 cmzn_elementtemplate_destroy(&
id);
510 cmzn_elementtemplate_destroy(&
id);
529 cmzn_elementtemplate_id
getId()
const
541 return static_cast<Element::ShapeType>(cmzn_elementtemplate_get_element_shape_type(
id));
559 return cmzn_elementtemplate_set_element_shape_type(
id,
560 static_cast<cmzn_element_shape_type>(shapeType));
570 return cmzn_elementtemplate_get_number_of_nodes(
id);
583 return cmzn_elementtemplate_set_number_of_nodes(
id, numberOfNodes);
598 return cmzn_elementtemplate_define_field_element_constant(
599 id, field.
getId(), componentNumber);
629 const Elementbasis& basis,
int nodeIndexesCount,
const int *nodeIndexesIn)
631 return cmzn_elementtemplate_define_field_simple_nodal(
632 id, field.
getId(), componentNumber, basis.
getId(),
633 nodeIndexesCount, nodeIndexesIn);
658 return cmzn_elementtemplate_set_map_node_value_label(
id, field.
getId(),
659 componentNumber, basisNodeIndex, nodeFunctionIndex,
660 static_cast<cmzn_node_value_label
>(nodeValueLabel));
683 int basisNodeIndex,
int nodeFunctionIndex,
int versionNumber)
685 return cmzn_elementtemplate_set_map_node_version(
id, field.
getId(),
686 componentNumber, basisNodeIndex, nodeFunctionIndex, versionNumber);
699 return Node(cmzn_elementtemplate_get_node(
id, localNodeIndex));
713 return cmzn_elementtemplate_set_node(
id, localNodeIndex, node.
getId());
726 cmzn_elementiterator_id id;
734 explicit Elementiterator(cmzn_elementiterator_id element_iterator_id) :
735 id(element_iterator_id)
739 id(cmzn_elementiterator_access(elementIterator.id))
744 cmzn_elementiterator_id temp_id = cmzn_elementiterator_access(elementIterator.id);
747 cmzn_elementiterator_destroy(&
id);
757 cmzn_elementiterator_destroy(&
id);
780 return Element(cmzn_elementiterator_next(
id));
803 explicit Mesh(cmzn_mesh_id mesh_id) : id(mesh_id)
807 id(cmzn_mesh_access(mesh.id))
814 cmzn_mesh_destroy(&
id);
830 cmzn_mesh_id temp_id = cmzn_mesh_access(mesh.id);
833 cmzn_mesh_destroy(&
id);
866 return cmzn_mesh_contains_element(
id, element.
getId());
893 return Element(cmzn_mesh_create_element(
id, identifier, elementTemplate.
getId()));
926 return cmzn_mesh_define_element(
id, identifier, elementTemplate.
getId());
937 return cmzn_mesh_destroy_all_elements(
id);
950 return cmzn_mesh_destroy_element(
id, element.
getId());
966 return cmzn_mesh_destroy_elements_conditional(
id,
967 conditionalField.
getId());
978 return Element(cmzn_mesh_find_element_by_identifier(
id, identifier));
1005 return cmzn_mesh_get_dimension(
id);
1023 return Mesh(cmzn_mesh_get_master_mesh(
id));
1035 return cmzn_mesh_get_name(
id);
1045 return cmzn_mesh_get_size(
id);
1050 inline bool operator==(
const Mesh& a,
const Mesh& b)
1052 return cmzn_mesh_match(a.getId(), b.getId());
1057 return Mesh(cmzn_element_get_mesh(
id));
1071 explicit MeshGroup(cmzn_mesh_group_id mesh_id) :
Mesh(reinterpret_cast<cmzn_mesh_id>(mesh_id))
1084 return (cmzn_mesh_group_id)(id);
1097 return cmzn_mesh_group_add_element(
1098 reinterpret_cast<cmzn_mesh_group_id>(
id), element.
getId());
1113 return cmzn_mesh_group_add_elements_conditional(
1114 reinterpret_cast<cmzn_mesh_group_id>(
id), conditionalField.
getId());
1124 return cmzn_mesh_group_remove_all_elements(reinterpret_cast<cmzn_mesh_group_id>(
id));
1137 return cmzn_mesh_group_remove_element(reinterpret_cast<cmzn_mesh_group_id>(
id),
1153 return cmzn_mesh_group_remove_elements_conditional(
1154 reinterpret_cast<cmzn_mesh_group_id>(
id), conditionalField.
getId());
1161 return MeshGroup(cmzn_mesh_cast_group(
id));
1173 cmzn_meshchanges_id id;
1181 explicit Meshchanges(cmzn_meshchanges_id meshchanges_id) :
1186 id(cmzn_meshchanges_access(meshchanges.id))
1191 cmzn_meshchanges_id temp_id = cmzn_meshchanges_access(meshchanges.id);
1193 cmzn_meshchanges_destroy(&
id);
1201 cmzn_meshchanges_destroy(&
id);
1225 return cmzn_meshchanges_get_element_change_flags(
id, element.
getId());
1236 return cmzn_meshchanges_get_number_of_changes(
id);
1246 return cmzn_meshchanges_get_summary_element_change_flags(
id);
1252 return cmzn_element_merge(
id, elementTemplate.
getId());
Definition: element.hpp:288
int addElement(const Element &element)
Definition: element.hpp:1095
Definition: element.hpp:336
Definition: element.hpp:296
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:557
Definition: element.hpp:266
int addElementsConditional(const Field &conditionalField)
Definition: element.hpp:1111
Definition: element.hpp:340
int destroyAllElements()
Definition: element.hpp:935
ValueLabel
Definition: node.hpp:84
int defineElement(int identifier, const Elementtemplate &elementTemplate)
Definition: element.hpp:924
A set of basis functions that can apply over an element of a given dimension.
Definition: element.hpp:31
Elementtemplate createElementtemplate()
Definition: element.hpp:875
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:50
Definition: element.hpp:262
bool isValid() const
Definition: element.hpp:766
ShapeType
Definition: element.hpp:322
Differentialoperator getChartDifferentialoperator(int order, int term)
Definition: element.hpp:992
int removeAllElements()
Definition: element.hpp:1122
int getDimension()
Definition: element.hpp:135
Mesh getMesh() const
Definition: element.hpp:1055
int getNumberOfFunctions()
Definition: element.hpp:188
Definition: element.hpp:332
Definition: element.hpp:115
int setNumberOfNodes(int numberOfNodes)
Definition: element.hpp:581
cmzn_mesh_group_id getId() const
Definition: element.hpp:1082
int getNumberOfFunctionsPerNode(int nodeNumber)
Definition: element.hpp:201
Definition: element.hpp:362
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:697
Definition: element.hpp:304
int setMapNodeVersion(const Field &field, int componentNumber, int basisNodeIndex, int nodeFunctionIndex, int versionNumber)
Definition: element.hpp:682
bool isValid() const
Definition: element.hpp:252
Element::ChangeFlags getElementChangeFlags(const Element &element)
Definition: element.hpp:1223
bool isValid() const
Definition: element.hpp:519
int defineFieldSimpleNodal(const Field &field, int componentNumber, const Elementbasis &basis, int nodeIndexesCount, const int *nodeIndexesIn)
Definition: element.hpp:628
Definition: element.hpp:290
Definition: element.hpp:355
QuadratureRule
Definition: element.hpp:372
Definition: element.hpp:302
int removeElement(const Element &element)
Definition: element.hpp:1135
Definition: element.hpp:330
cmzn_field_id getId() const
Definition: field.hpp:102
An iterator for looping through all the elements in a mesh.
Definition: element.hpp:722
Definition: element.hpp:100
MeshGroup castGroup()
Definition: element.hpp:1159
Element findElementByIdentifier(int identifier)
Definition: element.hpp:976
Definition: element.hpp:300
A description of element shape and field definitions.
Definition: element.hpp:475
int getDimension()
Definition: element.hpp:402
FunctionType
Definition: element.hpp:85
cmzn_element_id getId() const
Definition: element.hpp:392
ChangeFlag
Definition: element.hpp:260
Definition: element.hpp:349
enum FunctionType getFunctionType(int chartComponent)
Definition: element.hpp:147
cmzn_mesh_id getId() const
Definition: element.hpp:844
bool containsElement(const Element &element)
Definition: element.hpp:864
Definition: element.hpp:268
bool isValid() const
Definition: element.hpp:1209
int getSize()
Definition: element.hpp:1043
int defineFieldElementConstant(const Field &field, int componentNumber)
Definition: element.hpp:596
bool isValid() const
Definition: element.hpp:823
Definition: element.hpp:298
Definition: element.hpp:353
cmzn_node_id getId() const
Definition: node.hpp:140
Definition: element.hpp:351
A subset of a master mesh.
Definition: element.hpp:1065
char * getName()
Definition: element.hpp:1033
Definition: element.hpp:324
int destroyElementsConditional(const Field &conditionalField)
Definition: element.hpp:964
Container/manager of fields and domains within a region.
Definition: fieldmodule.hpp:134
Definition: element.hpp:326
int destroyElement(const Element &element)
Definition: element.hpp:948
int getNumberOfChanges()
Definition: element.hpp:1234
int getNumberOfNodes()
Definition: element.hpp:568
Definition: element.hpp:91
Definition: element.hpp:360
Mesh getMasterMesh()
Definition: element.hpp:1021
Definition: element.hpp:94
cmzn_elementbasis_id getId() const
Definition: element.hpp:125
Element::ChangeFlags getSummaryElementChangeFlags()
Definition: element.hpp:1244
Definition: element.hpp:270
cmzn_elementtemplate_id getId() const
Definition: element.hpp:529
Definition: element.hpp:286
PointSamplingMode
Definition: element.hpp:347
Definition: element.hpp:264
int getNumberOfNodes()
Definition: element.hpp:171
Definition: element.hpp:374
int setNode(int localNodeIndex, const Node &node)
Definition: element.hpp:711
Element next()
Definition: element.hpp:778
enum Element::ShapeType getElementShapeType()
Definition: element.hpp:539
enum ShapeType getShapeType()
Definition: element.hpp:447
int removeElementsConditional(const Field &conditionalField)
Definition: element.hpp:1151
int setMapNodeValueLabel(const Field &field, int componentNumber, int basisNodeIndex, int nodeFunctionIndex, Node::ValueLabel nodeValueLabel)
Definition: element.hpp:655
Elementiterator createElementiterator()
Definition: element.hpp:908
Point object used to represent finite element nodes.
Definition: node.hpp:38
Definition: element.hpp:294
Definition: element.hpp:87
int merge(const Elementtemplate &elementTemplate)
Definition: element.hpp:1250
int setIdentifier(int identifier)
Definition: element.hpp:427
Definition: element.hpp:382
int getIdentifier()
Definition: element.hpp:414
Definition: element.hpp:338
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:891
Definition: element.hpp:376
A finite element mesh consisting of a set of elements of fixed dimension.
Definition: element.hpp:791
Definition: element.hpp:292
Definition: element.hpp:328
int getDimension()
Definition: element.hpp:1003
Fieldmodule getFieldmodule() const
Definition: fieldmodule.hpp:1779
Object describing changes to a mesh in a fieldmoduleevent.
Definition: element.hpp:1169
Definition: element.hpp:334
int setFunctionType(int chartComponent, FunctionType functionType)
Definition: element.hpp:160