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);
197 class Elementtemplate;
217 explicit Element(cmzn_element_id element_id) :
222 id(cmzn_element_access(element.id))
229 cmzn_element_destroy(&
id);
292 cmzn_element_id temp_id = cmzn_element_access(element.id);
295 cmzn_element_destroy(&
id);
363 return cmzn_element_get_dimension(
id);
375 return cmzn_element_get_identifier(
id);
388 return cmzn_element_set_identifier(
id, identifier);
408 return static_cast<ShapeType>(cmzn_element_get_shape_type(
id));
422 inline bool operator==(
const Element& a,
const Element& b)
424 return a.getId() == b.getId();
438 cmzn_elementtemplate_id id;
446 explicit Elementtemplate(cmzn_elementtemplate_id element_template_id) :
447 id(element_template_id)
451 id(cmzn_elementtemplate_access(elementTemplate.id))
456 cmzn_elementtemplate_id temp_id = cmzn_elementtemplate_access(elementTemplate.id);
459 cmzn_elementtemplate_destroy(&
id);
469 cmzn_elementtemplate_destroy(&
id);
488 cmzn_elementtemplate_id
getId()
const
500 return static_cast<Element::ShapeType>(cmzn_elementtemplate_get_element_shape_type(
id));
518 return cmzn_elementtemplate_set_element_shape_type(
id,
519 static_cast<cmzn_element_shape_type>(shapeType));
529 return cmzn_elementtemplate_get_number_of_nodes(
id);
542 return cmzn_elementtemplate_set_number_of_nodes(
id, numberOfNodes);
566 const Elementbasis& basis,
int nodeIndexesCount,
const int *nodeIndexesIn)
568 return cmzn_elementtemplate_define_field_simple_nodal(
569 id, field.
getId(), componentNumber, basis.
getId(),
570 nodeIndexesCount, nodeIndexesIn);
583 return Node(cmzn_elementtemplate_get_node(
id, localNodeIndex));
597 return cmzn_elementtemplate_set_node(
id, localNodeIndex, node.
getId());
610 cmzn_elementiterator_id id;
618 explicit Elementiterator(cmzn_elementiterator_id element_iterator_id) :
619 id(element_iterator_id)
623 id(cmzn_elementiterator_access(elementIterator.id))
628 cmzn_elementiterator_id temp_id = cmzn_elementiterator_access(elementIterator.id);
631 cmzn_elementiterator_destroy(&
id);
641 cmzn_elementiterator_destroy(&
id);
664 return Element(cmzn_elementiterator_next(
id));
687 explicit Mesh(cmzn_mesh_id mesh_id) : id(mesh_id)
691 id(cmzn_mesh_access(mesh.id))
698 cmzn_mesh_destroy(&
id);
714 cmzn_mesh_id temp_id = cmzn_mesh_access(mesh.id);
717 cmzn_mesh_destroy(&
id);
741 return cmzn_mesh_contains_element(
id, element.
getId());
768 return Element(cmzn_mesh_create_element(
id, identifier, elementTemplate.
getId()));
801 return cmzn_mesh_define_element(
id, identifier, elementTemplate.
getId());
812 return cmzn_mesh_destroy_all_elements(
id);
825 return cmzn_mesh_destroy_element(
id, element.
getId());
841 return cmzn_mesh_destroy_elements_conditional(
id,
842 conditionalField.
getId());
853 return Element(cmzn_mesh_find_element_by_identifier(
id, identifier));
880 return cmzn_mesh_get_dimension(
id);
898 return Mesh(cmzn_mesh_get_master_mesh(
id));
910 return cmzn_mesh_get_name(
id);
920 return cmzn_mesh_get_size(
id);
925 inline bool operator==(
const Mesh& a,
const Mesh& b)
927 return cmzn_mesh_match(a.getId(), b.getId());
932 return Mesh(cmzn_element_get_mesh(
id));
946 explicit MeshGroup(cmzn_mesh_group_id mesh_id) :
Mesh(reinterpret_cast<cmzn_mesh_id>(mesh_id))
956 return (cmzn_mesh_group_id)(id);
967 return cmzn_mesh_group_add_element(
968 reinterpret_cast<cmzn_mesh_group_id>(
id), element.
getId());
978 return cmzn_mesh_group_remove_all_elements(reinterpret_cast<cmzn_mesh_group_id>(
id));
989 return cmzn_mesh_group_remove_element(reinterpret_cast<cmzn_mesh_group_id>(
id),
1005 return cmzn_mesh_group_remove_elements_conditional(
1006 reinterpret_cast<cmzn_mesh_group_id>(
id), conditionalField.
getId());
1020 cmzn_meshchanges_id id;
1028 explicit Meshchanges(cmzn_meshchanges_id meshchanges_id) :
1033 id(cmzn_meshchanges_access(meshchanges.id))
1038 cmzn_meshchanges_id temp_id = cmzn_meshchanges_access(meshchanges.id);
1040 cmzn_meshchanges_destroy(&
id);
1048 cmzn_meshchanges_destroy(&
id);
1069 return cmzn_meshchanges_get_element_change_flags(
id, element.
getId());
1081 return cmzn_meshchanges_get_number_of_changes(
id);
1091 return cmzn_meshchanges_get_summary_element_change_flags(
id);
1097 return cmzn_element_merge(
id, elementTemplate.
getId());
Definition: element.hpp:274
int addElement(const Element &element)
Definition: element.hpp:965
Definition: element.hpp:318
Definition: element.hpp:278
A single finite element from a mesh.
Definition: element.hpp:205
Definition: element.hpp:89
Definition: element.hpp:97
int setElementShapeType(enum Element::ShapeType shapeType)
Definition: element.hpp:516
Definition: element.hpp:252
Definition: element.hpp:322
int destroyAllElements()
Definition: element.hpp:810
int defineElement(int identifier, const Elementtemplate &elementTemplate)
Definition: element.hpp:799
A set of basis functions that can apply over an element of a given dimension.
Definition: element.hpp:31
Elementtemplate createElementtemplate()
Definition: element.hpp:750
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
Definition: element.hpp:248
bool isValid() const
Definition: element.hpp:650
ShapeType
Definition: element.hpp:304
Differentialoperator getChartDifferentialoperator(int order, int term)
Definition: element.hpp:867
int removeAllElements()
Definition: element.hpp:976
int getDimension()
Definition: element.hpp:135
Mesh getMesh() const
Definition: element.hpp:930
int getNumberOfFunctions()
Definition: element.hpp:188
Definition: element.hpp:314
Definition: element.hpp:115
int setNumberOfNodes(int numberOfNodes)
Definition: element.hpp:540
cmzn_mesh_group_id getId() const
Definition: element.hpp:954
Definition: element.hpp:258
int ChangeFlags
Definition: element.hpp:265
Describes the derivative of a field to evaluate.
Definition: differentialoperator.hpp:26
Node getNode(int localNodeIndex)
Definition: element.hpp:581
Definition: element.hpp:286
bool isValid() const
Definition: element.hpp:238
Element::ChangeFlags getElementChangeFlags(const Element &element)
Definition: element.hpp:1067
bool isValid() const
Definition: element.hpp:478
int defineFieldSimpleNodal(const Field &field, int componentNumber, const Elementbasis &basis, int nodeIndexesCount, const int *nodeIndexesIn)
Definition: element.hpp:565
Definition: element.hpp:337
Definition: element.hpp:284
int removeElement(const Element &element)
Definition: element.hpp:987
Definition: element.hpp:312
cmzn_field_id getId() const
Definition: field.hpp:98
An iterator for looping through all the elements in a mesh.
Definition: element.hpp:606
Definition: element.hpp:100
Element findElementByIdentifier(int identifier)
Definition: element.hpp:851
Definition: element.hpp:282
A description of element shape and field definitions.
Definition: element.hpp:434
int getDimension()
Definition: element.hpp:361
FunctionType
Definition: element.hpp:85
cmzn_element_id getId() const
Definition: element.hpp:351
ChangeFlag
Definition: element.hpp:246
Definition: element.hpp:331
enum FunctionType getFunctionType(int chartComponent)
Definition: element.hpp:147
cmzn_mesh_id getId() const
Definition: element.hpp:728
bool containsElement(const Element &element)
Definition: element.hpp:739
Definition: element.hpp:254
bool isValid() const
Definition: element.hpp:1056
int getSize()
Definition: element.hpp:918
bool isValid() const
Definition: element.hpp:707
Definition: element.hpp:280
Definition: element.hpp:335
cmzn_node_id getId() const
Definition: node.hpp:139
Definition: element.hpp:333
A subset of a master mesh.
Definition: element.hpp:940
char * getName()
Definition: element.hpp:908
Definition: element.hpp:306
int destroyElementsConditional(const Field &conditionalField)
Definition: element.hpp:839
Container/manager of fields and domains within a region.
Definition: fieldmodule.hpp:126
Definition: element.hpp:308
int destroyElement(const Element &element)
Definition: element.hpp:823
int getNumberOfChanges()
Definition: element.hpp:1079
int getNumberOfNodes()
Definition: element.hpp:527
Definition: element.hpp:91
Definition: element.hpp:342
Mesh getMasterMesh()
Definition: element.hpp:896
Definition: element.hpp:94
cmzn_elementbasis_id getId() const
Definition: element.hpp:125
Element::ChangeFlags getSummaryElementChangeFlags()
Definition: element.hpp:1089
Definition: element.hpp:256
cmzn_elementtemplate_id getId() const
Definition: element.hpp:488
Definition: element.hpp:272
PointSamplingMode
Definition: element.hpp:329
Definition: element.hpp:250
int getNumberOfNodes()
Definition: element.hpp:171
int setNode(int localNodeIndex, const Node &node)
Definition: element.hpp:595
Element next()
Definition: element.hpp:662
enum Element::ShapeType getElementShapeType()
Definition: element.hpp:498
enum ShapeType getShapeType()
Definition: element.hpp:406
int removeElementsConditional(const Field &conditionalField)
Definition: element.hpp:1003
Elementiterator createElementiterator()
Definition: element.hpp:783
Point object used to represent finite element nodes.
Definition: node.hpp:37
Definition: element.hpp:276
Definition: element.hpp:87
int merge(const Elementtemplate &elementTemplate)
Definition: element.hpp:1095
int setIdentifier(int identifier)
Definition: element.hpp:386
int getIdentifier()
Definition: element.hpp:373
Definition: element.hpp:320
Definition: element.hpp:107
bool isValid() const
Definition: element.hpp:75
FaceType
Definition: element.hpp:270
Element createElement(int identifier, const Elementtemplate &elementTemplate)
Definition: element.hpp:766
A finite element mesh consisting of a set of elements of fixed dimension.
Definition: element.hpp:675
Definition: element.hpp:310
int getDimension()
Definition: element.hpp:878
Fieldmodule getFieldmodule() const
Definition: fieldmodule.hpp:1613
Object describing changes to a mesh in a fieldmoduleevent.
Definition: element.hpp:1016
Definition: element.hpp:316
int setFunctionType(int chartComponent, FunctionType functionType)
Definition: element.hpp:160