OpenCMISS-Zinc C++ API Documentation
fieldsubobjectgroup.hpp
Go to the documentation of this file.
1 
4 /* OpenCMISS-Zinc Library
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 #ifndef CMZN_FIELDSUBOBJECTGROUP_HPP__
10 #define CMZN_FIELDSUBOBJECTGROUP_HPP__
11 
12 #include "opencmiss/zinc/fieldsubobjectgroup.h"
13 #include "opencmiss/zinc/field.hpp"
14 #include "opencmiss/zinc/fieldmodule.hpp"
15 #include "opencmiss/zinc/node.hpp"
16 #include "opencmiss/zinc/element.hpp"
17 
18 namespace OpenCMISS
19 {
20 namespace Zinc
21 {
22 
31 class FieldElementGroup : public Field
32 {
33 public:
34 
36  { }
37 
38  // takes ownership of C handle, responsibility for destroying it
39  explicit FieldElementGroup(cmzn_field_element_group_id field_element_group_id) :
40  Field(reinterpret_cast<cmzn_field_id>(field_element_group_id))
41  { }
42 
50  {
51  return MeshGroup(cmzn_field_element_group_get_mesh_group(
52  reinterpret_cast<cmzn_field_element_group_id>(id)));
53  }
54 };
55 
64 class FieldNodeGroup : public Field
65 {
66 public:
67 
68  FieldNodeGroup() : Field(0)
69  { }
70 
71  // takes ownership of C handle, responsibility for destroying it
72  explicit FieldNodeGroup(cmzn_field_node_group_id field_node_group_id) :
73  Field(reinterpret_cast<cmzn_field_id>(field_node_group_id))
74  { }
75 
83  {
84  return NodesetGroup(cmzn_field_node_group_get_nodeset_group(
85  reinterpret_cast<cmzn_field_node_group_id>(id)));
86  }
87 };
88 
90 {
91  return FieldElementGroup(reinterpret_cast<cmzn_field_element_group_id>(
92  cmzn_fieldmodule_create_field_element_group(id, mesh.getId())));
93 }
94 
96 {
97  return FieldElementGroup(cmzn_field_cast_element_group(id));
98 }
99 
101 {
102  return FieldNodeGroup(reinterpret_cast<cmzn_field_node_group_id>(
103  cmzn_fieldmodule_create_field_node_group(id, nodeset.getId())));
104 }
105 
107 {
108  return FieldNodeGroup(cmzn_field_cast_node_group(id));
109 }
110 
111 } // namespace Zinc
112 }
113 
114 #endif
FieldNodeGroup castNodeGroup()
Definition: fieldsubobjectgroup.hpp:106
A field which defines a subset of elements from a master mesh.
Definition: fieldsubobjectgroup.hpp:31
FieldElementGroup castElementGroup()
Definition: fieldsubobjectgroup.hpp:95
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:51
FieldElementGroup createFieldElementGroup(const Mesh &mesh)
Definition: fieldsubobjectgroup.hpp:89
A subset of a master nodeset.
Definition: nodeset.hpp:265
cmzn_nodeset_id getId() const
Definition: nodeset.hpp:82
A field which defines a subset of nodes from a master nodeset.
Definition: fieldsubobjectgroup.hpp:64
NodesetGroup getNodesetGroup()
Definition: fieldsubobjectgroup.hpp:82
FieldNodeGroup createFieldNodeGroup(const Nodeset &nodeset)
Definition: fieldsubobjectgroup.hpp:100
cmzn_mesh_id getId() const
Definition: mesh.hpp:87
A subset of a master mesh.
Definition: mesh.hpp:336
The OpenCMISS namespace.
Definition: context.hpp:20
A finite element mesh consisting of a set of elements of fixed dimension.
Definition: mesh.hpp:34
MeshGroup getMeshGroup()
Definition: fieldsubobjectgroup.hpp:49
A set of nodes or points.
Definition: nodeset.hpp:29