OpenCMISS-Zinc C++ API Documentation
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Pages
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 "zinc/fieldderivatives.h"
13 #include "zinc/field.hpp"
14 #include "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
112 {
113 private:
114  // takes ownership of C handle, responsibility for destroying it
115  explicit FieldGradient(cmzn_field_id field_id) : Field(field_id)
116  { }
117 
118  friend FieldGradient Fieldmodule::createFieldGradient(const Field& sourceField, const Field& coordinateField);
119 
120 public:
121 
122  FieldGradient() : Field(0)
123  { }
124 
125 };
126 
127 inline FieldDerivative Fieldmodule::createFieldDerivative(const Field& sourceField, int xi_index)
128 {
129  return FieldDerivative(cmzn_fieldmodule_create_field_derivative(id, sourceField.getId(), xi_index));
130 }
131 
132 inline FieldCurl Fieldmodule::createFieldCurl(const Field& vectorField, const Field& coordinateField)
133 {
134  return FieldCurl(cmzn_fieldmodule_create_field_curl(id, vectorField.getId(), coordinateField.getId()));
135 }
136 
137 inline FieldDivergence Fieldmodule::createFieldDivergence(const Field& vectorField, const Field& coordinateField)
138 {
139  return FieldDivergence(cmzn_fieldmodule_create_field_divergence(id, vectorField.getId(), coordinateField.getId()));
140 }
141 
142 inline FieldGradient Fieldmodule::createFieldGradient(const Field& sourceField, const Field& coordinateField)
143 {
144  return FieldGradient(cmzn_fieldmodule_create_field_gradient(id, sourceField.getId(),
145  coordinateField.getId()));
146 }
147 
148 } // namespace Zinc
149 }
150 
151 #endif
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
FieldGradient createFieldGradient(const Field &sourceField, const Field &coordinateField)
Definition: fieldderivatives.hpp:142
FieldDivergence createFieldDivergence(const Field &vectorField, const Field &coordinateField)
Definition: fieldderivatives.hpp:137
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:98
A field returning the curl of vector_field at location given by coordinate_field. ...
Definition: fieldderivatives.hpp:111
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:127
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:132