v0.8.13
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 right 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 left 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.

46  :
47  sYmm(symm),
48  doVertices(do_vertices),
49  doEdges(do_edges),
50  doQuads(do_quads),
51  doTris(do_tris),
52  doTets(do_tets),
53  doPrisms(do_prisms) {
54  }
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 56 of file DataOperators.hpp.

56 {}

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 right hand side.

Reimplemented in OpS, OpFace, OpK, OpAssembleMatAndVec, AnalyticalDirichletBC::ApproxField::OpLhs, OpRowCol, and OpVolume.

Definition at line 60 of file DataOperators.hpp.

64  {
66  SETERRQ(PETSC_COMM_SELF,MOFEM_NOT_IMPLEMENTED,"not implemented");
68  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:519
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526

◆ 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 left hand side.

Reimplemented in FractureMechanics::OpPrint, MoFEM::OpCalculateHdivTensorDivergence< Tensor_Dim0, Tensor_Dim1 >, MoFEM::OpCalculateHdivTensorField< Tensor_Dim0, Tensor_Dim1 >, MoFEM::OpCalculateHdivVectorDivergence< Tensor_Dim >, MoFEM::OpSetCovariantPiolaTransformOnEdge, MoFEM::OpGetHoTangentOnEdge, MoFEM::OpCalculateHdivVectorField_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >, MoFEM::OpSetCovariantPiolaTransformOnTriangle, MoFEM::OpSetContravariantPiolaTransformOnTriangle, MoFEM::OpCalculateHdivVectorField_General< Tensor_Dim0, T, L, A >, MoFEM::OpGetCoordsAndNormalsOnPrism, MoFEM::OpGetCoordsAndNormalsOnFace, MoFEM::OpCalculateVectorFieldGradient_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >, MoFEM::OpSetInvJacHcurlFace, MoFEM::OpSetInvJacH1ForFace, MoFEM::OpGetDataAndGradient< RANK, DIM >, MoFEM::OpGetDataAndGradient< 3, 3 >, MoFEM::OpCalculateInvJacForFace, MoFEM::OpCalculateScalarFieldGradient_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >, MoFEM::OpSetCovariantPiolaTransform, MoFEM::OpSetHoCovariantPiolaTransform, MoFEM::OpCalculateTensor2SymmetricFieldValues< Tensor_Dim >, MoFEM::OpSetHoContravariantPiolaTransform, MoFEM::OpSetInvJacH1ForFatPrism, MoFEM::OpSetContravariantPiolaTransform, MoFEM::OpCalculateInvJacForFatPrism, MoFEM::OpSetHoInvJacHdivAndHcurl, MoFEM::OpSetInvJacH1ForFlatPrism, MoFEM::OpCalculateTensor2FieldValues_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >, MoFEM::OpSetHoInvJacH1, MoFEM::OpCalculateInvJacForFlatPrism, MoFEM::OpSetInvJacHdivAndHcurl, MoFEM::OpCalculateTensor2FieldValues_General< Tensor_Dim0, Tensor_Dim1, T, L, A >, MoFEM::OpSetInvJacH1, OpPressure, MoFEM::OpCalculateVectorFieldValues_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >, OpCheckValsDiffVals, MoFEM::OpCalculateVectorFieldValues_General< Tensor_Dim, T, L, A >, OpValsDiffVals, OpVolumeSide, OpFaceSide, AnalyticalDirichletBC::ApproxField::OpRhs< FUNEVAL >, MoFEM::OpCalculateScalarFieldValues, OpFace, OpVolume, OpFace, OpAssembleMatAndVec, AnalyticalDirichletBC::ApproxField::OpHoCoord, MoFEM::OpCalculateScalarFieldValues_General< T, A >, MoFEM::OpCalculateScalarFieldValues_General< double, DoubleAllocator >, OpRow, OpVolume, and OpCheck.

Definition at line 86 of file DataOperators.hpp.

89  {
91  SETERRQ(PETSC_COMM_SELF,MOFEM_NOT_IMPLEMENTED,"not implemented");
93  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:519
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526

◆ 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 134 of file DataOperators.hpp.

134 { 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 68 of file DataOperators.cpp.

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

◆ opLhs() [2/2]

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

Definition at line 76 of file DataOperators.hpp.

79  {
80  return opLhs(row_data,col_data,getSymm());
81  }
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 564 of file DataOperators.cpp.

568  {
570 
571  if (do_vertices) {
572  for (unsigned int nn = 0; nn < data.dataOnEntities[MBVERTEX].size(); nn++) {
573  if (error_if_no_base &&
574  data.dataOnEntities[MBVERTEX][nn].getFieldData().size() &&
575  (data.dataOnEntities[MBVERTEX][nn].getBase() == NOBASE ||
576  data.dataOnEntities[MBVERTEX][nn].getBase() == LASTBASE)) {
577  for (VectorDofs::iterator it =
578  data.dataOnEntities[MBVERTEX][nn].getFieldDofs().begin();
579  it != data.dataOnEntities[MBVERTEX][nn].getFieldDofs().end(); it++)
580  if ((*it) && (*it)->getActive()) {
581  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
582  "No base on Vertex and side %d", nn);
583  }
584  }
585  ierr = doWork(nn, MBVERTEX, data.dataOnEntities[MBVERTEX][nn]);
586  CHKERRG(ierr);
587  }
588  }
589  if (do_edges) {
590  for (unsigned int ee = 0; ee < data.dataOnEntities[MBEDGE].size(); ee++) {
591  if (error_if_no_base &&
592  data.dataOnEntities[MBEDGE][ee].getFieldData().size() &&
593  (data.dataOnEntities[MBEDGE][ee].getBase() == NOBASE ||
594  data.dataOnEntities[MBEDGE][ee].getBase() == LASTBASE)) {
595  for (VectorDofs::iterator it =
596  data.dataOnEntities[MBEDGE][ee].getFieldDofs().begin();
597  it != data.dataOnEntities[MBEDGE][ee].getFieldDofs().end(); it++)
598  if ((*it) && (*it)->getActive()) {
599  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
600  "No base on Edge and side %d", ee);
601  }
602  }
603  ierr = doWork(ee, MBEDGE, data.dataOnEntities[MBEDGE][ee]);
604  CHKERRG(ierr);
605  }
606  }
607  if (do_tris) {
608  for (unsigned int ff = 0; ff < data.dataOnEntities[MBTRI].size(); ff++) {
609  if (error_if_no_base &&
610  data.dataOnEntities[MBTRI][ff].getFieldData().size() &&
611  (data.dataOnEntities[MBTRI][ff].getBase() == NOBASE ||
612  data.dataOnEntities[MBTRI][ff].getBase() == LASTBASE)) {
613  for (VectorDofs::iterator it =
614  data.dataOnEntities[MBTRI][ff].getFieldDofs().begin();
615  it != data.dataOnEntities[MBTRI][ff].getFieldDofs().end(); it++)
616  if ((*it) && (*it)->getActive()) {
617  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
618  "No base on Triangle and side %d", ff);
619  }
620  }
621  ierr = doWork(ff, MBTRI, data.dataOnEntities[MBTRI][ff]);
622  CHKERRG(ierr);
623  }
624  }
625  if (do_quads) {
626  for (unsigned int qq = 0; qq < data.dataOnEntities[MBQUAD].size(); qq++) {
627  if (error_if_no_base &&
628  data.dataOnEntities[MBQUAD][qq].getFieldData().size() &&
629  (data.dataOnEntities[MBQUAD][qq].getBase() == NOBASE ||
630  data.dataOnEntities[MBQUAD][qq].getBase() == LASTBASE)) {
631  for (VectorDofs::iterator it =
632  data.dataOnEntities[MBQUAD][qq].getFieldDofs().begin();
633  it != data.dataOnEntities[MBQUAD][qq].getFieldDofs().end(); it++)
634  if ((*it) && (*it)->getActive()) {
635  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
636  "No base on Quad and side %d", qq);
637  }
638  }
639  ierr = doWork(qq, MBQUAD, data.dataOnEntities[MBQUAD][qq]);
640  CHKERRG(ierr);
641  }
642  }
643  if (do_tets) {
644  for (unsigned int vv = 0; vv < data.dataOnEntities[MBTET].size(); vv++) {
645  if (error_if_no_base &&
646  data.dataOnEntities[MBTET][vv].getFieldData().size() &&
647  (data.dataOnEntities[MBTET][vv].getBase() == NOBASE &&
648  data.dataOnEntities[MBTET][vv].getBase() == LASTBASE)) {
649  for (VectorDofs::iterator it =
650  data.dataOnEntities[MBTET][vv].getFieldDofs().begin();
651  it != data.dataOnEntities[MBTET][vv].getFieldDofs().end(); it++)
652  if ((*it) && (*it)->getActive()) {
653  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
654  "No base on Tet and side %d", vv);
655  }
656  }
657  ierr = doWork(vv, MBTET, data.dataOnEntities[MBTET][vv]);
658  CHKERRG(ierr);
659  }
660  }
661  if (do_prisms) {
662  for (unsigned int pp = 0; pp < data.dataOnEntities[MBPRISM].size(); pp++) {
663  if (error_if_no_base &&
664  data.dataOnEntities[MBPRISM][pp].getFieldData().size() &&
665  (data.dataOnEntities[MBPRISM][pp].getBase() == NOBASE ||
666  data.dataOnEntities[MBPRISM][pp].getBase() == LASTBASE)) {
667  for (VectorDofs::iterator it =
668  data.dataOnEntities[MBPRISM][pp].getFieldDofs().begin();
669  it != data.dataOnEntities[MBPRISM][pp].getFieldDofs().end(); it++)
670  if ((*it) && (*it)->getActive()) {
671  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
672  "No base on Prism and side %d", pp);
673  }
674  }
675  ierr = doWork(pp, MBPRISM, data.dataOnEntities[MBPRISM][pp]);
676  CHKERRG(ierr);
677  }
678  }
679  for (unsigned int mm = 0; mm < data.dataOnEntities[MBENTITYSET].size();
680  mm++) {
681  if (data.dataOnEntities[MBENTITYSET][mm].getIndices().empty() &&
682  data.dataOnEntities[MBENTITYSET][mm].getFieldData().empty())
683  continue;
684  ierr = doWork(mm, MBENTITYSET, data.dataOnEntities[MBENTITYSET][mm]);
685  CHKERRG(ierr);
686  }
687 
689 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:519
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:562
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 right hand side.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

◆ opRhs() [2/2]

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

Definition at line 106 of file DataOperators.hpp.

109  {
110  return opRhs(
111  data,doVertices,doEdges,doQuads,doTris,doTets,doPrisms,error_if_no_base
112  );
113  }
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 137 of file DataOperators.hpp.

137 { 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 140 of file DataOperators.hpp.

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

Member Data Documentation

◆ doEdges

bool MoFEM::DataOperator::doEdges

If false skip edges.

Definition at line 118 of file DataOperators.hpp.

◆ doPrisms

bool MoFEM::DataOperator::doPrisms

Definition at line 122 of file DataOperators.hpp.

◆ doQuads

bool MoFEM::DataOperator::doQuads

Definition at line 119 of file DataOperators.hpp.

◆ doTets

bool MoFEM::DataOperator::doTets

Definition at line 121 of file DataOperators.hpp.

◆ doTris

bool MoFEM::DataOperator::doTris

Definition at line 120 of file DataOperators.hpp.

◆ doVertices

bool MoFEM::DataOperator::doVertices

If false skip vertices.

Definition at line 117 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 115 of file DataOperators.hpp.


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