v0.14.0
FormsBrokenSpaceConstraintImpl.hpp
Go to the documentation of this file.
1 /**
2  * @file FormsBrokenSpaceConstraintImpl.hpp
3  * @brief Integrator for broken space constraints
4  * @date 2024-07-01
5  *
6  * @copyright Copyright (c) 2024
7  *
8  */
9 
10 #ifndef __FORMSBROKENSPACECONSTRAINTIMPL_HPP__
11 #define __FORMSBROKENSPACECONSTRAINTIMPL_HPP__
12 
13 namespace MoFEM {
14 
15 template <typename E> struct OpBrokenLoopSide : public OpLoopSide<E> {
16 
17  using OP = OpLoopSide<E>;
19 
20  MoFEMErrorCode doWork(int side, EntityType type,
23 
24  auto prev_side_fe_ptr = OP::getSidePtrFE();
25  if (OP::sideFEName == prev_side_fe_ptr->getFEName()) {
26  auto prev_fe_uid =
27  prev_side_fe_ptr->numeredEntFiniteElementPtr->getFEUId();
28  OP::sideFEPtr->feName = OP::sideFEName;
29  CHKERR OP::sideFEPtr->setSideFEPtr(OP::getPtrFE());
30  CHKERR OP::sideFEPtr->copyBasicMethod(*OP::getFEMethod());
31  CHKERR OP::sideFEPtr->copyPetscData(*OP::getFEMethod());
33  CHKERR OP::sideFEPtr->copySnes(*OP::getFEMethod());
35  OP::sideFEPtr->cacheWeakPtr = prev_side_fe_ptr->cacheWeakPtr;
36  OP::sideFEPtr->loopSize = 1;
37  CHKERR OP::sideFEPtr->preProcess();
38  OP::sideFEPtr->nInTheLoop = 0;
39  OP::sideFEPtr->numeredEntFiniteElementPtr =
40  prev_side_fe_ptr->numeredEntFiniteElementPtr;
41  CHKERR (*OP::sideFEPtr)();
42  CHKERR OP::sideFEPtr->postProcess();
43  } else {
44  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
45  "sideFEName is different");
46  }
47 
49  };
50 };
51 
54  inline auto &getSense() { return eleSense; }
55  inline auto &getSide() { return eleSide; }
56  inline auto &getType() { return eleType; }
57  inline auto &getData() { return entData; }
58  inline auto &getFlux() { return fluxMat; }
59 
60 private:
61  int eleSense = 0;
62  int eleSide = 1;
63  EntityType eleType = MBENTITYSET;
66 };
67 
68 template <typename OpBase> struct OpGetBrokenBaseSideData : public OpBase {
69 
70  using OP = OpBase;
71 
73  const std::string field_name,
74  boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data);
75 
76  MoFEMErrorCode doWork(int row_side, EntityType row_type,
77  EntitiesFieldData::EntData &row_data);
78 
79 private:
80  boost::shared_ptr<std::vector<BrokenBaseSideData>> brokenBaseSideData;
81 };
82 
83 template <typename OpBase>
85  const std::string field_name,
86  boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data)
87  : OP(field_name, field_name, OP::OPROW),
88  brokenBaseSideData(broken_base_side_data) {}
89 
90 template <typename OpBase>
92 OpGetBrokenBaseSideData<OpBase>::doWork(int row_side, EntityType row_type,
93  EntitiesFieldData::EntData &row_data) {
95 
96  if (row_data.getIndices().size() == 0)
98 
99  brokenBaseSideData->resize(OP::getLoopSize());
100 
101  const auto n_in_the_loop = OP::getNinTheLoop();
102  const auto face_sense = OP::getSkeletonSense();
103 
104 #ifndef NDEBUG
105  if (face_sense != -1 && face_sense != 1)
106  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "face sense not set");
107 #endif // NDEBUG
108 
109  auto set_data = [&](auto &side_data) {
110  side_data.getSide() = row_side;
111  side_data.getType() = row_type;
112  side_data.getSense() = face_sense;
113  side_data.getData().sEnse = row_data.sEnse;
114  side_data.getData().sPace = row_data.sPace;
115  side_data.getData().bAse = row_data.bAse;
116  side_data.getData().iNdices = row_data.iNdices;
117  side_data.getData().localIndices = row_data.localIndices;
118  side_data.getData().dOfs = row_data.dOfs;
119  side_data.getData().fieldEntities = row_data.fieldEntities;
120  side_data.getData().fieldData = row_data.fieldData;
121  };
122 
123  auto set_base = [&](auto &side_data) {
124  auto base = side_data.getData().getBase();
125  for (auto dd = 0; dd != BaseDerivatives::LastDerivative; ++dd) {
126  if (auto base_ptr = row_data.baseFunctionsAndBaseDerivatives[dd][base]) {
127  side_data.getData().baseFunctionsAndBaseDerivatives[dd][base] =
128  boost::make_shared<MatrixDouble>(*base_ptr);
129  }
130  }
131  };
132 
133  set_data((*brokenBaseSideData)[n_in_the_loop]);
134  set_base((*brokenBaseSideData)[n_in_the_loop]);
135 
137 }
138 
139 template <typename OpBase> struct OpSetFlux : public OpBase {
140 
141  using OP = OpBase;
142 
143  OpSetFlux(
144  boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
145  boost::shared_ptr<MatrixDouble> flux_ptr);
146 
147  MoFEMErrorCode doWork(int row_side, EntityType row_type,
148  EntitiesFieldData::EntData &row_data);
149 
150 private:
151  boost::shared_ptr<std::vector<BrokenBaseSideData>> brokenBaseSideData;
152  boost::shared_ptr<MatrixDouble> fluxPtr;
153 };
154 
155 template <typename OpBase>
157  boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
158  boost::shared_ptr<MatrixDouble> flux_ptr)
159  : OP(NOSPACE, OP::OPSPACE), brokenBaseSideData(broken_base_side_data),
160  fluxPtr(flux_ptr) {}
161 
162 template <typename OpBase>
166  auto swap_flux = [&](auto &side_data) { side_data.getFlux().swap(*fluxPtr); };
167  swap_flux((*brokenBaseSideData)[OP::getNinTheLoop()]);
169 }
170 
171 template <typename OpBase> struct OpBrokenBaseImpl : public OpBase {
172 
173  using OP = OpBase;
174 
176  boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
177  boost::shared_ptr<Range> ents_ptr = nullptr)
178  : OP(NOSPACE, OP::OPSPACE), brokenBaseSideData(broken_base_side_data) {
179  OP::entsPtr = ents_ptr;
180  }
181 
183  const std::string row_field,
184  boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
185  const bool assmb_transpose, const bool only_transpose,
186  boost::shared_ptr<Range> ents_ptr = nullptr)
187  : OP(row_field, row_field, OP::OPROW, ents_ptr),
188  brokenBaseSideData(broken_base_side_data) {
189  OP::entsPtr = ents_ptr;
190  OP::assembleTranspose = assmb_transpose;
191  OP::onlyTranspose = only_transpose;
192  OP::sYmm = false;
193  }
194 
195  MoFEMErrorCode doWork(int row_side, EntityType row_type,
196  EntitiesFieldData::EntData &row_data);
197 
198 protected:
199  boost::shared_ptr<std::vector<BrokenBaseSideData>> brokenBaseSideData;
200 };
201 
202 template <typename OpBase>
204 OpBrokenBaseImpl<OpBase>::doWork(int row_side, EntityType row_type,
205  EntitiesFieldData::EntData &row_data) {
207 
208  if (OP::entsPtr) {
209  if (OP::entsPtr->find(this->getFEEntityHandle()) == OP::entsPtr->end())
211  }
212 
213 #ifndef NDEBUG
214  if (!brokenBaseSideData) {
215  SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "space not set");
216  }
217 #endif // NDEBUG
218 
219  auto do_work_rhs = [this](int row_side, EntityType row_type,
220  EntitiesFieldData::EntData &row_data, int sense) {
222  // get number of dofs on row
223  OP::nbRows = row_data.getIndices().size();
224  if (!OP::nbRows)
226  // get number of integration points
227  OP::nbIntegrationPts = OP::getGaussPts().size2();
228  // get row base functions
229  OP::nbRowBaseFunctions = OP::getNbOfBaseFunctions(row_data);
230  // resize and clear the right hand side vector
231  OP::locF.resize(OP::nbRows, false);
232  OP::locF.clear();
233  // integrate local vector
234  CHKERR this->iNtegrate(row_data);
235  // assemble local vector
236  OP::locF *= sense;
237  CHKERR this->aSsemble(row_data);
239  };
240 
241  auto do_work_lhs = [this](int row_side, int col_side, EntityType row_type,
242  EntityType col_type,
243  EntitiesFieldData::EntData &row_data,
244  EntitiesFieldData::EntData &col_data, int sense) {
246 
247  auto check_if_assemble_transpose = [&] {
248  if (this->sYmm) {
249  if (OP::rowSide != OP::colSide || OP::rowType != OP::colType)
250  return true;
251  else
252  return false;
253  } else if (OP::assembleTranspose) {
254  return true;
255  }
256  return false;
257  };
258 
259  OP::rowSide = row_side;
260  OP::rowType = row_type;
261  OP::colSide = col_side;
262  OP::colType = col_type;
263  OP::nbCols = col_data.getIndices().size();
264  OP::locMat.resize(OP::nbRows, OP::nbCols, false);
265  OP::locMat.clear();
266  CHKERR this->iNtegrate(row_data, col_data);
267  OP::locMat *= sense;
268  CHKERR this->aSsemble(row_data, col_data, check_if_assemble_transpose());
270  };
271 
272  switch (OP::opType) {
273  case OP::OPROW:
274 
275  OP::nbRows = row_data.getIndices().size();
276  if (!OP::nbRows)
278  OP::nbIntegrationPts = OP::getGaussPts().size2();
279  OP::nbRowBaseFunctions = OP::getNbOfBaseFunctions(row_data);
280 
281  if (!OP::nbRows)
283 
284  for (auto &bd : *brokenBaseSideData) {
285 
286 #ifndef NDEBUG
287  if (bd.getData().getSpace() != HDIV && bd.getData().getSpace() != HCURL) {
288  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
289  (std::string("Expect Hdiv or Hcurl space but received ") +
290  FieldSpaceNames[bd.getData().getSpace()])
291  .c_str());
292  }
293  if (!bd.getData().getNSharedPtr(bd.getData().getBase())) {
294  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
295  "base functions not set");
296  }
297 #endif
298 
299  CHKERR do_work_lhs(
300 
301  // side
302  row_side, bd.getSide(),
303 
304  // type
305  row_type, bd.getType(),
306 
307  // row_data
308  row_data, bd.getData(),
309 
310  // sense
311  bd.getSense()
312 
313  );
314  }
315 
316  break;
317  case OP::OPSPACE:
318  for (auto &bd : *brokenBaseSideData) {
319  CHKERR do_work_rhs(bd.getSide(), bd.getType(), bd.getData(),
320  bd.getSense());
321  }
322  break;
323  default:
325  (std::string("wrong op type ") +
327  .c_str());
328  }
329 
331 }
332 
333 template <int FIELD_DIM, IntegrationType I, typename OpBrokenBase>
335 
336 template <int FIELD_DIM, typename OpBrokenBase>
338  : public OpBrokenBase {
339 
340  using OP = OpBrokenBase;
341 
343  const std::string row_field,
344  boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
345  const double beta, const bool assmb_transpose, const bool only_transpose)
346  : OP(row_field, broken_base_side_data, assmb_transpose, only_transpose),
347  scalarBeta(beta) {}
348 
349 protected:
350  double scalarBeta;
351  MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
352  EntitiesFieldData::EntData &col_data);
353 };
354 
355 template <int FIELD_DIM, typename OpBase>
357  EntitiesFieldData::EntData &row_data,
358  EntitiesFieldData::EntData &col_data) {
360 
361  auto nb_row_dofs = row_data.getIndices().size();
362  auto nb_col_dofs = col_data.getIndices().size();
363  if (!nb_row_dofs || !nb_col_dofs)
365 
367  FTENSOR_INDEX(3, J);
368 
369  auto t_w = this->getFTensor0IntegrationWeight();
370  auto t_normal = OpBase::getFTensor1NormalsAtGaussPts();
371  size_t nb_base_functions = col_data.getN().size2() / 3;
372 
373 #ifndef NDEBUG
374  if (nb_row_dofs % FIELD_DIM != 0 || nb_col_dofs % FIELD_DIM != 0) {
375  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
376  "number of dofs not divisible by field dimension");
377  }
378  if (nb_row_dofs > row_data.getN().size2() * FIELD_DIM ||
379  nb_col_dofs > col_data.getN().size2() * FIELD_DIM) {
380  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
381  "number of dofs exceeds number of base functions");
382  }
383 #endif // NDEBUG
384 
385  auto t_col_base = col_data.getFTensor1N<3>();
386 
387  for (size_t gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
388 
389  int cc = 0;
390  for (; cc != nb_col_dofs / FIELD_DIM; cc++) {
391  auto t_row_base = row_data.getFTensor0N(gg, 0);
392  for (auto rr = 0; rr != nb_row_dofs / FIELD_DIM; ++rr) {
393  OP::locMat(FIELD_DIM * rr, FIELD_DIM * cc) +=
394  (t_w * t_row_base) * (t_normal(J) * t_col_base(J));
395  ++t_row_base;
396  }
397 
398  ++t_col_base;
399  }
400 
401  for (; cc < nb_base_functions; ++cc)
402  ++t_col_base;
403 
404  ++t_w;
405  ++t_normal;
406  }
407 
408  for (auto rr = 0; rr != nb_row_dofs / FIELD_DIM; ++rr) {
409  for (auto cc = 0; cc != nb_col_dofs / FIELD_DIM; ++cc) {
410  for (auto dd = 1; dd < FIELD_DIM; ++dd) {
411  OP::locMat(FIELD_DIM * rr + dd, FIELD_DIM * cc + dd) =
412  OP::locMat(FIELD_DIM * rr, FIELD_DIM * cc);
413  }
414  }
415  }
416 
417  OP::locMat *= scalarBeta;
418 
420 }
421 
422 template <int FIELD_DIM, IntegrationType I, typename OpBase>
424 
425 template <int FIELD_DIM, IntegrationType I, typename OpBase>
427 
428 template <int FIELD_DIM, typename OpBrokenBase>
430  : public OpBrokenBase {
431 
432  using OP = OpBrokenBase;
433 
435  boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
436  boost::shared_ptr<MatrixDouble> lagrange_ptr, const double beta)
437  : OP(broken_base_side_data), scalarBeta(beta), lagrangePtr(lagrange_ptr) {
438  }
439 
440 private:
441  MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data);
442 
443  double scalarBeta;
444  boost::shared_ptr<MatrixDouble> lagrangePtr;
445 };
446 
447 template <int FIELD_DIM, typename OpBase>
450  EntitiesFieldData::EntData &row_data) {
452 
454  FTENSOR_INDEX(3, J);
455 
456  auto t_w = this->getFTensor0IntegrationWeight();
457  auto t_normal = OpBase::getFTensor1NormalsAtGaussPts();
458  auto t_lagrange = getFTensor1FromMat<FIELD_DIM>(*lagrangePtr);
459 
460  auto t_row_base = row_data.getFTensor1N<3>();
461  auto nb_base_functions = row_data.getN().size2() / 3;
462 
463  for (size_t gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
464  auto t_vec = getFTensor1FromPtr<FIELD_DIM>(&*OP::locF.data().begin());
465  size_t rr = 0;
466  for (; rr != row_data.getIndices().size() / FIELD_DIM; ++rr) {
467  t_vec(i) += (t_w * (t_row_base(J) * t_normal(J))) * t_lagrange(i);
468  ++t_row_base;
469  ++t_vec;
470  }
471  for (; rr < nb_base_functions; ++rr)
472  ++t_row_base;
473  ++t_w;
474  ++t_normal;
475  ++t_lagrange;
476  }
477 
478  OP::locF *= scalarBeta;
479 
481 }
482 
483 template <int FIELD_DIM, typename OpBase>
485  : public OpBase {
486 
487  using OP = OpBase;
488 
490  const std::string row_field,
491  boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_side_data_ptr,
492  const double beta)
493  : OpBase(row_field, row_field, OpBase::OPROW),
494  brokenSideDataPtr(broken_side_data_ptr), scalarBeta(beta) {}
495 
496 private:
497  double scalarBeta;
498  boost::shared_ptr<std::vector<BrokenBaseSideData>> brokenSideDataPtr;
499  MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data);
500 };
501 
502 template <int FIELD_DIM, typename OpBase>
505  EntitiesFieldData::EntData &row_data) {
507 
509  FTENSOR_INDEX(3, J);
510 
511  OP::locF.resize(row_data.getIndices().size(), false);
512  OP::locF.clear();
513 
514  for (auto &bd : *brokenSideDataPtr) {
515  auto t_w = this->getFTensor0IntegrationWeight();
516  auto t_normal = OpBase::getFTensor1NormalsAtGaussPts();
517  auto t_row_base = row_data.getFTensor0N();
518  auto t_flux = getFTensor2FromMat<FIELD_DIM, 3>(bd.getFlux());
519  auto nb_base_functions = row_data.getN().size2() / 3;
520  auto sense = bd.getSense();
521  for (size_t gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
522  auto t_vec = getFTensor1FromPtr<FIELD_DIM>(&*OP::locF.data().begin());
523  size_t rr = 0;
524  for (; rr != row_data.getIndices().size() / FIELD_DIM; ++rr) {
525  t_vec(i) += (sense * t_w) * t_row_base * t_normal(J) * t_flux(i, J);
526  ++t_row_base;
527  ++t_vec;
528  }
529  for (; rr < nb_base_functions; ++rr)
530  ++t_row_base;
531  ++t_w;
532  ++t_normal;
533  ++t_flux;
534  }
535  }
536 
537  OP::locF *= scalarBeta;
538 
540 }
541 
542 } // namespace MoFEM
543 
544 #endif // __FORMSBROKENSPACECONSTRAINTIMPL_HPP__
UBlasMatrix< double >
NOSPACE
@ NOSPACE
Definition: definitions.h:83
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
CHK_MOAB_THROW
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:589
MoFEM::OpBrokenSpaceConstrainImpl< FIELD_DIM, GAUSS, OpBrokenBase >::scalarBeta
double scalarBeta
Definition: FormsBrokenSpaceConstraintImpl.hpp:350
MoFEM::OpBaseImpl::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: FormsIntegrators.hpp:238
MoFEM::EntitiesFieldData::EntData
Data on single entity (This is passed as argument to DataOperator::doWork)
Definition: EntitiesFieldData.hpp:128
MoFEM::OpBrokenSpaceConstrainImpl
Definition: FormsBrokenSpaceConstraintImpl.hpp:334
MoFEM::BrokenBaseSideData::getSide
auto & getSide()
Definition: FormsBrokenSpaceConstraintImpl.hpp:55
MoFEM::EntitiesFieldData::EntData::sPace
FieldSpace sPace
Entity space.
Definition: EntitiesFieldData.hpp:1071
MoFEM::ForcesAndSourcesCore::UserDataOperator::OpTypeNames
static const char *const OpTypeNames[]
Definition: ForcesAndSourcesCore.hpp:574
MoFEM::OpLoopSide::sideFEName
const std::string sideFEName
Definition: ForcesAndSourcesCore.hpp:1324
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::BrokenBaseSideData::getType
auto & getType()
Definition: FormsBrokenSpaceConstraintImpl.hpp:56
MoFEM::OpBrokenSpaceConstrainDFluxImpl< FIELD_DIM, GAUSS, OpBrokenBase >::OpBrokenSpaceConstrainDFluxImpl
OpBrokenSpaceConstrainDFluxImpl(boost::shared_ptr< std::vector< BrokenBaseSideData >> broken_base_side_data, boost::shared_ptr< MatrixDouble > lagrange_ptr, const double beta)
Definition: FormsBrokenSpaceConstraintImpl.hpp:434
MoFEM::OpBrokenBaseImpl::OpBrokenBaseImpl
OpBrokenBaseImpl(boost::shared_ptr< std::vector< BrokenBaseSideData >> broken_base_side_data, boost::shared_ptr< Range > ents_ptr=nullptr)
Definition: FormsBrokenSpaceConstraintImpl.hpp:175
MoFEM::OpBrokenBaseImpl::doWork
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
Definition: FormsBrokenSpaceConstraintImpl.hpp:204
MoFEM::OpBrokenBaseImpl::brokenBaseSideData
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenBaseSideData
Definition: FormsBrokenSpaceConstraintImpl.hpp:199
MoFEM::ForcesAndSourcesCore::UserDataOperator::getSidePtrFE
ForcesAndSourcesCore * getSidePtrFE() const
Definition: ForcesAndSourcesCore.hpp:1256
MoFEM::OpGetBrokenBaseSideData::doWork
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
Definition: FormsBrokenSpaceConstraintImpl.hpp:92
MoFEM::OpBaseImpl::assembleTranspose
bool assembleTranspose
Definition: FormsIntegrators.hpp:246
MoFEM::BrokenBaseSideData::getData
auto & getData()
Definition: FormsBrokenSpaceConstraintImpl.hpp:57
J
FTensor::Index< 'J', DIM1 > J
Definition: level_set.cpp:30
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
MoFEM::OpSetFlux
Definition: FormsBrokenSpaceConstraintImpl.hpp:139
FTENSOR_INDEX
#define FTENSOR_INDEX(DIM, I)
Definition: Templates.hpp:2011
MOFEM_IMPOSSIBLE_CASE
@ MOFEM_IMPOSSIBLE_CASE
Definition: definitions.h:35
MoFEM::OpBrokenSpaceConstrainImpl< FIELD_DIM, GAUSS, OpBrokenBase >::OpBrokenSpaceConstrainImpl
OpBrokenSpaceConstrainImpl(const std::string row_field, boost::shared_ptr< std::vector< BrokenBaseSideData >> broken_base_side_data, const double beta, const bool assmb_transpose, const bool only_transpose)
Definition: FormsBrokenSpaceConstraintImpl.hpp:342
MoFEM::EntitiesFieldData::EntData::sEnse
int sEnse
Entity sense (orientation)
Definition: EntitiesFieldData.hpp:1069
MoFEM::OpBrokenSpaceConstrainDFluxImpl< FIELD_DIM, GAUSS, OpBrokenBase >::lagrangePtr
boost::shared_ptr< MatrixDouble > lagrangePtr
Definition: FormsBrokenSpaceConstraintImpl.hpp:444
FIELD_DIM
constexpr int FIELD_DIM
Definition: child_and_parent.cpp:15
MoFEM::OpLoopSide::sideFEPtr
boost::shared_ptr< E > sideFEPtr
Definition: ForcesAndSourcesCore.hpp:1326
MoFEM::EntitiesFieldData::EntData::getFTensor0N
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Definition: EntitiesFieldData.hpp:1502
OpBase
MoFEM::OpBaseImpl
Definition: FormsIntegrators.hpp:178
MoFEM::OpGetBrokenBaseSideData
Definition: FormsBrokenSpaceConstraintImpl.hpp:68
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::OpBrokenLoopSide
Definition: FormsBrokenSpaceConstraintImpl.hpp:15
MoFEM::OpBrokenSpaceConstrainDHybridImpl< FIELD_DIM, GAUSS, OpBase >::brokenSideDataPtr
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenSideDataPtr
Definition: FormsBrokenSpaceConstraintImpl.hpp:498
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::OpBrokenBaseImpl
Definition: FormsBrokenSpaceConstraintImpl.hpp:171
MoFEM::OpGetBrokenBaseSideData::OpGetBrokenBaseSideData
OpGetBrokenBaseSideData(const std::string field_name, boost::shared_ptr< std::vector< BrokenBaseSideData >> broken_base_side_data)
Definition: FormsBrokenSpaceConstraintImpl.hpp:84
MoFEM::EntitiesFieldData::EntData::bAse
FieldApproximationBase bAse
Field approximation base.
Definition: EntitiesFieldData.hpp:1072
MoFEM::EntitiesFieldData::EntData::iNdices
VectorInt iNdices
Global indices on entity.
Definition: EntitiesFieldData.hpp:1073
MoFEM::EntitiesFieldData::EntData::fieldEntities
VectorFieldEntities fieldEntities
Field entities.
Definition: EntitiesFieldData.hpp:1076
convert.type
type
Definition: convert.py:64
MoFEM::OpGetBrokenBaseSideData::brokenBaseSideData
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenBaseSideData
Definition: FormsBrokenSpaceConstraintImpl.hpp:80
MoFEM::OpBrokenSpaceConstrainDFluxImpl
Definition: FormsBrokenSpaceConstraintImpl.hpp:426
MoFEM::EntitiesFieldData::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: EntitiesFieldData.hpp:1214
MoFEM::BrokenBaseSideData
Definition: FormsBrokenSpaceConstraintImpl.hpp:52
MoFEM::GAUSS
@ GAUSS
Definition: FormsIntegrators.hpp:136
MoFEM::ForcesAndSourcesCore::UserDataOperator::getPtrFE
ForcesAndSourcesCore * getPtrFE() const
Definition: ForcesAndSourcesCore.hpp:1251
MoFEM::OpSetFlux::doWork
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
Definition: FormsBrokenSpaceConstraintImpl.hpp:163
MoFEM::OpBrokenSpaceConstrainDHybridImpl< FIELD_DIM, GAUSS, OpBase >::OpBrokenSpaceConstrainDHybridImpl
OpBrokenSpaceConstrainDHybridImpl(const std::string row_field, boost::shared_ptr< std::vector< BrokenBaseSideData >> broken_side_data_ptr, const double beta)
Definition: FormsBrokenSpaceConstraintImpl.hpp:489
MoFEM::OpBaseImpl::onlyTranspose
bool onlyTranspose
Definition: FormsIntegrators.hpp:247
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
MoFEM::OpSetFlux::fluxPtr
boost::shared_ptr< MatrixDouble > fluxPtr
Definition: FormsBrokenSpaceConstraintImpl.hpp:152
MoFEM::BrokenBaseSideData::getFlux
auto & getFlux()
Definition: FormsBrokenSpaceConstraintImpl.hpp:58
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
MoFEM::ForcesAndSourcesCore::UserDataOperator::getFEMethod
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
Definition: ForcesAndSourcesCore.hpp:1042
MoFEM::OpBrokenSpaceConstrainDFluxImpl< FIELD_DIM, GAUSS, OpBrokenBase >::scalarBeta
double scalarBeta
Definition: FormsBrokenSpaceConstraintImpl.hpp:443
FTensor::dd
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
FieldSpaceNames
const static char *const FieldSpaceNames[]
Definition: definitions.h:92
MoFEM::BrokenBaseSideData::BrokenBaseSideData
BrokenBaseSideData()
Definition: FormsBrokenSpaceConstraintImpl.hpp:53
MoFEM::EntitiesFieldData::EntData::localIndices
VectorInt localIndices
Local indices on entity.
Definition: EntitiesFieldData.hpp:1074
MoFEM::OpBaseImpl::entsPtr
boost::shared_ptr< Range > entsPtr
Entities on which element is run.
Definition: FormsIntegrators.hpp:213
MoFEM::EntitiesFieldData::EntData::getN
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
Definition: EntitiesFieldData.hpp:1318
MoFEM::BrokenBaseSideData::fluxMat
MatrixDouble fluxMat
Definition: FormsBrokenSpaceConstraintImpl.hpp:65
MoFEM::EntitiesFieldData::EntData::getFTensor1N
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
Definition: EntitiesFieldData.cpp:640
MoFEM::BrokenBaseSideData::eleType
EntityType eleType
Definition: FormsBrokenSpaceConstraintImpl.hpp:63
HCURL
@ HCURL
field with continuous tangents
Definition: definitions.h:86
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::BrokenBaseSideData::eleSense
int eleSense
Definition: FormsBrokenSpaceConstraintImpl.hpp:61
MoFEM::BrokenBaseSideData::getSense
auto & getSense()
Definition: FormsBrokenSpaceConstraintImpl.hpp:54
MoFEM::OpSetFlux::OpSetFlux
OpSetFlux(boost::shared_ptr< std::vector< BrokenBaseSideData >> broken_base_side_data, boost::shared_ptr< MatrixDouble > flux_ptr)
Definition: FormsBrokenSpaceConstraintImpl.hpp:156
MoFEM::EntitiesFieldData::EntData::baseFunctionsAndBaseDerivatives
std::array< std::array< boost::shared_ptr< MatrixDouble >, LASTBASE >, LastDerivative > baseFunctionsAndBaseDerivatives
Definition: EntitiesFieldData.hpp:1086
MoFEM::BrokenBaseSideData::eleSide
int eleSide
Definition: FormsBrokenSpaceConstraintImpl.hpp:62
MoFEM::OpSetFlux::brokenBaseSideData
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenBaseSideData
Definition: FormsBrokenSpaceConstraintImpl.hpp:151
MoFEM::EntitiesFieldData::EntData::fieldData
VectorDouble fieldData
Field data on entity.
Definition: EntitiesFieldData.hpp:1077
MoFEM::EntitiesFieldData::EntData::dOfs
VectorDofs dOfs
DoFs on entity.
Definition: EntitiesFieldData.hpp:1075
MoFEM::OpBrokenLoopSide::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Definition: FormsBrokenSpaceConstraintImpl.hpp:20
MoFEM::OpBrokenBaseImpl::OpBrokenBaseImpl
OpBrokenBaseImpl(const std::string row_field, boost::shared_ptr< std::vector< BrokenBaseSideData >> broken_base_side_data, const bool assmb_transpose, const bool only_transpose, boost::shared_ptr< Range > ents_ptr=nullptr)
Definition: FormsBrokenSpaceConstraintImpl.hpp:182
OP
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
HDIV
@ HDIV
field with continuous normal traction
Definition: definitions.h:87
MoFEM::OpBrokenSpaceConstrainDHybridImpl< FIELD_DIM, GAUSS, OpBase >::scalarBeta
double scalarBeta
Definition: FormsBrokenSpaceConstraintImpl.hpp:497
OpBrokenBase
MoFEM::OpLoopSide
Element used to execute operators on side of the element.
Definition: ForcesAndSourcesCore.hpp:1290
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MoFEM::BrokenBaseSideData::entData
EntitiesFieldData::EntData entData
Definition: FormsBrokenSpaceConstraintImpl.hpp:64
MoFEM::OpBrokenSpaceConstrainDHybridImpl
Definition: FormsBrokenSpaceConstraintImpl.hpp:423