v0.9.0
Public Member Functions | Public Attributes | List of all members
MoFEM::DataOperator Struct Reference

base operator to do operations at Gauss Pt. level More...

#include <src/finite_elements/DataOperators.hpp>

Inheritance diagram for MoFEM::DataOperator:
[legend]
Collaboration diagram for MoFEM::DataOperator:
[legend]

Public Member Functions

 DataOperator (const bool symm=true, const bool do_vertices=true, const bool do_edges=true, const bool do_quads=true, const bool do_tris=true, const bool do_tets=true, const bool do_prisms=true)
 
virtual ~DataOperator ()
 
virtual MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on left hand side. More...
 
virtual MoFEMErrorCode opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data, bool symm=true)
 
virtual MoFEMErrorCode opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data)
 
virtual MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool do_vertices, const bool do_edges, const bool do_quads, const bool do_tris, const bool do_tets, const bool do_prisms, const bool error_if_no_base=true)
 
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool error_if_no_base=true)
 
bool getSymm () const
 Get if operator uses symmetry of DOFs or not. More...
 
void setSymm ()
 set if operator is executed taking in account symmetry More...
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem More...
 

Public Attributes

bool sYmm
 If true assume that matrix is symmetric structure. More...
 
bool doVertices
 If false skip vertices. More...
 
bool doEdges
 If false skip edges. More...
 
bool doQuads
 
bool doTris
 
bool doTets
 
bool doPrisms
 

Detailed Description

base operator to do operations at Gauss Pt. level

Definition at line 36 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ DataOperator()

MoFEM::DataOperator::DataOperator ( const bool  symm = true,
const bool  do_vertices = true,
const bool  do_edges = true,
const bool  do_quads = true,
const bool  do_tris = true,
const bool  do_tets = true,
const bool  do_prisms = true 
)

Definition at line 38 of file DataOperators.hpp.

42  : sYmm(symm), doVertices(do_vertices), doEdges(do_edges),
43  doQuads(do_quads), doTris(do_tris), doTets(do_tets),
44  doPrisms(do_prisms) {}
bool doVertices
If false skip vertices.
bool sYmm
If true assume that matrix is symmetric structure.
bool doEdges
If false skip edges.

◆ ~DataOperator()

virtual MoFEM::DataOperator::~DataOperator ( )
virtual

Definition at line 46 of file DataOperators.hpp.

46 {}

Member Function Documentation

◆ doWork() [1/2]

virtual MoFEMErrorCode MoFEM::DataOperator::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
DataForcesAndSourcesCore::EntData row_data,
DataForcesAndSourcesCore::EntData col_data 
)
virtual

Operator for bi-linear form, usually to calculate values on left hand side.

Reimplemented in HookeElement::OpAssemble, ReactionDiffusionEquation::OpAssembleStiffLhs< DIM >, OpAssembleMatAndVec, OpFace, PrismOpLhs, QuadOpLhs, AnalyticalDirichletBC::ApproxField::OpLhs, ReactionDiffusionEquation::OpAssembleMass, OpRowCol, and OpVolume.

Definition at line 51 of file DataOperators.hpp.

54  {
56  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
58  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508

◆ doWork() [2/2]

virtual MoFEMErrorCode MoFEM::DataOperator::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
virtual

Operator for linear form, usually to calculate values on right hand side.

Reimplemented in FractureMechanics::OpPrint, MoFEM::OpSetInvJacH1ForFlatPrism, MoFEM::OpCalculateInvJacForFlatPrism, MoFEM::OpSetInvJacH1ForFatPrism, MoFEM::OpCalculateInvJacForFatPrism, MoFEM::OpSetContrariantPiolaTransformOnEdge, MoFEM::OpSetContravariantPiolaTransformFace, MoFEM::OpMakeHdivFromHcurl, MoFEM::OpSetInvJacHcurlFace, MoFEM::OpSetInvJacH1ForFace, MoFEM::OpCalculateInvJacForFace, MoFEM::OpCalculateJacForFace, MoFEM::OpCalculateHVecTensorDivergence< Tensor_Dim0, Tensor_Dim1 >, MoFEM::OpCalculateHTensorTensorField< Tensor_Dim0, Tensor_Dim1 >, MoFEM::OpCalculateHVecTensorField< Tensor_Dim0, Tensor_Dim1 >, MoFEM::OpCalculateHcurlVectorCurl< Tensor_Dim >, MoFEM::OpCalculateHdivVectorDivergence< Tensor_Dim1, Tensor_Dim2 >, MoFEM::OpCalculateHdivVectorField_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >, MoFEM::OpCalculateHdivVectorField_General< Tensor_Dim0, T, L, A >, MoFEM::OpCalculateVectorFieldGradientDot< Tensor_Dim0, Tensor_Dim1 >, MoFEM::OpCalculateVectorFieldGradient_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >, MoFEM::OpCalculateScalarFieldGradient_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >, MoFEM::OpCalculateTensor2SymmetricFieldValuesDot< Tensor_Dim >, MoFEM::OpCalculateTensor2SymmetricFieldValues< Tensor_Dim >, MoFEM::OpSetCovariantPiolaTransformOnEdge, MoFEM::OpCalculateTensor2FieldValuesDot< Tensor_Dim0, Tensor_Dim1 >, MoFEM::OpGetHoTangentOnEdge, MoFEM::OpSetCovariantPiolaTransformOnFace, MoFEM::OpSetContravariantPiolaTransformOnFace, MoFEM::OpGetCoordsAndNormalsOnPrism, MoFEM::OpCalculateTensor2FieldValues_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >, MoFEM::OpGetCoordsAndNormalsOnFace, MoFEM::OpCalculateTensor2FieldValues_General< Tensor_Dim0, Tensor_Dim1, T, L, A >, HookeElement::OpAleLhsPre_dX_dx< S >, MoFEM::OpGetDataAndGradient< RANK, DIM >, MoFEM::OpGetDataAndGradient< 3, 3 >, MoFEM::OpCalculateVectorFieldValuesDot< Tensor_Dim >, MoFEM::OpSetCovariantPiolaTransform, MoFEM::OpSetHoCovariantPiolaTransform, MoFEM::OpCalculateVectorFieldValues_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >, MoFEM::OpSetHoContravariantPiolaTransform, HookeElement::OpAssemble, MoFEM::OpSetContravariantPiolaTransform, HookeElement::OpCalculateStiffnessScaledByDensityField, MoFEM::OpCalculateVectorFieldValues_General< Tensor_Dim, T, L, A >, OpCheckValsDiffVals, MoFEM::OpSetHoInvJacHdivAndHcurl, HookeElement::OpCalculateHomogeneousStiffness< S >, HookeElement::OpCalculateEshelbyStress, MoFEM::OpSetHoInvJacH1, HookeElement::OpCalculateEnergy, OpValsDiffVals, ReactionDiffusionEquation::OpAssembleStiffRhs< DIM >, MoFEM::OpSetInvJacHdivAndHcurl, HookeElement::OpCalculateStress< S >, MoFEM::OpCalculateScalarValuesDot, MoFEM::OpSetInvJacH1, HookeElement::OpCalculateStrainAle, OpVolumeSide, HookeElement::OpCalculateStrain< D >, ReactionDiffusionEquation::OpAssembleSlowRhs, OpAssembleMatAndVec, AnalyticalDirichletBC::ApproxField::OpRhs< FUNEVAL >, MoFEM::OpCalculateScalarFieldValues, OpFace, PrismOpRhs, OpVolume, QuadOpRhs, OpFace, PrismOpCheck, QuadOpCheck, PrismOp, MoFEM::OpCalculateScalarFieldValues_General< T, A >, MoFEM::OpCalculateScalarFieldValues_General< double, DoubleAllocator >, SkeletonFE::OpFaceSide, OpDivergence, OpGetDensityField< ALE >, OpFace, OpRow, OpVolume, and OpCheck.

Definition at line 72 of file DataOperators.hpp.

73  {
75  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
77  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508

◆ getSymm()

bool MoFEM::DataOperator::getSymm ( ) const

Get if operator uses symmetry of DOFs or not.

If symmetry is used, only not repeating combinations of entities are looped. For an example pair of (Vertex, Edge_0) and (Edge_0, Vertex) will calculate the same matrices only transposed. Implementing that this can be exploited by integrating only one pair.

Returns
true if symmetry

Definition at line 110 of file DataOperators.hpp.

110 { return sYmm; }
bool sYmm
If true assume that matrix is symmetric structure.

◆ opLhs() [1/2]

MoFEMErrorCode MoFEM::DataOperator::opLhs ( DataForcesAndSourcesCore row_data,
DataForcesAndSourcesCore col_data,
bool  symm = true 
)
virtual

Definition at line 33 of file DataOperators.cpp.

35  {
37 
38  // nodes
39  for (unsigned int nn = 0; nn != row_data.dataOnEntities[MBVERTEX].size();
40  nn++) {
41  unsigned int NN = 0;
42  if (symm)
43  NN = nn;
44  for (; NN != col_data.dataOnEntities[MBVERTEX].size(); NN++) {
45  ierr = doWork(nn, NN, MBVERTEX, MBVERTEX,
46  row_data.dataOnEntities[MBVERTEX][0],
47  col_data.dataOnEntities[MBVERTEX][0]);
48  CHKERRG(ierr);
49  }
50  if (!symm) {
51  for (unsigned int EE = 0; EE < col_data.dataOnEntities[MBEDGE].size();
52  EE++) {
53  if (col_data.dataOnEntities[MBEDGE][EE].getN().size1() == 0)
54  continue;
55  ierr = doWork(nn, EE, MBVERTEX, MBEDGE,
56  row_data.dataOnEntities[MBVERTEX][0],
57  col_data.dataOnEntities[MBEDGE][EE]);
58  CHKERRG(ierr);
59  }
60  for (unsigned int FF = 0; FF < col_data.dataOnEntities[MBTRI].size();
61  FF++) {
62  if (col_data.dataOnEntities[MBTRI][FF].getN().size1() == 0)
63  continue;
64  ierr = doWork(nn, FF, MBVERTEX, MBTRI,
65  row_data.dataOnEntities[MBVERTEX][0],
66  col_data.dataOnEntities[MBTRI][FF]);
67  CHKERRG(ierr);
68  }
69  for (unsigned int QQ = 0; QQ < col_data.dataOnEntities[MBQUAD].size();
70  QQ++) {
71  if (col_data.dataOnEntities[MBQUAD][QQ].getN().size1() == 0)
72  continue;
73  ierr = doWork(nn, QQ, MBVERTEX, MBQUAD,
74  row_data.dataOnEntities[MBVERTEX][0],
75  col_data.dataOnEntities[MBQUAD][QQ]);
76  CHKERRG(ierr);
77  }
78  }
79  for (unsigned int VV = 0; VV < col_data.dataOnEntities[MBTET].size();
80  VV++) {
81  if (col_data.dataOnEntities[MBTET][VV].getN().size1() == 0)
82  continue;
83  ierr =
84  doWork(nn, VV, MBVERTEX, MBTET, row_data.dataOnEntities[MBVERTEX][0],
85  col_data.dataOnEntities[MBTET][VV]);
86  CHKERRG(ierr);
87  }
88  for (unsigned int PP = 0; PP < col_data.dataOnEntities[MBPRISM].size();
89  PP++) {
90  if (col_data.dataOnEntities[MBPRISM][PP].getN().size1() == 0)
91  continue;
92  ierr = doWork(nn, PP, MBVERTEX, MBPRISM,
93  row_data.dataOnEntities[MBVERTEX][0],
94  col_data.dataOnEntities[MBPRISM][PP]);
95  CHKERRG(ierr);
96  }
97  for (unsigned int MM = 0; MM < col_data.dataOnEntities[MBENTITYSET].size();
98  MM++) {
99  if (row_data.dataOnEntities[MBENTITYSET][MM].getIndices().empty() &&
100  row_data.dataOnEntities[MBENTITYSET][MM].getFieldData().empty())
101  continue;
102  ierr = doWork(nn, MM, MBVERTEX, MBENTITYSET,
103  row_data.dataOnEntities[MBVERTEX][0],
104  col_data.dataOnEntities[MBENTITYSET][MM]);
105  CHKERRG(ierr);
106  }
107  }
108 
109  // edges
110  for (unsigned int ee = 0; ee < row_data.dataOnEntities[MBEDGE].size(); ee++) {
111  if (row_data.dataOnEntities[MBEDGE][ee].getN().size1() == 0)
112  continue;
113  for (unsigned int NN = 0; NN != col_data.dataOnEntities[MBVERTEX].size();
114  NN++) {
115  ierr =
116  doWork(ee, NN, MBEDGE, MBVERTEX, row_data.dataOnEntities[MBEDGE][ee],
117  col_data.dataOnEntities[MBVERTEX][0]);
118  CHKERRG(ierr);
119  }
120  unsigned int EE = 0;
121  if (symm)
122  EE = ee;
123  for (; EE < col_data.dataOnEntities[MBEDGE].size(); EE++) {
124  if (col_data.dataOnEntities[MBEDGE][EE].getN().size1() == 0)
125  continue;
126  ierr = doWork(ee, EE, MBEDGE, MBEDGE, row_data.dataOnEntities[MBEDGE][ee],
127  col_data.dataOnEntities[MBEDGE][EE]);
128  CHKERRG(ierr);
129  }
130  // tris
131  for (unsigned int FF = 0; FF < col_data.dataOnEntities[MBTRI].size();
132  FF++) {
133  if (col_data.dataOnEntities[MBTRI][FF].getN().size1() == 0)
134  continue;
135  ierr = doWork(ee, FF, MBEDGE, MBTRI, row_data.dataOnEntities[MBEDGE][ee],
136  col_data.dataOnEntities[MBTRI][FF]);
137  CHKERRG(ierr);
138  }
139  // quad
140  for (unsigned int QQ = 0; QQ < col_data.dataOnEntities[MBQUAD].size();
141  QQ++) {
142  if (col_data.dataOnEntities[MBQUAD][QQ].getN().size1() == 0)
143  continue;
144  ierr = doWork(ee, QQ, MBEDGE, MBQUAD, row_data.dataOnEntities[MBEDGE][ee],
145  col_data.dataOnEntities[MBQUAD][QQ]);
146  CHKERRG(ierr);
147  }
148  // tet
149  for (unsigned int VV = 0; VV < col_data.dataOnEntities[MBTET].size();
150  VV++) {
151  if (col_data.dataOnEntities[MBTET][VV].getN().size1() == 0)
152  continue;
153  ierr = doWork(ee, VV, MBEDGE, MBTET, row_data.dataOnEntities[MBEDGE][ee],
154  col_data.dataOnEntities[MBTET][VV]);
155  CHKERRG(ierr);
156  }
157  // prism
158  for (unsigned int PP = 0; PP < col_data.dataOnEntities[MBPRISM].size();
159  PP++) {
160  if (col_data.dataOnEntities[MBPRISM][PP].getN().size1() == 0)
161  continue;
162  ierr =
163  doWork(ee, PP, MBEDGE, MBPRISM, row_data.dataOnEntities[MBEDGE][ee],
164  col_data.dataOnEntities[MBPRISM][PP]);
165  CHKERRG(ierr);
166  }
167  for (unsigned int MM = 0; MM < col_data.dataOnEntities[MBENTITYSET].size();
168  MM++) {
169  if (col_data.dataOnEntities[MBENTITYSET][MM].getIndices().empty() &&
170  col_data.dataOnEntities[MBENTITYSET][MM].getFieldData().empty())
171  continue;
172  ierr = doWork(ee, MM, MBEDGE, MBENTITYSET,
173  row_data.dataOnEntities[MBEDGE][ee],
174  col_data.dataOnEntities[MBENTITYSET][MM]);
175  CHKERRG(ierr);
176  }
177  }
178 
179  // tris
180  for (unsigned int ff = 0; ff < row_data.dataOnEntities[MBTRI].size(); ff++) {
181  if (row_data.dataOnEntities[MBTRI][ff].getN().size1() == 0)
182  continue;
183  for (unsigned int NN = 0; NN != col_data.dataOnEntities[MBVERTEX].size();
184  NN++) {
185  ierr = doWork(ff, NN, MBTRI, MBVERTEX, row_data.dataOnEntities[MBTRI][ff],
186  col_data.dataOnEntities[MBVERTEX][0]);
187  CHKERRG(ierr);
188  }
189  if (!symm) {
190  unsigned int EE = 0;
191  for (; EE < col_data.dataOnEntities[MBEDGE].size(); EE++) {
192  if (col_data.dataOnEntities[MBEDGE][EE].getN().size1() == 0)
193  continue;
194  ierr = doWork(ff, EE, MBTRI, MBEDGE, row_data.dataOnEntities[MBTRI][ff],
195  col_data.dataOnEntities[MBEDGE][EE]);
196  CHKERRG(ierr);
197  }
198  }
199  unsigned int FF = 0;
200  if (symm)
201  FF = ff;
202  for (; FF < col_data.dataOnEntities[MBTRI].size(); FF++) {
203  if (col_data.dataOnEntities[MBTRI][FF].getN().size1() == 0)
204  continue;
205  ierr = doWork(ff, FF, MBTRI, MBTRI, row_data.dataOnEntities[MBTRI][ff],
206  col_data.dataOnEntities[MBTRI][FF]);
207  CHKERRG(ierr);
208  }
209  for (unsigned int QQ = 0; QQ < col_data.dataOnEntities[MBQUAD].size();
210  QQ++) {
211  if (col_data.dataOnEntities[MBQUAD][QQ].getN().size1() == 0)
212  continue;
213  ierr = doWork(ff, QQ, MBTRI, MBQUAD, row_data.dataOnEntities[MBTRI][ff],
214  col_data.dataOnEntities[MBQUAD][QQ]);
215  CHKERRG(ierr);
216  }
217  for (unsigned int VV = 0; VV < col_data.dataOnEntities[MBTET].size();
218  VV++) {
219  if (col_data.dataOnEntities[MBTET][VV].getN().size1() == 0)
220  continue;
221  ierr = doWork(ff, VV, MBTRI, MBTET, row_data.dataOnEntities[MBTRI][ff],
222  col_data.dataOnEntities[MBTET][VV]);
223  CHKERRG(ierr);
224  }
225  for (unsigned int PP = 0; PP < col_data.dataOnEntities[MBPRISM].size();
226  PP++) {
227  if (col_data.dataOnEntities[MBPRISM][PP].getN().size1() == 0)
228  continue;
229  ierr = doWork(ff, PP, MBTRI, MBPRISM, row_data.dataOnEntities[MBTRI][ff],
230  col_data.dataOnEntities[MBPRISM][PP]);
231  CHKERRG(ierr);
232  }
233  for (unsigned int MM = 0; MM < col_data.dataOnEntities[MBENTITYSET].size();
234  MM++) {
235  if (col_data.dataOnEntities[MBENTITYSET][MM].getIndices().empty() &&
236  col_data.dataOnEntities[MBENTITYSET][MM].getFieldData().empty())
237  continue;
238  ierr =
239  doWork(ff, MM, MBTRI, MBENTITYSET, row_data.dataOnEntities[MBTRI][ff],
240  col_data.dataOnEntities[MBENTITYSET][MM]);
241  CHKERRG(ierr);
242  }
243  }
244 
245  // quads
246  for (unsigned int qq = 0; qq < row_data.dataOnEntities[MBQUAD].size(); qq++) {
247  if (row_data.dataOnEntities[MBQUAD][qq].getN().size1() == 0)
248  continue;
249  for (unsigned int NN = 0; NN != col_data.dataOnEntities[MBVERTEX].size();
250  NN++) {
251  ierr =
252  doWork(qq, NN, MBQUAD, MBVERTEX, row_data.dataOnEntities[MBQUAD][qq],
253  col_data.dataOnEntities[MBVERTEX][0]);
254  CHKERRG(ierr);
255  }
256  if (!symm) {
257  unsigned int EE = 0;
258  for (; EE < col_data.dataOnEntities[MBEDGE].size(); EE++) {
259  if (col_data.dataOnEntities[MBEDGE][EE].getN().size1() == 0)
260  continue;
261  ierr =
262  doWork(qq, EE, MBQUAD, MBEDGE, row_data.dataOnEntities[MBQUAD][qq],
263  col_data.dataOnEntities[MBEDGE][EE]);
264  CHKERRG(ierr);
265  }
266  unsigned int FF = 0;
267  for (; FF < col_data.dataOnEntities[MBTRI].size(); FF++) {
268  if (col_data.dataOnEntities[MBTRI][FF].getN().size1() == 0)
269  continue;
270  ierr =
271  doWork(qq, FF, MBQUAD, MBTRI, row_data.dataOnEntities[MBQUAD][qq],
272  col_data.dataOnEntities[MBTRI][FF]);
273  CHKERRG(ierr);
274  }
275  }
276  unsigned int QQ = 0;
277  if (symm)
278  QQ = qq;
279  for (; QQ < col_data.dataOnEntities[MBQUAD].size(); QQ++) {
280  if (col_data.dataOnEntities[MBQUAD][QQ].getN().size1() == 0)
281  continue;
282  ierr = doWork(qq, QQ, MBQUAD, MBQUAD, row_data.dataOnEntities[MBQUAD][qq],
283  col_data.dataOnEntities[MBQUAD][QQ]);
284  CHKERRG(ierr);
285  }
286  for (unsigned int PP = 0; PP < col_data.dataOnEntities[MBPRISM].size();
287  PP++) {
288  if (col_data.dataOnEntities[MBPRISM][PP].getN().size1() == 0)
289  continue;
290  ierr = doWork(qq, PP, MBTRI, MBPRISM, row_data.dataOnEntities[MBQUAD][qq],
291  col_data.dataOnEntities[MBPRISM][PP]);
292  CHKERRG(ierr);
293  }
294  for (unsigned int MM = 0; MM < col_data.dataOnEntities[MBENTITYSET].size();
295  MM++) {
296  if (col_data.dataOnEntities[MBENTITYSET][MM].getIndices().empty() &&
297  col_data.dataOnEntities[MBENTITYSET][MM].getFieldData().empty())
298  continue;
299  ierr = doWork(qq, MM, MBQUAD, MBENTITYSET,
300  row_data.dataOnEntities[MBQUAD][qq],
301  col_data.dataOnEntities[MBENTITYSET][MM]);
302  CHKERRG(ierr);
303  }
304  }
305 
306  // volumes
307  for (unsigned int vv = 0; vv < row_data.dataOnEntities[MBTET].size(); vv++) {
308  if (row_data.dataOnEntities[MBTET][vv].getN().size1() == 0)
309  continue;
310  if (!symm) {
311  // vertex
312  for (unsigned int NN = 0; NN != col_data.dataOnEntities[MBVERTEX].size();
313  NN++) {
314  ierr =
315  doWork(vv, NN, MBTET, MBVERTEX, row_data.dataOnEntities[MBTET][vv],
316  col_data.dataOnEntities[MBVERTEX][0]);
317  CHKERRG(ierr);
318  }
319  // edges
320  for (unsigned int EE = 0; EE < col_data.dataOnEntities[MBEDGE].size();
321  EE++) {
322  if (col_data.dataOnEntities[MBEDGE][EE].getN().size1() == 0)
323  continue;
324  ierr = doWork(vv, EE, MBTET, MBEDGE, row_data.dataOnEntities[MBTET][vv],
325  col_data.dataOnEntities[MBEDGE][EE]);
326  CHKERRG(ierr);
327  }
328  // faces
329  for (unsigned int FF = 0; FF < col_data.dataOnEntities[MBTRI].size();
330  FF++) {
331  if (col_data.dataOnEntities[MBTRI][FF].getN().size1() == 0)
332  continue;
333  ierr = doWork(vv, FF, MBTET, MBTRI, row_data.dataOnEntities[MBTET][vv],
334  col_data.dataOnEntities[MBTRI][FF]);
335  CHKERRG(ierr);
336  }
337  }
338  unsigned int VV = 0;
339  if (symm)
340  VV = vv;
341  for (; VV < col_data.dataOnEntities[MBTET].size(); VV++) {
342  if (col_data.dataOnEntities[MBTET][VV].getN().size1() == 0)
343  continue;
344  ierr = doWork(vv, VV, MBTET, MBTET, row_data.dataOnEntities[MBTET][vv],
345  col_data.dataOnEntities[MBTET][VV]);
346  CHKERRG(ierr);
347  }
348  for (unsigned int MM = 0; MM < col_data.dataOnEntities[MBENTITYSET].size();
349  MM++) {
350  if (col_data.dataOnEntities[MBENTITYSET][MM].getIndices().empty() &&
351  col_data.dataOnEntities[MBENTITYSET][MM].getFieldData().empty())
352  continue;
353  ierr =
354  doWork(vv, MM, MBTET, MBENTITYSET, row_data.dataOnEntities[MBTET][vv],
355  col_data.dataOnEntities[MBENTITYSET][MM]);
356  CHKERRG(ierr);
357  }
358  }
359 
360  for (unsigned int pp = 0; pp < row_data.dataOnEntities[MBPRISM].size();
361  pp++) {
362  if (row_data.dataOnEntities[MBPRISM][pp].getN().size1() == 0)
363  continue;
364  if (!symm) {
365  // vertex
366  for (unsigned int NN = 0; NN != col_data.dataOnEntities[MBVERTEX].size();
367  NN++) {
368  ierr = doWork(pp, NN, MBPRISM, MBVERTEX,
369  row_data.dataOnEntities[MBPRISM][pp],
370  col_data.dataOnEntities[MBVERTEX][0]);
371  CHKERRG(ierr);
372  }
373  // edges
374  for (unsigned int EE = 0; EE < col_data.dataOnEntities[MBEDGE].size();
375  EE++) {
376  if (col_data.dataOnEntities[MBEDGE][EE].getN().size1() == 0)
377  continue;
378  ierr = doWork(pp, EE, MBPRISM, MBEDGE,
379  row_data.dataOnEntities[MBPRISM][pp],
380  col_data.dataOnEntities[MBEDGE][EE]);
381  CHKERRG(ierr);
382  }
383  // faces
384  for (unsigned int FF = 0; FF < col_data.dataOnEntities[MBTRI].size();
385  FF++) {
386  if (col_data.dataOnEntities[MBTRI][FF].getN().size1() == 0)
387  continue;
388  ierr =
389  doWork(pp, FF, MBPRISM, MBTRI, row_data.dataOnEntities[MBPRISM][pp],
390  col_data.dataOnEntities[MBTRI][FF]);
391  CHKERRG(ierr);
392  }
393  // quads
394  for (unsigned int QQ = 0; QQ < col_data.dataOnEntities[MBQUAD].size();
395  QQ++) {
396  if (col_data.dataOnEntities[MBQUAD][QQ].getN().size1() == 0)
397  continue;
398  ierr = doWork(pp, QQ, MBPRISM, MBQUAD,
399  row_data.dataOnEntities[MBPRISM][pp],
400  col_data.dataOnEntities[MBQUAD][QQ]);
401  CHKERRG(ierr);
402  }
403  }
404  unsigned int PP = 0;
405  if (symm)
406  PP = pp;
407  for (; PP < col_data.dataOnEntities[MBPRISM].size(); PP++) {
408  if (col_data.dataOnEntities[MBPRISM][PP].getN().size1() == 0)
409  continue;
410  ierr =
411  doWork(pp, PP, MBPRISM, MBPRISM, row_data.dataOnEntities[MBPRISM][pp],
412  col_data.dataOnEntities[MBPRISM][PP]);
413  CHKERRG(ierr);
414  }
415  for (unsigned int MM = 0; MM < col_data.dataOnEntities[MBENTITYSET].size();
416  MM++) {
417  if (col_data.dataOnEntities[MBENTITYSET][MM].getIndices().empty() &&
418  col_data.dataOnEntities[MBENTITYSET][MM].getFieldData().empty())
419  continue;
420  ierr = doWork(pp, MM, MBPRISM, MBENTITYSET,
421  row_data.dataOnEntities[MBPRISM][pp],
422  col_data.dataOnEntities[MBENTITYSET][MM]);
423  CHKERRG(ierr);
424  }
425  }
426 
427  // meshsets
428  for (unsigned int mm = 0; mm < row_data.dataOnEntities[MBENTITYSET].size();
429  mm++) {
430  if (row_data.dataOnEntities[MBENTITYSET][mm].getIndices().empty() &&
431  row_data.dataOnEntities[MBENTITYSET][mm].getFieldData().empty())
432  continue;
433  if (!symm) {
434  // vertex
435  for (unsigned int NN = 0; NN != col_data.dataOnEntities[MBVERTEX].size();
436  NN++) {
437  ierr = doWork(mm, NN, MBENTITYSET, MBVERTEX,
438  row_data.dataOnEntities[MBENTITYSET][mm],
439  col_data.dataOnEntities[MBVERTEX][0]);
440  CHKERRG(ierr);
441  }
442  // edges
443  for (unsigned int EE = 0; EE < col_data.dataOnEntities[MBEDGE].size();
444  EE++) {
445  if (col_data.dataOnEntities[MBEDGE][EE].getN().size1() == 0)
446  continue;
447  ierr = doWork(mm, EE, MBENTITYSET, MBEDGE,
448  row_data.dataOnEntities[MBENTITYSET][mm],
449  col_data.dataOnEntities[MBEDGE][EE]);
450  CHKERRG(ierr);
451  }
452  // faces
453  for (unsigned int FF = 0; FF < col_data.dataOnEntities[MBTRI].size();
454  FF++) {
455  if (col_data.dataOnEntities[MBTRI][FF].getN().size1() == 0)
456  continue;
457  ierr = doWork(mm, FF, MBENTITYSET, MBTRI,
458  row_data.dataOnEntities[MBENTITYSET][mm],
459  col_data.dataOnEntities[MBTRI][FF]);
460  CHKERRG(ierr);
461  }
462  // quad
463  for (unsigned int QQ = 0; QQ < col_data.dataOnEntities[MBQUAD].size();
464  QQ++) {
465  if (col_data.dataOnEntities[MBQUAD][QQ].getN().size1() == 0)
466  continue;
467  ierr = doWork(mm, QQ, MBENTITYSET, MBQUAD,
468  row_data.dataOnEntities[MBENTITYSET][mm],
469  col_data.dataOnEntities[MBQUAD][QQ]);
470  CHKERRG(ierr);
471  }
472  // volume
473  for (unsigned int VV = 0; VV < col_data.dataOnEntities[MBTET].size();
474  VV++) {
475  ierr = doWork(mm, VV, MBENTITYSET, MBTET,
476  row_data.dataOnEntities[MBENTITYSET][mm],
477  col_data.dataOnEntities[MBTET][VV]);
478  CHKERRG(ierr);
479  }
480  for (unsigned int PP = 0; PP < col_data.dataOnEntities[MBPRISM].size();
481  PP++) {
482  ierr = doWork(mm, PP, MBENTITYSET, MBPRISM,
483  row_data.dataOnEntities[MBENTITYSET][mm],
484  col_data.dataOnEntities[MBPRISM][PP]);
485  CHKERRG(ierr);
486  }
487  }
488  unsigned int MM = 0;
489  if (symm)
490  MM = mm;
491  for (; MM < col_data.dataOnEntities[MBENTITYSET].size(); MM++) {
492  if (row_data.dataOnEntities[MBENTITYSET][MM].getIndices().empty() &&
493  row_data.dataOnEntities[MBENTITYSET][MM].getFieldData().empty())
494  continue;
495  ierr = doWork(mm, MM, MBENTITYSET, MBENTITYSET,
496  row_data.dataOnEntities[MBENTITYSET][mm],
497  col_data.dataOnEntities[MBENTITYSET][MM]);
498  CHKERRG(ierr);
499  }
500  }
501 
503 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:544
virtual MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
Operator for bi-linear form, usually to calculate values on left hand side.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508

◆ opLhs() [2/2]

virtual MoFEMErrorCode MoFEM::DataOperator::opLhs ( DataForcesAndSourcesCore row_data,
DataForcesAndSourcesCore col_data 
)
virtual

Definition at line 64 of file DataOperators.hpp.

65  {
66  return opLhs(row_data, col_data, getSymm());
67  }
bool getSymm() const
Get if operator uses symmetry of DOFs or not.
virtual MoFEMErrorCode opLhs(DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data, bool symm=true)

◆ opRhs() [1/2]

MoFEMErrorCode MoFEM::DataOperator::opRhs ( DataForcesAndSourcesCore data,
const bool  do_vertices,
const bool  do_edges,
const bool  do_quads,
const bool  do_tris,
const bool  do_tets,
const bool  do_prisms,
const bool  error_if_no_base = true 
)
virtual

Definition at line 529 of file DataOperators.cpp.

533  {
535 
536  if (do_vertices) {
537  for (unsigned int nn = 0; nn < data.dataOnEntities[MBVERTEX].size(); nn++) {
538  if (error_if_no_base &&
539  data.dataOnEntities[MBVERTEX][nn].getFieldData().size() &&
540  (data.dataOnEntities[MBVERTEX][nn].getBase() == NOBASE ||
541  data.dataOnEntities[MBVERTEX][nn].getBase() == LASTBASE)) {
542  for (VectorDofs::iterator it =
543  data.dataOnEntities[MBVERTEX][nn].getFieldDofs().begin();
544  it != data.dataOnEntities[MBVERTEX][nn].getFieldDofs().end(); it++)
545  if ((*it) && (*it)->getActive()) {
546  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
547  "No base on Vertex and side %d", nn);
548  }
549  }
550  ierr = doWork(nn, MBVERTEX, data.dataOnEntities[MBVERTEX][nn]);
551  CHKERRG(ierr);
552  }
553  }
554  if (do_edges) {
555  for (unsigned int ee = 0; ee < data.dataOnEntities[MBEDGE].size(); ee++) {
556  if (error_if_no_base &&
557  data.dataOnEntities[MBEDGE][ee].getFieldData().size() &&
558  (data.dataOnEntities[MBEDGE][ee].getBase() == NOBASE ||
559  data.dataOnEntities[MBEDGE][ee].getBase() == LASTBASE)) {
560  for (VectorDofs::iterator it =
561  data.dataOnEntities[MBEDGE][ee].getFieldDofs().begin();
562  it != data.dataOnEntities[MBEDGE][ee].getFieldDofs().end(); it++)
563  if ((*it) && (*it)->getActive()) {
564  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
565  "No base on Edge and side %d", ee);
566  }
567  }
568  ierr = doWork(ee, MBEDGE, data.dataOnEntities[MBEDGE][ee]);
569  CHKERRG(ierr);
570  }
571  }
572  if (do_tris) {
573  for (unsigned int ff = 0; ff < data.dataOnEntities[MBTRI].size(); ff++) {
574  if (error_if_no_base &&
575  data.dataOnEntities[MBTRI][ff].getFieldData().size() &&
576  (data.dataOnEntities[MBTRI][ff].getBase() == NOBASE ||
577  data.dataOnEntities[MBTRI][ff].getBase() == LASTBASE)) {
578  for (VectorDofs::iterator it =
579  data.dataOnEntities[MBTRI][ff].getFieldDofs().begin();
580  it != data.dataOnEntities[MBTRI][ff].getFieldDofs().end(); it++)
581  if ((*it) && (*it)->getActive()) {
582  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
583  "No base on Triangle and side %d", ff);
584  }
585  }
586  ierr = doWork(ff, MBTRI, data.dataOnEntities[MBTRI][ff]);
587  CHKERRG(ierr);
588  }
589  }
590  if (do_quads) {
591  for (unsigned int qq = 0; qq < data.dataOnEntities[MBQUAD].size(); qq++) {
592  if (error_if_no_base &&
593  data.dataOnEntities[MBQUAD][qq].getFieldData().size() &&
594  (data.dataOnEntities[MBQUAD][qq].getBase() == NOBASE ||
595  data.dataOnEntities[MBQUAD][qq].getBase() == LASTBASE)) {
596  for (VectorDofs::iterator it =
597  data.dataOnEntities[MBQUAD][qq].getFieldDofs().begin();
598  it != data.dataOnEntities[MBQUAD][qq].getFieldDofs().end(); it++)
599  if ((*it) && (*it)->getActive()) {
600  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
601  "No base on Quad and side %d", qq);
602  }
603  }
604  ierr = doWork(qq, MBQUAD, data.dataOnEntities[MBQUAD][qq]);
605  CHKERRG(ierr);
606  }
607  }
608  if (do_tets) {
609  for (unsigned int vv = 0; vv < data.dataOnEntities[MBTET].size(); vv++) {
610  if (error_if_no_base &&
611  data.dataOnEntities[MBTET][vv].getFieldData().size() &&
612  (data.dataOnEntities[MBTET][vv].getBase() == NOBASE &&
613  data.dataOnEntities[MBTET][vv].getBase() == LASTBASE)) {
614  for (VectorDofs::iterator it =
615  data.dataOnEntities[MBTET][vv].getFieldDofs().begin();
616  it != data.dataOnEntities[MBTET][vv].getFieldDofs().end(); it++)
617  if ((*it) && (*it)->getActive()) {
618  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
619  "No base on Tet and side %d", vv);
620  }
621  }
622  ierr = doWork(vv, MBTET, data.dataOnEntities[MBTET][vv]);
623  CHKERRG(ierr);
624  }
625  }
626  if (do_prisms) {
627  for (unsigned int pp = 0; pp < data.dataOnEntities[MBPRISM].size(); pp++) {
628  if (error_if_no_base &&
629  data.dataOnEntities[MBPRISM][pp].getFieldData().size() &&
630  (data.dataOnEntities[MBPRISM][pp].getBase() == NOBASE ||
631  data.dataOnEntities[MBPRISM][pp].getBase() == LASTBASE)) {
632  for (VectorDofs::iterator it =
633  data.dataOnEntities[MBPRISM][pp].getFieldDofs().begin();
634  it != data.dataOnEntities[MBPRISM][pp].getFieldDofs().end(); it++)
635  if ((*it) && (*it)->getActive()) {
636  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
637  "No base on Prism and side %d", pp);
638  }
639  }
640  ierr = doWork(pp, MBPRISM, data.dataOnEntities[MBPRISM][pp]);
641  CHKERRG(ierr);
642  }
643  }
644  for (unsigned int mm = 0; mm < data.dataOnEntities[MBENTITYSET].size();
645  mm++) {
646  if (data.dataOnEntities[MBENTITYSET][mm].getIndices().empty() &&
647  data.dataOnEntities[MBENTITYSET][mm].getFieldData().empty())
648  continue;
649  ierr = doWork(mm, MBENTITYSET, data.dataOnEntities[MBENTITYSET][mm]);
650  CHKERRG(ierr);
651  }
652 
654 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:544
virtual MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
Operator for bi-linear form, usually to calculate values on left hand side.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508

◆ opRhs() [2/2]

virtual MoFEMErrorCode MoFEM::DataOperator::opRhs ( DataForcesAndSourcesCore data,
const bool  error_if_no_base = true 
)
virtual

Definition at line 85 of file DataOperators.hpp.

86  {
88  error_if_no_base);
89  }
bool doVertices
If false skip vertices.
bool doEdges
If false skip edges.
virtual MoFEMErrorCode opRhs(DataForcesAndSourcesCore &data, const bool do_vertices, const bool do_edges, const bool do_quads, const bool do_tris, const bool do_tets, const bool do_prisms, const bool error_if_no_base=true)

◆ setSymm()

void MoFEM::DataOperator::setSymm ( )

set if operator is executed taking in account symmetry

Definition at line 113 of file DataOperators.hpp.

113 { sYmm = true; }
bool sYmm
If true assume that matrix is symmetric structure.

◆ unSetSymm()

void MoFEM::DataOperator::unSetSymm ( )

unset if operator is executed for non symmetric problem

Definition at line 116 of file DataOperators.hpp.

116 { sYmm = false; }
bool sYmm
If true assume that matrix is symmetric structure.

Member Data Documentation

◆ doEdges

bool MoFEM::DataOperator::doEdges

If false skip edges.

Examples
ElasticityMixedFormulation.hpp.

Definition at line 94 of file DataOperators.hpp.

◆ doPrisms

bool MoFEM::DataOperator::doPrisms
Examples
ElasticityMixedFormulation.hpp.

Definition at line 98 of file DataOperators.hpp.

◆ doQuads

bool MoFEM::DataOperator::doQuads
Examples
ElasticityMixedFormulation.hpp.

Definition at line 95 of file DataOperators.hpp.

◆ doTets

bool MoFEM::DataOperator::doTets
Examples
ElasticityMixedFormulation.hpp.

Definition at line 97 of file DataOperators.hpp.

◆ doTris

bool MoFEM::DataOperator::doTris
Examples
ElasticityMixedFormulation.hpp.

Definition at line 96 of file DataOperators.hpp.

◆ doVertices

bool MoFEM::DataOperator::doVertices

If false skip vertices.

Examples
ElasticityMixedFormulation.hpp.

Definition at line 93 of file DataOperators.hpp.

◆ sYmm

bool MoFEM::DataOperator::sYmm

If true assume that matrix is symmetric structure.

Examples
MagneticElement.hpp, and UnsaturatedFlow.hpp.

Definition at line 91 of file DataOperators.hpp.


The documentation for this struct was generated from the following files: