OpenCMISS-Zinc C++ API Documentation
fieldderivatives.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_FIELDDERIVATIVES_HPP__
10 #define CMZN_FIELDDERIVATIVES_HPP__
11 
12 #include "opencmiss/zinc/fieldderivatives.h"
13 #include "opencmiss/zinc/field.hpp"
14 #include "opencmiss/zinc/fieldmodule.hpp"
15 
16 namespace OpenCMISS
17 {
18 namespace Zinc
19 {
20 class FieldDerivative : public Field
30 {
31 private:
32  // takes ownership of C handle, responsibility for destroying it
33  explicit FieldDerivative(cmzn_field_id field_id) : Field(field_id)
34  { }
35 
36  friend FieldDerivative Fieldmodule::createFieldDerivative(const Field& sourceField, int xi_index);
37 
38 public:
39 
40  FieldDerivative() : Field(0)
41  { }
42 
43 };
44 class FieldCurl : public Field
53 {
54 private:
55  // takes ownership of C handle, responsibility for destroying it
56  explicit FieldCurl(cmzn_field_id field_id) : Field(field_id)
57  { }
58 
59  friend FieldCurl Fieldmodule::createFieldCurl(const Field& vectorField, const Field& coordinateField);
60 
61 public:
62 
63  FieldCurl() : Field(0)
64  { }
65 
66 };
67 class FieldDivergence : public Field
78 {
79 private:
80  // takes ownership of C handle, responsibility for destroying it
81  explicit FieldDivergence(cmzn_field_id field_id) : Field(field_id)
82  { }
83 
84  friend FieldDivergence Fieldmodule::createFieldDivergence(const Field& vectorField, const Field& coordinateField);
85 
86 public:
87 
88  FieldDivergence() : Field(0)
89  { }
90 
91 };
92 class FieldGradient : public Field
113 {
114 private:
115  // takes ownership of C handle, responsibility for destroying it
116  explicit FieldGradient(cmzn_field_id field_id) : Field(field_id)
117  { }
118 
119  friend FieldGradient Fieldmodule::createFieldGradient(const Field& sourceField, const Field& coordinateField);
120 
121 public:
122 
123  FieldGradient() : Field(0)
124  { }
125 
126 };
127 
128 inline FieldDerivative Fieldmodule::createFieldDerivative(const Field& sourceField, int xi_index)
129 {
130  return FieldDerivative(cmzn_fieldmodule_create_field_derivative(id, sourceField.getId(), xi_index));
131 }
132 
133 inline FieldCurl Fieldmodule::createFieldCurl(const Field& vectorField, const Field& coordinateField)
134 {
135  return FieldCurl(cmzn_fieldmodule_create_field_curl(id, vectorField.getId(), coordinateField.getId()));
136 }
137 
138 inline FieldDivergence Fieldmodule::createFieldDivergence(const Field& vectorField, const Field& coordinateField)
139 {
140  return FieldDivergence(cmzn_fieldmodule_create_field_divergence(id, vectorField.getId(), coordinateField.getId()));
141 }
142 
143 inline FieldGradient Fieldmodule::createFieldGradient(const Field& sourceField, const Field& coordinateField)
144 {
145  return FieldGradient(cmzn_fieldmodule_create_field_gradient(id, sourceField.getId(),
146  coordinateField.getId()));
147 }
148 
149 } // namespace Zinc
150 }
151 
152 #endif
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:51
FieldGradient createFieldGradient(const Field &sourceField, const Field &coordinateField)
Definition: fieldderivatives.hpp:143
FieldDivergence createFieldDivergence(const Field &vectorField, const Field &coordinateField)
Definition: fieldderivatives.hpp:138
A field returning the derivative of the field with respect to element xi_index as its primary value...
Definition: fieldderivatives.hpp:29
cmzn_field_id getId() const
Definition: field.hpp:103
A field returning the gradient of a source field with respect to a given coordinate field...
Definition: fieldderivatives.hpp:112
A scalar field returning the divergence of vector field within coordinate field.
Definition: fieldderivatives.hpp:77
FieldDerivative createFieldDerivative(const Field &sourceField, int xi_index)
Definition: fieldderivatives.hpp:128
The OpenCMISS namespace.
Definition: context.hpp:20
A field returning the curl of vector_field at location given by coordinate_field. ...
Definition: fieldderivatives.hpp:52
FieldCurl createFieldCurl(const Field &vectorField, const Field &coordinateField)
Definition: fieldderivatives.hpp:133