v0.16.3
Loading...
Searching...
No Matches
UserDataOperatorsFromTags.hpp
Go to the documentation of this file.
1/** \file UserDataOperatorsFromTags.hpp
2 * \brief Operators evaluating MOAB tag data at integration points
3 *
4 * The factories in this file create operators that read a fixed-length double
5 * tag, either on the finite-element entity or on its corner vertices, and
6 * store the values at integration points. The output has the layout of the
7 * field value operators in UserDataOperators.hpp, so any operator consuming
8 * OpCalculateScalarFieldValues, OpCalculateVectorFieldValues,
9 * OpCalculateTensor2FieldValues or OpCalculateTensor2SymmetricFieldValues
10 * output can consume these.
11 *
12 * The operators need no field on the element and do no communication. On
13 * distributed meshes the caller makes tag values on shared and ghost entities
14 * consistent before the element loop.
15 *
16 * \ingroup mofem_forces_and_sources_user_data_operators
17 */
18
19#ifndef __USER_DATA_OPERATORS_FROM_TAGS_HPP__
20#define __USER_DATA_OPERATORS_FROM_TAGS_HPP__
21
22namespace MoFEM {
23
24/**
25 * \brief Where tag values live and how they are evaluated
26 *
27 * \ingroup mofem_forces_and_sources_user_data_operators
28 */
29enum class TagSpace {
30 /// One value on the finite-element entity, constant over the element.
31 /// Equivalent to an L2 field at order 0.
32 ENTITY,
33 /// One value per corner vertex, interpolated with the vertex shape
34 /// functions (linear on simplices, bilinear on quads, trilinear on hexes).
35 /// Equivalent to an order-1 H1 field whose vertex DOFs equal the tag values.
36 /// Supported on vertices, edges, triangles, quads, tetrahedra and hexes.
37 VERTEX
38};
39
40/**
41 * \brief Component order of a tensor stored on a tag
42 *
43 * The output of the tensor operators is always in FTensor storage order.
44 *
45 * | Tensor | FTENSOR | VOIGT |
46 * |---------------|----------------------------|----------------------------|
47 * | Symmetric, 3D | 00 01 02 11 12 22 | 00 11 22 01 02 12 |
48 * | Symmetric, 2D | 00 01 11 | 00 11 01 |
49 * | Full, 3D | 00 01 02 10 11 12 20 21 22 | 00 11 22 01 10 02 20 12 21 |
50 * | Full, 2D | 00 01 10 11 | 00 11 01 10 |
51 *
52 * VOIGT stores shear entries as tensor components, without a scale factor.
53 *
54 * \ingroup mofem_forces_and_sources_user_data_operators
55 */
56enum class TagNotation { FTENSOR, VOIGT };
57
58/**
59 * \brief Create operator evaluating a scalar tag at integration points
60 *
61 * @param tag_name name of a fixed-length double tag with one component
62 * @param data_ptr values at integration points
63 * @param space where the tag lives, see TagSpace
64 * @param allow_longer_tag accept a longer tag and read its first component
65 * @return operator to push to a pipeline, which takes ownership
66 *
67 * \ingroup mofem_forces_and_sources_user_data_operators
68 */
69ForcesAndSourcesCore::UserDataOperator *
71 const std::string tag_name, boost::shared_ptr<VectorDouble> data_ptr,
72 const TagSpace space, const bool allow_longer_tag = false);
73
74/**
75 * \brief Create operator evaluating a vector tag at integration points
76 *
77 * Instantiated for DIM = 1, 2, 3.
78 *
79 * @param tag_name name of a fixed-length double tag with DIM components
80 * @param data_ptr values at integration points, DIM components per point
81 * @param space where the tag lives, see TagSpace
82 * @param allow_longer_tag accept a longer tag and read its first DIM
83 * components
84 * @return operator to push to a pipeline, which takes ownership
85 *
86 * \ingroup mofem_forces_and_sources_user_data_operators
87 */
88template <int DIM>
89ForcesAndSourcesCore::UserDataOperator *
91 const std::string tag_name, boost::shared_ptr<MatrixDouble> data_ptr,
92 const TagSpace space, const bool allow_longer_tag = false);
93
94/**
95 * \brief Create operator evaluating a symmetric tensor tag at integration
96 * points
97 *
98 * Instantiated for DIM = 2, 3.
99 *
100 * @param tag_name name of a fixed-length double tag with DIM(DIM+1)/2
101 * components
102 * @param data_ptr values at integration points in FTensor symmetric storage
103 * @param space where the tag lives, see TagSpace
104 * @param notation component order in the tag, see TagNotation
105 * @param allow_longer_tag accept a longer tag and read its leading components
106 * @return operator to push to a pipeline, which takes ownership
107 *
108 * \ingroup mofem_forces_and_sources_user_data_operators
109 */
110template <int DIM>
111ForcesAndSourcesCore::UserDataOperator *
113 const std::string tag_name, boost::shared_ptr<MatrixDouble> data_ptr,
114 const TagSpace space, const TagNotation notation = TagNotation::FTENSOR,
115 const bool allow_longer_tag = false);
116
117/**
118 * \brief Create operator evaluating a second-order tensor tag at integration
119 * points
120 *
121 * Instantiated for DIM0, DIM1 = 2, 3. VOIGT notation requires DIM0 == DIM1;
122 * otherwise the factory throws.
123 *
124 * @param tag_name name of a fixed-length double tag with DIM0*DIM1
125 * components
126 * @param data_ptr values at integration points in FTensor storage
127 * @param space where the tag lives, see TagSpace
128 * @param notation component order in the tag, see TagNotation
129 * @param allow_longer_tag accept a longer tag and read its leading components
130 * @return operator to push to a pipeline, which takes ownership
131 *
132 * \ingroup mofem_forces_and_sources_user_data_operators
133 */
134template <int DIM0, int DIM1>
135ForcesAndSourcesCore::UserDataOperator *
137 const std::string tag_name, boost::shared_ptr<MatrixDouble> data_ptr,
138 const TagSpace space, const TagNotation notation = TagNotation::FTENSOR,
139 const bool allow_longer_tag = false);
140
141} // namespace MoFEM
142
143#endif // __USER_DATA_OPERATORS_FROM_TAGS_HPP__
TagSpace
Where tag values live and how they are evaluated.
ForcesAndSourcesCore::UserDataOperator * createOpCalculateScalarFieldValuesFromTags(const std::string tag_name, boost::shared_ptr< VectorDouble > data_ptr, const TagSpace space, const bool allow_longer_tag)
Create operator evaluating a scalar tag at integration points.
TagNotation
Component order of a tensor stored on a tag.
ForcesAndSourcesCore::UserDataOperator * createOpCalculateTensor2SymmetricFieldValuesFromTags(const std::string tag_name, boost::shared_ptr< MatrixDouble > data_ptr, const TagSpace space, const TagNotation notation, const bool allow_longer_tag)
Create operator evaluating a symmetric tensor tag at integration points.
ForcesAndSourcesCore::UserDataOperator * createOpCalculateVectorFieldValuesFromTags(const std::string tag_name, boost::shared_ptr< MatrixDouble > data_ptr, const TagSpace space, const bool allow_longer_tag)
Create operator evaluating a vector tag at integration points.
ForcesAndSourcesCore::UserDataOperator * createOpCalculateTensor2FieldValuesFromTags(const std::string tag_name, boost::shared_ptr< MatrixDouble > data_ptr, const TagSpace space, const TagNotation notation, const bool allow_longer_tag)
Create operator evaluating a second-order tensor tag at integration points.
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10