v0.14.0
BasicBoundaryConditionsInterface.hpp
Go to the documentation of this file.
1 /** \file BasicBoundaryConditionsInterface.hpp
2  \brief Header file for BasicBoundaryConditionsInterface element implementation
3 */
4 
5 
6 
7 // TODO: This is still work in progress !!!
8 
9 // FIX and ROTATE Boundary conditions
10 // include SurfacePressureComplexForLazy for following load
11 
12 
13 #ifndef __BASICBOUNDARYCONDIONSINTERFACE_HPP__
14 #define __BASICBOUNDARYCONDIONSINTERFACE_HPP__
15 
16 
17 /** \brief Set of functions declaring elements and setting operators
18  * for basic boundary conditions interface
19  */
21 
22  using DomainEle = VolumeElementForcesAndSourcesCore;
26 
27  using OpBodyForce = FormsIntegrators<DomainEleOp>::Assembly<
28  PETSC>::LinearForm<GAUSS>::OpSource<1, 3>;
29  using DomainNaturalBC =
30  NaturalBC<DomainEleOp>::Assembly<PETSC>::LinearForm<GAUSS>;
31  using OpBodyForceVector =
33 
34  using OpMass = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm<
36  using OpInertiaForce = FormsIntegrators<DomainEleOp>::Assembly<
37  PETSC>::LinearForm<GAUSS>::OpBaseTimesVector<1, 3, 1>;
38 
41  : tForce(t_vec), sCale(scale) {}
42 
45  tForce(i) *= sCale;
46  return tForce;
47  }
48 
49  private:
50  double sCale;
52  };
53 
55  double sCale;
56  BasicBCVectorScale(double scale, std::string file_name)
57  : sCale(scale), TimeScaleVector3(file_name, false) {}
58 
61  auto vec2 = MoFEM::TimeScaleVector3::getVector(time);
63  vec(i) = sCale * vec2(i);
64  return vec;
65  }
66  };
67 
69  SmartPetscObj<DM> dM;
70 
72 
73  struct LoadScale : public MethodForForceScaling {
74  double *lAmbda;
75  LoadScale(double *my_lambda) : lAmbda(my_lambda){};
78  nf *= *lAmbda;
80  }
81  };
82 
86  bool isLinear;
87 
89 
90  string positionField;
91  string meshNodeField;
92 
93  boost::ptr_map<std::string, NeumannForcesSurface> neumann_forces;
94  boost::ptr_map<std::string, NodalForce> nodal_forces;
95  boost::ptr_map<std::string, EdgeForce> edge_forces;
96 
97  boost::shared_ptr<FluidPressure> fluidPressureElementPtr;
98 
99  boost::shared_ptr<FaceElementForcesAndSourcesCore> springRhsPtr;
100  boost::shared_ptr<FaceElementForcesAndSourcesCore> springLhsPtr;
101 
102  boost::shared_ptr<VolumeElementForcesAndSourcesCore> bodyForceRhsPtr;
103  boost::shared_ptr<VolumeElementForcesAndSourcesCore> bodyForceLhsPtr;
104  // boost::shared_ptr<FEMethod> dirichletBcPtr;
105 
106  boost::shared_ptr<DirichletDisplacementBc> dirichletBcPtr;
107  boost::shared_ptr<KelvinVoigtDamper> damperElementPtr;
108 
109  const string domainProblemName;
110  const string domainElementName;
111 
112  // boost::shared_ptr<PostProcVolumeOnRefinedMesh> postProc;
113  // boost::shared_ptr<PostProcFaceOnRefinedMesh> postProcSkin;
114 
116  MoFEM::Interface &m_field, string postion_field,
117  string mesh_pos_field_name = "MESH_NODE_POSITIONS",
118  string problem_name = "ELASTIC",
119  string domain_element_name = "ELASTIC_FE",
120  bool is_displacement_field = true, bool is_quasi_static = true,
121  double *snes_load_factor = nullptr, bool is_partitioned = true)
122  : mField(m_field), positionField(postion_field),
123  meshNodeField(mesh_pos_field_name), domainProblemName(problem_name),
124  domainElementName(domain_element_name),
125  isDisplacementField(is_displacement_field),
127  snesLambdaLoadFactorPtr(snes_load_factor),
128  isPartitioned(is_partitioned), isLinear(PETSC_FALSE) {}
129 
131 
134 
135  PetscBool quasi_static = PETSC_FALSE;
136  PetscBool is_linear = PETSC_FALSE;
137  CHKERR PetscOptionsGetBool(PETSC_NULL, "-is_quasi_static", &quasi_static,
138  PETSC_NULL);
139  CHKERR PetscOptionsGetBool(PETSC_NULL, "-is_linear", &is_linear,
140  PETSC_NULL);
141 
142  isQuasiStatic = quasi_static;
143  isLinear = is_linear;
144 
146  };
147 
148  MoFEMErrorCode addElementFields() override { return 0;};
149 
152 
154  meshNodeField);
158 
159  if (!isDisplacementField)
160  dirichletBcPtr = boost::make_shared<DirichletSpatialRemoveDofsBc>(
162  "DISPLACEMENT", isPartitioned);
163  else
164  dirichletBcPtr = boost::make_shared<DirichletDisplacementRemoveDofsBc>(
165  mField, positionField, domainProblemName, "DISPLACEMENT",
166  isPartitioned);
167  // CHKERR dynamic_cast<DirichletDisplacementRemoveDofsBc &>(
168  // *dirichletBcPtr).iNitialize();
169 
170  CHKERR mField.add_finite_element("DAMPER_FE", MF_ZERO);
172  positionField);
174  positionField);
176  positionField);
178  meshNodeField);
179 
180  // CHKERR mField.add_finite_element(domainElementName, "FLUID_PRESSURE_FE");
181 
182  fluidPressureElementPtr = boost::make_shared<FluidPressure>(mField);
183  fluidPressureElementPtr->addNeumannFluidPressureBCElements(positionField);
185  false, false);
186 
187  damperElementPtr = boost::make_shared<KelvinVoigtDamper>(mField);
188  damperElementPtr->commonData.meshNodePositionName = meshNodeField;
189 
190  auto &common_data = damperElementPtr->commonData;
191 
192  common_data.spatialPositionName = positionField;
193  common_data.spatialPositionNameDot = "DOT_" + positionField;
194  damperElementPtr->setBlockDataMap(); FIXME:
195 
196  for (auto &[id, data] : damperElementPtr->blockMaterialDataMap) {
197  data.lInear = isLinear;
198  int cid = id;
199  damperElementPtr->constitutiveEquationMap.insert(
202  "DAMPER_FE");
203  }
204 
206  };
207 
211  positionField);
213  positionField);
214 
216  mField, neumann_forces, PETSC_NULL, positionField);
217  springLhsPtr = boost::make_shared<FaceElementForcesAndSourcesCore>(mField);
218  springRhsPtr = boost::make_shared<FaceElementForcesAndSourcesCore>(mField);
220  boost::make_shared<VolumeElementForcesAndSourcesCore>(mField);
222  boost::make_shared<VolumeElementForcesAndSourcesCore>(mField);
223 
226  meshNodeField);
227 
228 
229  fluidPressureElementPtr->setNeumannFluidPressureFiniteElementOperators(
230  positionField, PETSC_NULL, true, true);
231 
232  // KelvinVoigtDamper::CommonData &common_data =
233  // damperElementPtr->commonData;
234  CHKERR damperElementPtr->setOperators(3);
235 
236  // auto dm = mField.getInterface<Simple>()->getDM();
237 
238  auto get_id_block_param = [&](string base_name, int id) {
239  char load_hist_file[255] = "hist.in";
240  PetscBool ctg_flag = PETSC_FALSE;
241  string param_name_with_id = "-" + base_name + "_" + to_string(id);
242  CHKERR PetscOptionsGetString(PETSC_NULL, PETSC_NULL,
243  param_name_with_id.c_str(), load_hist_file,
244  255, &ctg_flag);
245  if (ctg_flag)
246  return param_name_with_id;
247 
248  param_name_with_id = "-" + base_name;
249  CHKERR PetscOptionsGetString(PETSC_NULL, PETSC_NULL,
250  param_name_with_id.c_str(), load_hist_file,
251  255, &ctg_flag);
252  if (ctg_flag) {
253  MOFEM_LOG("WORLD", Sev::verbose)
254  << "Setting one accelerogram for all blocks!";
255  return param_name_with_id;
256  }
257 
258  return string("");
259  };
260 
261  auto get_adj_ents = [&](const Range &ents) {
262  Range verts;
263  CHKERR mField.get_moab().get_connectivity(ents, verts, true);
264  for (size_t d = 1; d < 3; ++d)
265  CHKERR mField.get_moab().get_adjacencies(ents, d, false, verts,
266  moab::Interface::UNION);
267  verts.merge(ents);
268  CHKERR mField.getInterface<CommInterface>()->synchroniseEntities(verts);
269  return verts;
270  };
271 
273  const std::string block_name = "BODY_FORCE";
274  if (it->getName().compare(0, block_name.size(), block_name) == 0) {
275  std::vector<double> attr;
276  CHKERR it->getAttributes(attr);
277  if (attr.size() > 3) {
278 
279  const int id = it->getMeshsetId();
280 
281  Range bc_ents;
282  CHKERR it->getMeshsetIdEntitiesByDimension(mField.get_moab(), 3,
283  bc_ents, true);
284  auto bc_ents_ptr = boost::make_shared<Range>(get_adj_ents(bc_ents));
285 
286  // the first parameter is density!!! FIXME:
287 
288  VectorDouble acc({attr[1], attr[2], attr[3]});
289  double density = attr[0];
290  bool inertia_flag =
291  attr.size() > 4 ? bool(std::floor(attr[4])) : true;
292  // if accelerogram is provided then change the acceleration,
293  // otherwise use whatever is in that block TODO:
294  std::vector<boost::shared_ptr<TimeScaleVector3>> methods_for_scaling;
295  std::string param_name_for_scaling =
296  get_id_block_param("accelerogram", id);
297 
298  if (!param_name_for_scaling.empty())
299  methods_for_scaling.push_back(
300  boost::make_shared<BasicBCVectorScale>(density,
301  param_name_for_scaling));
302  else
303  methods_for_scaling.push_back(
304  boost::make_shared<BasicBCVectorConst>(
305  density,
306  FTensor::Tensor1<double, 3>({acc(0), acc(1), acc(2)})));
307 
308  // FIXME: this require correction for large strains, multiply by det_F
309  auto get_rho = [&](double, double, double) {
310  auto *pipeline_mng = mField.getInterface<PipelineManager>();
311  auto &fe_domain_lhs = bodyForceLhsPtr;
312  return density * fe_domain_lhs->ts_aa;
313  };
314 
315  auto &pipeline_rhs = bodyForceRhsPtr->getOpPtrVector();
316  auto &pipeline_lhs = bodyForceLhsPtr->getOpPtrVector();
317 
319  false, false);
321  false, false);
322 
323  //FIXME: fix for large strains
324  pipeline_rhs.push_back(
325  new OpSetBc(positionField, true, mBoundaryMarker));
326 
327  // using new way of adding BCs
328  CHKERR
330  pipeline_rhs, mField, "U", {}, methods_for_scaling,
331  it->getName(), Sev::inform);
332 
333  if (!isQuasiStatic && inertia_flag) {
334  pipeline_lhs.push_back(
335  new OpSetBc(positionField, true, mBoundaryMarker));
336  pipeline_lhs.push_back(
337  new OpMass(positionField, positionField, get_rho, bc_ents_ptr));
338  auto mat_acceleration = boost::make_shared<MatrixDouble>();
339  pipeline_rhs.push_back(new OpCalculateVectorFieldValuesDotDot<3>(
340  positionField, mat_acceleration));
341  pipeline_rhs.push_back(new OpInertiaForce(
342  positionField, mat_acceleration,
343  [&](double, double, double) { return density; }, bc_ents_ptr));
344  pipeline_lhs.push_back(new OpUnSetBc(positionField));
345  }
346  pipeline_rhs.push_back(new OpUnSetBc(positionField));
347 
348  } else {
349  SETERRQ1(
350  PETSC_COMM_SELF, MOFEM_INVALID_DATA,
351  "There should be (1 density + 3 accelerations ) attributes in "
352  "BODY_FORCE blockset, but is %d. Optionally, you can set 5th "
353  "parameter to inertia flag.",
354  attr.size());
355  }
356  }
357  }
358 
359  auto integration_rule_vol = [](int, int, int approx_order) {
360  return 2 * approx_order + 1;
361  };
362  auto integration_rule_boundary = [](int, int, int approx_order) {
363  return 2 * approx_order + 1;
364  };
365 
366  springLhsPtr->getRuleHook = integration_rule_boundary;
367  springRhsPtr->getRuleHook = integration_rule_boundary;
368  bodyForceLhsPtr->getRuleHook = integration_rule_vol;
369  bodyForceRhsPtr->getRuleHook = integration_rule_vol;
370 
371  // set other boundary conditions
372  auto bc_mng = mField.getInterface<BcManager>();
373  auto *pipeline_mng = mField.getInterface<PipelineManager>();
374 
375  CHKERR bc_mng->removeBlockDOFsOnEntities(domainProblemName, "REMOVE_X",
376  positionField, 0, 0, true,
377  isPartitioned);
378  CHKERR bc_mng->removeBlockDOFsOnEntities(domainProblemName, "REMOVE_Y",
379  positionField, 1, 1, true,
380  isPartitioned);
381  CHKERR bc_mng->removeBlockDOFsOnEntities(domainProblemName, "REMOVE_Z",
382  positionField, 2, 2, true,
383  isPartitioned);
384  CHKERR bc_mng->removeBlockDOFsOnEntities(domainProblemName, "REMOVE_ALL",
385  positionField, 0, 2, true,
386  isPartitioned);
387 
388  CHKERR bc_mng->pushMarkDOFsOnEntities(domainProblemName, "FIX_X",
389  positionField, 0, 0);
390  CHKERR bc_mng->pushMarkDOFsOnEntities(domainProblemName, "FIX_Y",
391  positionField, 1, 1);
392  CHKERR bc_mng->pushMarkDOFsOnEntities(domainProblemName, "FIX_Z",
393  positionField, 2, 2);
394  CHKERR bc_mng->pushMarkDOFsOnEntities(domainProblemName, "FIX_ALL",
395  positionField, 0, 2);
396  CHKERR bc_mng->pushMarkDOFsOnEntities(domainProblemName, "ROTATE",
397  positionField, 0, 2);
398 
400  bc_mng->getMergedBlocksMarker(vector<string>{"FIX_", "ROTATE"});
401 
403  };
404 
405  MoFEMErrorCode addElementsToDM(SmartPetscObj<DM> dm) override {
407  this->dM = dm;
408  auto simple = mField.getInterface<Simple>();
409  vector<const char *> element_list{"FORCE_FE", "PRESSURE_FE",
410  "FLUID_PRESSURE_FE",
411  "SPRING",
412  "DAMPER_FE"};
413  for (auto &el : element_list) {
415  simple->getOtherFiniteElements().push_back(el);
416  }
417  // if (!fluidPressureElementPtr->setOfFluids.empty())
418  // FIXME:
419  // CHKERR mField.modify_problem_add_finite_element(domainProblemName,
420  // "FLUID_PRESSURE_FE");
421  // CHKERR dynamic_cast<DirichletDisplacementRemoveDofsBc &>(
422  // *dirichletBcPtr).iNitialize();
424  };
425 
426  MoFEMErrorCode updateElementVariables() override { return 0; };
427  MoFEMErrorCode postProcessElement(int step) override { return 0; };
428 
429  string getHistoryParam(string prefix) {
430  char load_hist_file[255] = "hist.in";
431  PetscBool ctg_flag = PETSC_FALSE;
432  string new_param_file = string("-") + prefix + string("_history");
433  CHKERR PetscOptionsGetString(PETSC_NULL, PETSC_NULL, new_param_file.c_str(),
434  load_hist_file, 255, &ctg_flag);
435  if (ctg_flag)
436  return new_param_file;
437  return string("-load_history");
438  };
439 
440  template <typename T>
442  CHKERR setupSolverImpl<T, true>(type);
444  }
445 
446  template <typename T>
448  CHKERR setupSolverImpl<T, false>(type);
450  }
451 
452  template <typename T, bool RHS>
455  // auto dm = dM;
456  // boost::shared_ptr<FEMethod> null;
457 
458  auto set_solver_pipelines =
459  [&](PetscErrorCode (*function)(DM, const char fe_name[], MoFEM::FEMethod *,
462  PetscErrorCode (*jacobian)(DM, const char fe_name[], MoFEM::FEMethod *,
464  MoFEM::BasicMethod *)) {
465 
467  if (RHS) {
468  if (std::is_same_v<T, TS>)
469  dirichletBcPtr->methodsOp.push_back(
470  new TimeForceScale(getHistoryParam("dirichlet"), false));
471 
473 
474  // auto push_fmethods = [&](auto method, string element_name) {
475  // CHKERR function(dm, element_name.c_str(), method, method, method);
476  // };
477 
478  auto set_neumann_methods = [&](auto &neumann_el, string hist_name,
479  int dim) {
481  for (auto &&mit : neumann_el) {
482  if constexpr (std::is_same_v<T, SNES>)
483  mit->second->methodsOp.push_back(
485  if constexpr (std::is_same_v<T, TS>)
486  mit->second->methodsOp.push_back(
487  new TimeForceScale(getHistoryParam(hist_name), false));
488  string element_name = mit->first;
489  switch (dim) {
490  case 2:
491  CHKERR AddHOOps<2, 3, 3>::add(
492  mit->second->getLoopFe().getOpPtrVector(), {},
493  meshNodeField);
494  break;
495  case 1:
496  CHKERR AddHOOps<1, 2, 2>::add(
497  mit->second->getLoopFe().getOpPtrVector(), {},
498  meshNodeField);
499  break;
500  case 0:
501  break;
502  default:
503  break;
504  }
505  // CHKERR push_fmethods(&mit->second->getLoopFe(),
506  // element_name);
507  CHKERR function(dM, element_name.c_str(),
508  &mit->second->getLoopFe(), NULL, NULL);
509  }
511  };
512 
513  CHKERR set_neumann_methods(neumann_forces, "force", 2);
514  CHKERR set_neumann_methods(nodal_forces, "force", 0);
515  CHKERR set_neumann_methods(edge_forces, "force", 1);
516 
517  CHKERR function(dM, domainElementName.c_str(), dirichletBcPtr.get(),
518  dirichletBcPtr.get(), dirichletBcPtr.get());
519  CHKERR function(dM, domainElementName.c_str(),
520  bodyForceRhsPtr.get(), NULL, NULL);
521  CHKERR function(dM, "SPRING", springRhsPtr.get(), NULL, NULL);
522  CHKERR function(dM, "DAMPER_FE", &damperElementPtr->feRhs, NULL,
523  NULL);
524  CHKERR function(dM, "FLUID_PRESSURE_FE",
525  &fluidPressureElementPtr->getLoopFe(), NULL, NULL);
526  } else {
527 
528  CHKERR jacobian(dM, domainElementName.c_str(), dirichletBcPtr.get(),
529  dirichletBcPtr.get(), dirichletBcPtr.get());
530  CHKERR jacobian(dM, domainElementName.c_str(),
531  bodyForceLhsPtr.get(), NULL, NULL);
532  CHKERR jacobian(dM, "SPRING", springLhsPtr.get(), NULL, NULL);
533 
534  CHKERR jacobian(dM, "DAMPER_FE", &damperElementPtr->feLhs, NULL,
535  NULL);
536  }
537 
539  };
540 
541  if constexpr (std::is_same_v<T, SNES>) {
542 
544  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
545  "SNES lambda factor pointer not set in the module constructor");
546 
547  CHKERR set_solver_pipelines(&DMMoFEMSNESSetFunction,
549 
550  } else if constexpr (std::is_same_v<T, TS>) {
551 
552  switch (type) {
553  case IM:
554  CHKERR set_solver_pipelines(&DMMoFEMTSSetIFunction,
556  break;
557  case IM2:
558  CHKERR set_solver_pipelines(&DMMoFEMTSSetI2Function,
560  break;
561  case EX:
562  CHKERR set_solver_pipelines(&DMMoFEMTSSetRHSFunction,
564  break;
565  default:
566  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
567  "This TS is not yet implemented for basic BCs");
568  break;
569  }
570 
571  } else
572  static_assert(!std::is_same_v<T, KSP>,
573  "this solver has not been implemented for basic BCs yet");
574 
575 
577  }
578 
581  CHKERR this->setupSolverFunction<SNES>();
583  }
586  CHKERR this->setupSolverJacobian<SNES>();
588  }
592  CHKERR this->setupSolverFunction<TS>(type);
594  }
598  CHKERR this->setupSolverJacobian<TS>(type);
600  }
601 
602 };
603 
604 #endif //__BASICBOUNDARYCONDIONSINTERFACE_HPP__
BasicBoundaryConditionsInterface::OpMass
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 3 > OpMass
Definition: BasicBoundaryConditionsInterface.hpp:35
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
BasicBoundaryConditionsInterface::damperElementPtr
boost::shared_ptr< KelvinVoigtDamper > damperElementPtr
Definition: BasicBoundaryConditionsInterface.hpp:107
BasicBoundaryConditionsInterface::BasicBoundaryConditionsInterface
BasicBoundaryConditionsInterface(MoFEM::Interface &m_field, string postion_field, string mesh_pos_field_name="MESH_NODE_POSITIONS", string problem_name="ELASTIC", string domain_element_name="ELASTIC_FE", bool is_displacement_field=true, bool is_quasi_static=true, double *snes_load_factor=nullptr, bool is_partitioned=true)
Definition: BasicBoundaryConditionsInterface.hpp:115
MoFEM::addHOOpsFace3D
MoFEMErrorCode addHOOpsFace3D(const std::string field, E &e, bool hcurl, bool hdiv)
Definition: HODataOperators.hpp:699
BasicBoundaryConditionsInterface::setupSolverJacobianTS
MoFEMErrorCode setupSolverJacobianTS(const TSType type) override
Definition: BasicBoundaryConditionsInterface.hpp:596
BasicBoundaryConditionsInterface::BasicBCVectorConst::tForce
FTensor::Tensor1< double, 3 > tForce
Definition: BasicBoundaryConditionsInterface.hpp:51
MetaNeumannForces::addNeumannBCElements
static MoFEMErrorCode addNeumannBCElements(MoFEM::Interface &m_field, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS", Range *intersect_ptr=NULL)
Declare finite element.
Definition: SurfacePressure.cpp:1974
BasicBoundaryConditionsInterface::setupSolverImpl
MoFEMErrorCode setupSolverImpl(const TSType type=IM)
Definition: BasicBoundaryConditionsInterface.hpp:453
BasicBoundaryConditionsInterface
Set of functions declaring elements and setting operators for basic boundary conditions interface.
Definition: BasicBoundaryConditionsInterface.hpp:20
FTensor::Tensor1< double, 3 >
MetaNodalForces::addElement
static MoFEMErrorCode addElement(MoFEM::Interface &m_field, const std::string field_name, Range *intersect_ptr=NULL)
Add element taking information from NODESET.
Definition: NodalForce.hpp:92
BasicBoundaryConditionsInterface::neumann_forces
boost::ptr_map< std::string, NeumannForcesSurface > neumann_forces
Definition: BasicBoundaryConditionsInterface.hpp:93
MoFEM::FEMethod
structure for User Loop Methods on finite elements
Definition: LoopMethods.hpp:369
MoFEM::addHOOpsVol
MoFEMErrorCode addHOOpsVol(const std::string field, E &e, bool h1, bool hcurl, bool hdiv, bool l2)
Definition: HODataOperators.hpp:674
MoFEM::OpFluxRhsImpl
Definition: Natural.hpp:39
BasicBoundaryConditionsInterface::DomainEle
VolumeElementForcesAndSourcesCore DomainEle
Definition: BasicBoundaryConditionsInterface.hpp:22
BasicBoundaryConditionsInterface::BasicBCVectorScale::sCale
double sCale
Definition: BasicBoundaryConditionsInterface.hpp:55
MoFEM::CoreInterface::modify_finite_element_add_field_row
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)=0
set field row which finite element use
BasicBoundaryConditionsInterface::domainElementName
const string domainElementName
Definition: BasicBoundaryConditionsInterface.hpp:110
MoFEM::TimeScaleVector3
TimeScaleVector< 3 > TimeScaleVector3
Definition: ScalingMethod.hpp:126
BasicBoundaryConditionsInterface::BasicBCVectorConst::getVector
FTensor::Tensor1< double, 3 > getVector(const double time)
Definition: BasicBoundaryConditionsInterface.hpp:43
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
BasicBoundaryConditionsInterface::nodal_forces
boost::ptr_map< std::string, NodalForce > nodal_forces
Definition: BasicBoundaryConditionsInterface.hpp:94
MoFEM::PETSC
@ PETSC
Definition: FormsIntegrators.hpp:105
BasicBoundaryConditionsInterface::setupSolverJacobian
MoFEMErrorCode setupSolverJacobian(const TSType type=IM)
Definition: BasicBoundaryConditionsInterface.hpp:447
BasicBoundaryConditionsInterface::BasicBCVectorConst::BasicBCVectorConst
BasicBCVectorConst(double scale, FTensor::Tensor1< double, 3 > t_vec)
Definition: BasicBoundaryConditionsInterface.hpp:40
GenericElementInterface::IM
@ IM
Definition: GenericElementInterface.hpp:16
BasicBoundaryConditionsInterface::isQuasiStatic
bool isQuasiStatic
Definition: BasicBoundaryConditionsInterface.hpp:84
BasicBoundaryConditionsInterface::mField
MoFEM::Interface & mField
Definition: BasicBoundaryConditionsInterface.hpp:68
MoFEM::DMMoFEMTSSetRHSJacobian
PetscErrorCode DMMoFEMTSSetRHSJacobian(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS the right hand side jacobian
Definition: DMMoFEM.cpp:922
KelvinVoigtDamper::ConstitutiveEquation< adouble >
scale
double scale
Definition: plastic.cpp:119
BasicBoundaryConditionsInterface::snesLambdaLoadFactorPtr
double * snesLambdaLoadFactorPtr
Definition: BasicBoundaryConditionsInterface.hpp:71
GenericElementInterface::EX
@ EX
Definition: GenericElementInterface.hpp:16
MoFEM::DMMoFEMAddElement
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
Definition: DMMoFEM.cpp:497
BasicBoundaryConditionsInterface::setupSolverJacobianSNES
MoFEMErrorCode setupSolverJacobianSNES() override
Definition: BasicBoundaryConditionsInterface.hpp:584
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
BasicBoundaryConditionsInterface::BasicBCVectorScale::BasicBCVectorScale
BasicBCVectorScale(double scale, std::string file_name)
Definition: BasicBoundaryConditionsInterface.hpp:56
BasicBoundaryConditionsInterface::dM
SmartPetscObj< DM > dM
Definition: BasicBoundaryConditionsInterface.hpp:69
BasicBoundaryConditionsInterface::setOperators
MoFEMErrorCode setOperators() override
Definition: BasicBoundaryConditionsInterface.hpp:208
MetaNodalForces::setOperators
static MoFEMErrorCode setOperators(MoFEM::Interface &m_field, boost::ptr_map< std::string, NodalForce > &nodal_forces, Vec F, const std::string field_name)
Set integration point operators.
Definition: NodalForce.hpp:128
BasicBoundaryConditionsInterface::positionField
string positionField
Definition: BasicBoundaryConditionsInterface.hpp:90
BasicBoundaryConditionsInterface::isLinear
bool isLinear
Definition: BasicBoundaryConditionsInterface.hpp:86
MoFEM::CoreInterface::add_ents_to_finite_element_by_type
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
bool
BasicBoundaryConditionsInterface::meshNodeField
string meshNodeField
Definition: BasicBoundaryConditionsInterface.hpp:91
FEMethod
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
BasicBoundaryConditionsInterface::edge_forces
boost::ptr_map< std::string, EdgeForce > edge_forces
Definition: BasicBoundaryConditionsInterface.hpp:95
MoFEM::CoreInterface::add_finite_element
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
GenericElementInterface
Set of functions declaring elements and setting operators for generic element interface.
Definition: GenericElementInterface.hpp:13
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
MoFEM::DMMoFEMTSSetIJacobian
PetscErrorCode DMMoFEMTSSetIJacobian(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS Jacobian evaluation function
Definition: DMMoFEM.cpp:853
BasicBoundaryConditionsInterface::BasicBCVectorConst
Definition: BasicBoundaryConditionsInterface.hpp:39
MoFEM::CoreInterface::modify_finite_element_add_field_col
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_row)=0
set field col which finite element use
MetaNeumannForces::setMomentumFluxOperators
static MoFEMErrorCode setMomentumFluxOperators(MoFEM::Interface &m_field, boost::ptr_map< std::string, NeumannForcesSurface > &neumann_forces, Vec F, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
Set operators to finite elements calculating right hand side vector.
Definition: SurfacePressure.cpp:2069
BoundaryEleOp
MoFEM::DMMoFEMTSSetI2Jacobian
PetscErrorCode DMMoFEMTSSetI2Jacobian(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS Jacobian evaluation function
Definition: DMMoFEM.cpp:1017
TimeForceScale
Force scale operator for reading two columns.
Definition: TimeForceScale.hpp:18
MoFEM::DMMoFEMTSSetI2Function
PetscErrorCode DMMoFEMTSSetI2Function(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS implicit function evaluation function
Definition: DMMoFEM.cpp:975
BasicBoundaryConditionsInterface::isDisplacementField
bool isDisplacementField
Definition: BasicBoundaryConditionsInterface.hpp:83
is_quasi_static
PetscBool is_quasi_static
Definition: plastic.cpp:139
BasicBoundaryConditionsInterface::addElementsToDM
MoFEMErrorCode addElementsToDM(SmartPetscObj< DM > dm) override
Definition: BasicBoundaryConditionsInterface.hpp:405
simple
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
double
convert.type
type
Definition: convert.py:64
BasicBoundaryConditionsInterface::setupSolverFunction
MoFEMErrorCode setupSolverFunction(const TSType type=IM)
Definition: BasicBoundaryConditionsInterface.hpp:441
MoFEM::GAUSS
@ GAUSS
Definition: FormsIntegrators.hpp:136
MethodForForceScaling
Class used to scale loads, f.e. in arc-length control.
Definition: MethodForForceScaling.hpp:11
MoFEM::DMMoFEMSNESSetJacobian
PetscErrorCode DMMoFEMSNESSetJacobian(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set SNES Jacobian evaluation function
Definition: DMMoFEM.cpp:759
BasicBoundaryConditionsInterface::LoadScale::LoadScale
LoadScale(double *my_lambda)
Definition: BasicBoundaryConditionsInterface.hpp:75
BasicBoundaryConditionsInterface::domainProblemName
const string domainProblemName
Definition: BasicBoundaryConditionsInterface.hpp:109
MoFEM::DMoFEMPreProcessFiniteElements
PetscErrorCode DMoFEMPreProcessFiniteElements(DM dm, MoFEM::FEMethod *method)
execute finite element method for each element in dm (problem)
Definition: DMMoFEM.cpp:546
BasicBoundaryConditionsInterface::isPartitioned
bool isPartitioned
Definition: BasicBoundaryConditionsInterface.hpp:85
MoFEM::BasicMethod
Data structure to exchange data between mofem and User Loop Methods.
Definition: LoopMethods.hpp:183
GenericElementInterface::IM2
@ IM2
Definition: GenericElementInterface.hpp:16
MoFEM::AddFluxToRhsPipelineImpl
Definition: Natural.hpp:46
GenericElementInterface::mBoundaryMarker
BcMarkerPtr mBoundaryMarker
Definition: GenericElementInterface.hpp:20
MoFEM::TimeScaleVector
Force scale operator for reading four columns (time and vector)
Definition: ScalingMethod.hpp:97
MoFEM::CoreInterface::modify_finite_element_add_field_data
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
BasicBoundaryConditionsInterface::DomainNaturalBC
NaturalBC< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS > DomainNaturalBC
Definition: BasicBoundaryConditionsInterface.hpp:30
BiLinearForm
FaceElementForcesAndSourcesCore
FTensor::Index< 'i', 3 >
BasicBoundaryConditionsInterface::addElementFields
MoFEMErrorCode addElementFields() override
Definition: BasicBoundaryConditionsInterface.hpp:148
BasicBoundaryConditionsInterface::bodyForceLhsPtr
boost::shared_ptr< VolumeElementForcesAndSourcesCore > bodyForceLhsPtr
Definition: BasicBoundaryConditionsInterface.hpp:103
MetaEdgeForces::addElement
static MoFEMErrorCode addElement(MoFEM::Interface &m_field, const std::string field_name, Range *intersect_ptr=NULL)
Add element taking information from NODESET.
Definition: EdgeForce.hpp:62
Range
MoFEM::DMMoFEMTSSetRHSFunction
PetscErrorCode DMMoFEMTSSetRHSFunction(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS the right hand side function
Definition: DMMoFEM.cpp:882
DomainEleOp
BasicBoundaryConditionsInterface::springLhsPtr
boost::shared_ptr< FaceElementForcesAndSourcesCore > springLhsPtr
Definition: BasicBoundaryConditionsInterface.hpp:100
MetaSpringBC::setSpringOperators
static MoFEMErrorCode setSpringOperators(MoFEM::Interface &m_field, boost::shared_ptr< FaceElementForcesAndSourcesCore > fe_spring_lhs_ptr, boost::shared_ptr< FaceElementForcesAndSourcesCore > fe_spring_rhs_ptr, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS", double stiffness_scale=1.)
Implementation of spring element. Set operators to calculate LHS and RHS.
Definition: SpringElement.cpp:1178
MF_ZERO
@ MF_ZERO
Definition: definitions.h:111
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
BasicBoundaryConditionsInterface::LoadScale::lAmbda
double * lAmbda
Definition: BasicBoundaryConditionsInterface.hpp:74
_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
Definition: MeshsetsManager.hpp:71
BasicBoundaryConditionsInterface::postProcessElement
MoFEMErrorCode postProcessElement(int step) override
Definition: BasicBoundaryConditionsInterface.hpp:427
BasicBoundaryConditionsInterface::bIt
BitRefLevel bIt
Definition: BasicBoundaryConditionsInterface.hpp:88
BasicBoundaryConditionsInterface::LoadScale
Definition: BasicBoundaryConditionsInterface.hpp:73
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
BLOCKSET
@ BLOCKSET
Definition: definitions.h:161
BasicBoundaryConditionsInterface::BasicBCVectorConst::sCale
double sCale
Definition: BasicBoundaryConditionsInterface.hpp:50
approx_order
int approx_order
Definition: test_broken_space.cpp:50
BasicBoundaryConditionsInterface::setupSolverFunctionTS
MoFEMErrorCode setupSolverFunctionTS(const TSType type) override
Definition: BasicBoundaryConditionsInterface.hpp:590
BasicBoundaryConditionsInterface::dirichletBcPtr
boost::shared_ptr< DirichletDisplacementBc > dirichletBcPtr
Definition: BasicBoundaryConditionsInterface.hpp:106
BasicBoundaryConditionsInterface::springRhsPtr
boost::shared_ptr< FaceElementForcesAndSourcesCore > springRhsPtr
Definition: BasicBoundaryConditionsInterface.hpp:99
MoFEM::DMMoFEMTSSetIFunction
PetscErrorCode DMMoFEMTSSetIFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set TS implicit function evaluation function
Definition: DMMoFEM.cpp:800
GenericElementInterface::TSType
TSType
Definition: GenericElementInterface.hpp:16
MoFEM::PetscOptionsGetString
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
Definition: DeprecatedPetsc.hpp:172
sdf_hertz_2d_axisymm_plane.d
float d
Definition: sdf_hertz_2d_axisymm_plane.py:4
BasicBoundaryConditionsInterface::LoadScale::scaleNf
MoFEMErrorCode scaleNf(const FEMethod *fe, VectorDouble &nf)
Definition: BasicBoundaryConditionsInterface.hpp:76
BasicBoundaryConditionsInterface::getHistoryParam
string getHistoryParam(string prefix)
Definition: BasicBoundaryConditionsInterface.hpp:429
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
BasicBoundaryConditionsInterface::OpBodyForce
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 3 > OpBodyForce
Definition: BasicBoundaryConditionsInterface.hpp:28
BasicBoundaryConditionsInterface::updateElementVariables
MoFEMErrorCode updateElementVariables() override
Definition: BasicBoundaryConditionsInterface.hpp:426
BasicBoundaryConditionsInterface::fluidPressureElementPtr
boost::shared_ptr< FluidPressure > fluidPressureElementPtr
Definition: BasicBoundaryConditionsInterface.hpp:97
MoFEM::Types::BitRefLevel
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
BasicBoundaryConditionsInterface::~BasicBoundaryConditionsInterface
~BasicBoundaryConditionsInterface()
Definition: BasicBoundaryConditionsInterface.hpp:130
BasicBoundaryConditionsInterface::createElements
MoFEMErrorCode createElements() override
Definition: BasicBoundaryConditionsInterface.hpp:150
convert.int
int
Definition: convert.py:64
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
BasicBoundaryConditionsInterface::BasicBCVectorScale::getVector
FTensor::Tensor1< double, 3 > getVector(const double time)
Definition: BasicBoundaryConditionsInterface.hpp:59
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
BasicBoundaryConditionsInterface::OpInertiaForce
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, 3, 1 > OpInertiaForce
Definition: BasicBoundaryConditionsInterface.hpp:37
BasicBoundaryConditionsInterface::bodyForceRhsPtr
boost::shared_ptr< VolumeElementForcesAndSourcesCore > bodyForceRhsPtr
Definition: BasicBoundaryConditionsInterface.hpp:102
MetaSpringBC::addSpringElements
static MoFEMErrorCode addSpringElements(MoFEM::Interface &m_field, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
Declare spring element.
Definition: SpringElement.cpp:1127
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MOFEM_INVALID_DATA
@ MOFEM_INVALID_DATA
Definition: definitions.h:36
MoFEM::BcManagerImplTools::get_adj_ents
auto get_adj_ents(moab::Interface &moab, const Range &ents)
Definition: BcManager.cpp:17
BasicBoundaryConditionsInterface::BasicBCVectorScale
Definition: BasicBoundaryConditionsInterface.hpp:54
BasicBoundaryConditionsInterface::setupSolverFunctionSNES
MoFEMErrorCode setupSolverFunctionSNES() override
Definition: BasicBoundaryConditionsInterface.hpp:579
BasicBoundaryConditionsInterface::getCommandLineParameters
MoFEMErrorCode getCommandLineParameters() override
Definition: BasicBoundaryConditionsInterface.hpp:132
MoFEM::DMMoFEMSNESSetFunction
PetscErrorCode DMMoFEMSNESSetFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set SNES residual evaluation function
Definition: DMMoFEM.cpp:718
MoFEM::TimeScaleVector::getVector
virtual FTensor::Tensor1< double, SPACE_DIM > getVector(const double time)
Definition: ScalingMethod.cpp:220
MetaEdgeForces::setOperators
static MoFEMErrorCode setOperators(MoFEM::Interface &m_field, boost::ptr_map< std::string, EdgeForce > &edge_forces, Vec F, const std::string field_name, std::string mesh_node_positions="MESH_NODE_POSITIONS")
Set integration point operators.
Definition: EdgeForce.hpp:97
MoFEM::PetscOptionsGetBool
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:182