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));
415 inline bool operator==(
const Element& a,
const Element& b)
417 return a.getId() == b.getId();
431 cmzn_elementtemplate_id id;
439 explicit Elementtemplate(cmzn_elementtemplate_id element_template_id) :
440 id(element_template_id)
444 id(cmzn_elementtemplate_access(elementTemplate.id))
449 cmzn_elementtemplate_id temp_id = cmzn_elementtemplate_access(elementTemplate.id);
452 cmzn_elementtemplate_destroy(&
id);
462 cmzn_elementtemplate_destroy(&
id);
481 cmzn_elementtemplate_id
getId()
const
488 return static_cast<Element::ShapeType>(cmzn_elementtemplate_get_element_shape_type(
id));
493 return cmzn_elementtemplate_set_element_shape_type(
id,
494 static_cast<cmzn_element_shape_type>(shapeType));
504 return cmzn_elementtemplate_get_number_of_nodes(
id);
517 return cmzn_elementtemplate_set_number_of_nodes(
id, numberOfNodes);
541 const Elementbasis& basis,
int nodeIndexesCount,
const int *nodeIndexesIn)
543 return cmzn_elementtemplate_define_field_simple_nodal(
544 id, field.
getId(), componentNumber, basis.
getId(),
545 nodeIndexesCount, nodeIndexesIn);
558 return Node(cmzn_elementtemplate_get_node(
id, localNodeIndex));
572 return cmzn_elementtemplate_set_node(
id, localNodeIndex, node.
getId());
585 cmzn_elementiterator_id id;
593 explicit Elementiterator(cmzn_elementiterator_id element_iterator_id) :
594 id(element_iterator_id)
598 id(cmzn_elementiterator_access(elementIterator.id))
603 cmzn_elementiterator_id temp_id = cmzn_elementiterator_access(elementIterator.id);
606 cmzn_elementiterator_destroy(&
id);
616 cmzn_elementiterator_destroy(&
id);
639 return Element(cmzn_elementiterator_next(
id));
662 explicit Mesh(cmzn_mesh_id mesh_id) : id(mesh_id)
666 id(cmzn_mesh_access(mesh.id))
673 cmzn_mesh_destroy(&
id);
689 cmzn_mesh_id temp_id = cmzn_mesh_access(mesh.id);
692 cmzn_mesh_destroy(&
id);
716 return cmzn_mesh_contains_element(
id, element.
getId());
743 return Element(cmzn_mesh_create_element(
id, identifier, elementTemplate.
getId()));
776 return cmzn_mesh_define_element(
id, identifier, elementTemplate.
getId());
787 return cmzn_mesh_destroy_all_elements(
id);
800 return cmzn_mesh_destroy_element(
id, element.
getId());
816 return cmzn_mesh_destroy_elements_conditional(
id,
817 conditionalField.
getId());
828 return Element(cmzn_mesh_find_element_by_identifier(
id, identifier));
855 return cmzn_mesh_get_dimension(
id);
873 return Mesh(cmzn_mesh_get_master_mesh(
id));
885 return cmzn_mesh_get_name(
id);
895 return cmzn_mesh_get_size(
id);
900 inline bool operator==(
const Mesh& a,
const Mesh& b)
902 return cmzn_mesh_match(a.getId(), b.getId());
907 return Mesh(cmzn_element_get_mesh(
id));
921 explicit MeshGroup(cmzn_mesh_group_id mesh_id) :
Mesh(reinterpret_cast<cmzn_mesh_id>(mesh_id))
931 return (cmzn_mesh_group_id)(id);
942 return cmzn_mesh_group_add_element(
943 reinterpret_cast<cmzn_mesh_group_id>(
id), element.
getId());
953 return cmzn_mesh_group_remove_all_elements(reinterpret_cast<cmzn_mesh_group_id>(
id));
964 return cmzn_mesh_group_remove_element(reinterpret_cast<cmzn_mesh_group_id>(
id),
980 return cmzn_mesh_group_remove_elements_conditional(
981 reinterpret_cast<cmzn_mesh_group_id>(
id), conditionalField.
getId());
995 cmzn_meshchanges_id id;
1003 explicit Meshchanges(cmzn_meshchanges_id meshchanges_id) :
1008 id(cmzn_meshchanges_access(meshchanges.id))
1013 cmzn_meshchanges_id temp_id = cmzn_meshchanges_access(meshchanges.id);
1015 cmzn_meshchanges_destroy(&
id);
1023 cmzn_meshchanges_destroy(&
id);
1038 return cmzn_meshchanges_get_element_change_flags(
id, element.
getId());
1050 return cmzn_meshchanges_get_number_of_changes(
id);
1055 return cmzn_meshchanges_get_summary_element_change_flags(
id);
1059 inline int Element::merge(
const Elementtemplate& elementTemplate)
1061 return cmzn_element_merge(
id, elementTemplate.getId());
Definition: element.hpp:274
int addElement(const Element &element)
Definition: element.hpp:940
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
Definition: element.hpp:252
Definition: element.hpp:322
int destroyAllElements()
Definition: element.hpp:785
int defineElement(int identifier, const Elementtemplate &elementTemplate)
Definition: element.hpp:774
A set of basis functions that can apply over an element of a given dimension.
Definition: element.hpp:31
Elementtemplate createElementtemplate()
Definition: element.hpp:725
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
Definition: element.hpp:248
bool isValid() const
Definition: element.hpp:625
ShapeType
Definition: element.hpp:304
Differentialoperator getChartDifferentialoperator(int order, int term)
Definition: element.hpp:842
int removeAllElements()
Definition: element.hpp:951
int getDimension()
Definition: element.hpp:135
Mesh getMesh() const
Definition: element.hpp:905
int getNumberOfFunctions()
Definition: element.hpp:188
Definition: element.hpp:314
Definition: element.hpp:115
int setNumberOfNodes(int numberOfNodes)
Definition: element.hpp:515
cmzn_mesh_group_id getId() const
Definition: element.hpp:929
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:556
Definition: element.hpp:286
bool isValid() const
Definition: element.hpp:238
bool isValid() const
Definition: element.hpp:471
int defineFieldSimpleNodal(const Field &field, int componentNumber, const Elementbasis &basis, int nodeIndexesCount, const int *nodeIndexesIn)
Definition: element.hpp:540
Definition: element.hpp:337
Definition: element.hpp:284
int removeElement(const Element &element)
Definition: element.hpp:962
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:581
Definition: element.hpp:100
Element findElementByIdentifier(int identifier)
Definition: element.hpp:826
Definition: element.hpp:282
A description of element shape and field definitions.
Definition: element.hpp:427
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:703
bool containsElement(const Element &element)
Definition: element.hpp:714
Definition: element.hpp:254
bool isValid() const
Definition: element.hpp:1031
int getSize()
Definition: element.hpp:893
bool isValid() const
Definition: element.hpp:682
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:915
char * getName()
Definition: element.hpp:883
Definition: element.hpp:306
int destroyElementsConditional(const Field &conditionalField)
Definition: element.hpp:814
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:798
int getNumberOfChanges()
Definition: element.hpp:1048
int getNumberOfNodes()
Definition: element.hpp:502
Definition: element.hpp:91
Definition: element.hpp:342
Mesh getMasterMesh()
Definition: element.hpp:871
Definition: element.hpp:94
cmzn_elementbasis_id getId() const
Definition: element.hpp:125
Definition: element.hpp:256
cmzn_elementtemplate_id getId() const
Definition: element.hpp:481
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:570
Element next()
Definition: element.hpp:637
enum ShapeType getShapeType()
Definition: element.hpp:406
int removeElementsConditional(const Field &conditionalField)
Definition: element.hpp:978
Elementiterator createElementiterator()
Definition: element.hpp:758
Point object used to represent finite element nodes.
Definition: node.hpp:37
Definition: element.hpp:276
Definition: element.hpp:87
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:741
A finite element mesh consisting of a set of elements of fixed dimension.
Definition: element.hpp:650
Definition: element.hpp:310
int getDimension()
Definition: element.hpp:853
Fieldmodule getFieldmodule() const
Definition: fieldmodule.hpp:1577
Object describing changes to a mesh in a fieldmoduleevent.
Definition: element.hpp:991
Definition: element.hpp:316
int setFunctionType(int chartComponent, FunctionType functionType)
Definition: element.hpp:160