10 #ifndef CMZN_FIELDCACHE_HPP__
11 #define CMZN_FIELDCACHE_HPP__
13 #include "zinc/field.h"
14 #include "zinc/fieldcache.h"
15 #include "zinc/differentialoperator.hpp"
16 #include "zinc/element.hpp"
17 #include "zinc/fieldmodule.hpp"
18 #include "zinc/node.hpp"
36 cmzn_fieldcache_id id;
44 explicit Fieldcache(cmzn_fieldcache_id in_field_cache_id) :
49 id(cmzn_fieldcache_access(fieldCache.id))
54 cmzn_fieldcache_id temp_id = cmzn_fieldcache_access(fieldCache.id);
57 cmzn_fieldcache_destroy(&
id);
67 cmzn_fieldcache_destroy(&
id);
86 cmzn_fieldcache_id
getId()
const
102 return cmzn_fieldcache_clear_location(
id);
117 return cmzn_fieldcache_set_element(
id, element.
getId());
136 const double *coordinatesIn)
138 return cmzn_fieldcache_set_mesh_location(
id, element.
getId(),
139 coordinatesCount, coordinatesIn);
155 const double *valuesIn)
157 return cmzn_fieldcache_set_field_real(
id,
158 referenceField.
getId(), valuesCount, valuesIn);
172 return cmzn_fieldcache_set_node(
id, node.
getId());
183 return cmzn_fieldcache_set_time(
id, time);
189 return Fieldcache(cmzn_fieldmodule_create_fieldcache(
id));
193 int coordinatesCount,
const double *coordinatesIn)
195 return cmzn_field_assign_mesh_location(
id, cache.
getId(), element.
getId(),
196 coordinatesCount, coordinatesIn);
201 return cmzn_field_assign_real(
id, cache.
getId(), valuesCount, valuesIn);
206 return cmzn_field_assign_string(
id, cache.
getId(), stringValue);
210 double *coordinatesOut)
212 return Element(cmzn_field_evaluate_mesh_location(
id,
213 cache.
getId(), coordinatesCount, coordinatesOut));
218 return cmzn_field_evaluate_real(
id, cache.
getId(), valuesCount, valuesOut);
223 return cmzn_field_evaluate_string(
id, cache.
getId());
227 const Fieldcache& cache,
int valuesCount,
double *valuesOut)
229 return cmzn_field_evaluate_derivative(
id, differentialOperator.
getId(),
230 cache.
getId(), valuesCount, valuesOut);
235 return cmzn_field_is_defined_at_location(
id, cache.
getId());
int evaluateDerivative(const Differentialoperator&differentialOperator, const Fieldcache &cache, int valuesCount, double *valuesOut)
Definition: fieldcache.hpp:226
A single finite element from a mesh.
Definition: element.hpp:205
Element evaluateMeshLocation(const Fieldcache &cache, int coordinatesCount, double *coordinatesOut)
Definition: fieldcache.hpp:209
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
int assignReal(const Fieldcache &cache, int valuesCount, const double *valuesIn)
Definition: fieldcache.hpp:199
int clearLocation()
Definition: fieldcache.hpp:100
int setNode(const Node &node)
Definition: fieldcache.hpp:170
Describes the derivative of a field to evaluate.
Definition: differentialoperator.hpp:26
int assignString(const Fieldcache &cache, const char *stringValue)
Definition: fieldcache.hpp:204
int setElement(const Element &element)
Definition: fieldcache.hpp:115
int setTime(double time)
Definition: fieldcache.hpp:181
int setFieldReal(const Field &referenceField, int valuesCount, const double *valuesIn)
Definition: fieldcache.hpp:154
char * evaluateString(const Fieldcache &cache)
Definition: fieldcache.hpp:221
cmzn_field_id getId() const
Definition: field.hpp:98
bool isDefinedAtLocation(const Fieldcache &cache)
Definition: fieldcache.hpp:233
cmzn_element_id getId() const
Definition: element.hpp:351
int assignMeshLocation(const Fieldcache &cache, const Element &element, int coordinatesCount, const double *coordinatesIn)
Definition: fieldcache.hpp:192
cmzn_node_id getId() const
Definition: node.hpp:139
Cache for setting domain locations at which fields are evaluated or assigned.
Definition: fieldcache.hpp:33
bool isValid() const
Definition: fieldcache.hpp:76
cmzn_differentialoperator_id getId() const
Definition: differentialoperator.hpp:79
int setMeshLocation(const Element &element, int coordinatesCount, const double *coordinatesIn)
Definition: fieldcache.hpp:135
Point object used to represent finite element nodes.
Definition: node.hpp:37
Fieldcache createFieldcache()
Definition: fieldcache.hpp:187
cmzn_fieldcache_id getId() const
Definition: fieldcache.hpp:86
int evaluateReal(const Fieldcache &cache, int valuesCount, double *valuesOut)
Definition: fieldcache.hpp:216