OpenCMISS-Zinc C++ API Documentation
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Pages
fieldgroup.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_FIELDGROUP_HPP__
10 #define CMZN_FIELDGROUP_HPP__
11 
12 #include "zinc/fieldgroup.h"
13 #include "zinc/field.hpp"
14 #include "zinc/fieldmodule.hpp"
15 #include "zinc/fieldsubobjectgroup.hpp"
16 #include "zinc/node.hpp"
17 #include "zinc/element.hpp"
18 #include "zinc/region.hpp"
19 
20 namespace OpenCMISS
21 {
22 namespace Zinc
23 {
24 
35 class FieldGroup : public Field
36 {
37 public:
38 
39  FieldGroup() : Field(0)
40  { }
41 
42  // takes ownership of C handle, responsibility for destroying it
43  explicit FieldGroup(cmzn_field_group_id field_group_id) :
44  Field(reinterpret_cast<cmzn_field_id>(field_group_id))
45  { }
46 
52  bool isEmpty()
53  {
54  return cmzn_field_group_is_empty(reinterpret_cast<cmzn_field_group_id>(id));
55  }
56 
62  bool isEmptyLocal()
63  {
64  return cmzn_field_group_is_empty_local(reinterpret_cast<cmzn_field_group_id>(id));
65  }
66 
74  int clear()
75  {
76  return cmzn_field_group_clear(reinterpret_cast<cmzn_field_group_id>(id));
77  }
78 
85  int clearLocal()
86  {
87  return cmzn_field_group_clear_local(reinterpret_cast<cmzn_field_group_id>(id));
88  }
89 
97  {
98  return cmzn_field_group_remove_empty_subgroups(
99  reinterpret_cast<cmzn_field_group_id>(id));
100  }
101 
111  {
112  return cmzn_field_group_add_local_region(
113  reinterpret_cast<cmzn_field_group_id>(id));
114  }
115 
124  {
125  return cmzn_field_group_contains_local_region(
126  reinterpret_cast<cmzn_field_group_id>(id));
127  }
128 
138  {
139  return cmzn_field_group_remove_local_region(
140  reinterpret_cast<cmzn_field_group_id>(id));
141  }
142 
153  int addRegion(const Region& region)
154  {
155  return cmzn_field_group_add_region(reinterpret_cast<cmzn_field_group_id>(id),
156  region.getId());
157  }
158 
168  int removeRegion(const Region& region)
169  {
170  return cmzn_field_group_remove_region(reinterpret_cast<cmzn_field_group_id>(id),
171  region.getId());
172  }
173 
182  bool containsRegion(const Region& region)
183  {
184  return cmzn_field_group_contains_region(reinterpret_cast<cmzn_field_group_id>(id),
185  region.getId());
186  }
187 
198  {
199  return FieldGroup(cmzn_field_group_create_subregion_field_group(
200  reinterpret_cast<cmzn_field_group_id>(id), region.getId()));
201  }
202 
211  {
212  return FieldGroup(cmzn_field_group_get_subregion_field_group(
213  reinterpret_cast<cmzn_field_group_id>(id), region.getId()));
214  }
215 
230  {
231  return FieldNodeGroup(cmzn_field_group_create_field_node_group(
232  reinterpret_cast<cmzn_field_group_id>(id), nodeset.getId()));
233  }
234 
245  {
246  return FieldNodeGroup(cmzn_field_group_get_field_node_group(
247  reinterpret_cast<cmzn_field_group_id>(id), nodeset.getId()));
248  }
249 
264  {
265  return FieldElementGroup(cmzn_field_group_create_field_element_group(
266  reinterpret_cast<cmzn_field_group_id>(id), mesh.getId()));
267  }
268 
279  {
280  return FieldElementGroup(cmzn_field_group_get_field_element_group(
281  reinterpret_cast<cmzn_field_group_id>(id), mesh.getId()));
282  }
283 
291  {
292  return Field(cmzn_field_group_get_subobject_group_field_for_domain_field(
293  reinterpret_cast<cmzn_field_group_id>(id), domainField.getId()));
294  }
295 
302  {
303  return FieldGroup(cmzn_field_group_get_first_non_empty_subregion_field_group(
304  reinterpret_cast<cmzn_field_group_id>(id)));
305  }
306 
307 };
308 
310 {
311  return FieldGroup(reinterpret_cast<cmzn_field_group_id>(
312  cmzn_fieldmodule_create_field_group(id)));
313 }
314 
316 {
317  return FieldGroup(cmzn_field_cast_group(id));
318 }
319 
320 } // namespace Zinc
321 }
322 
323 #endif
A field which defines a subset of elements from a master mesh.
Definition: fieldsubobjectgroup.hpp:31
int removeRegion(const Region &region)
Definition: fieldgroup.hpp:168
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
int clear()
Definition: fieldgroup.hpp:74
FieldGroup getFirstNonEmptySubregionFieldGroup()
Definition: fieldgroup.hpp:301
cmzn_nodeset_id getId() const
Definition: node.hpp:474
bool isEmptyLocal()
Definition: fieldgroup.hpp:62
int removeEmptySubgroups()
Definition: fieldgroup.hpp:96
FieldNodeGroup createFieldNodeGroup(const Nodeset &nodeset)
Definition: fieldgroup.hpp:229
A field which defines a subset of nodes from a master nodeset.
Definition: fieldsubobjectgroup.hpp:64
int removeLocalRegion()
Definition: fieldgroup.hpp:137
A hierarchical block/namespace owning domains and fields.
Definition: region.hpp:33
cmzn_region_id getId() const
Definition: region.hpp:84
int addRegion(const Region &region)
Definition: fieldgroup.hpp:153
bool containsRegion(const Region &region)
Definition: fieldgroup.hpp:182
FieldGroup createSubregionFieldGroup(const Region &region)
Definition: fieldgroup.hpp:197
cmzn_field_id getId() const
Definition: field.hpp:98
FieldElementGroup getFieldElementGroup(const Mesh &mesh)
Definition: fieldgroup.hpp:278
cmzn_mesh_id getId() const
Definition: element.hpp:703
FieldGroup castGroup()
Definition: fieldgroup.hpp:315
FieldElementGroup createFieldElementGroup(const Mesh &mesh)
Definition: fieldgroup.hpp:263
int clearLocal()
Definition: fieldgroup.hpp:85
bool containsLocalRegion()
Definition: fieldgroup.hpp:123
FieldNodeGroup getFieldNodeGroup(const Nodeset &nodeset)
Definition: fieldgroup.hpp:244
A generic group field used for grouping local subobjects.
Definition: fieldgroup.hpp:35
FieldGroup getSubregionFieldGroup(const Region &region)
Definition: fieldgroup.hpp:210
Field getSubobjectGroupFieldForDomainField(const Field &domainField)
Definition: fieldgroup.hpp:290
bool isEmpty()
Definition: fieldgroup.hpp:52
int addLocalRegion()
Definition: fieldgroup.hpp:110
FieldGroup createFieldGroup()
Definition: fieldgroup.hpp:309
A finite element mesh consisting of a set of elements of fixed dimension.
Definition: element.hpp:650
A set of nodes or points.
Definition: node.hpp:421