v0.15.0
Loading...
Searching...
No Matches
BasicBoundaryConditionsInterface Struct Reference

Set of functions declaring elements and setting operators for basic boundary conditions interface. More...

#include "users_modules/basic_finite_elements/src/BasicBoundaryConditionsInterface.hpp"

Inheritance diagram for BasicBoundaryConditionsInterface:
[legend]
Collaboration diagram for BasicBoundaryConditionsInterface:
[legend]

Classes

struct  BasicBCVectorConst
 
struct  BasicBCVectorScale
 
struct  LoadScale
 

Public Types

using DomainEle = VolumeElementForcesAndSourcesCore
 
using DomainEleOp = DomainEle::UserDataOperator
 
using BoundaryEle = FaceElementForcesAndSourcesCore
 
using BoundaryEleOp = BoundaryEle::UserDataOperator
 
using OpBodyForce
 
using DomainNaturalBC
 
using OpBodyForceVector
 
using OpMass
 
using OpInertiaForce
 
- Public Types inherited from GenericElementInterface
enum  TSType {
  EX , IM , IM2 , IMEX ,
  DEFAULT , EX , IM , IM2 ,
  IMEX , DEFAULT
}
 
enum  TSType {
  EX , IM , IM2 , IMEX ,
  DEFAULT , EX , IM , IM2 ,
  IMEX , DEFAULT
}
 
using BcMarkerPtr = boost::shared_ptr<std::vector<char unsigned>>
 

Public Member Functions

 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)
 
 ~BasicBoundaryConditionsInterface ()
 
MoFEMErrorCode getCommandLineParameters () override
 
MoFEMErrorCode addElementFields () override
 
MoFEMErrorCode createElements () override
 
MoFEMErrorCode setOperators () override
 
MoFEMErrorCode addElementsToDM (SmartPetscObj< DM > dm) override
 
MoFEMErrorCode updateElementVariables () override
 
MoFEMErrorCode postProcessElement (int step) override
 
string getHistoryParam (string prefix)
 
template<typename T >
MoFEMErrorCode setupSolverFunction (const TSType type=IM)
 
template<typename T >
MoFEMErrorCode setupSolverJacobian (const TSType type=IM)
 
template<typename T , bool RHS>
MoFEMErrorCode setupSolverImpl (const TSType type=IM)
 
MoFEMErrorCode setupSolverFunctionSNES () override
 
MoFEMErrorCode setupSolverJacobianSNES () override
 
MoFEMErrorCode setupSolverFunctionTS (const TSType type) override
 
MoFEMErrorCode setupSolverJacobianTS (const TSType type) override
 
- Public Member Functions inherited from GenericElementInterface
 GenericElementInterface ()
 
virtual ~GenericElementInterface ()
 
virtual MoFEMErrorCode setGlobalBoundaryMarker (BcMarkerPtr mark)
 
virtual BcMarkerPtr getGlobalBoundaryMarker ()
 
virtual MoFEMErrorCode setMonitorPtr (boost::shared_ptr< MoFEM::FEMethod > monitor_ptr)
 
virtual BitRefLevel getBitRefLevel ()
 
virtual BitRefLevel getBitRefLevelMask ()
 
virtual MoFEMErrorCode opFactoryDomainRhs (boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip)
 
virtual MoFEMErrorCode opFactoryDomainLhs (boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip)
 
virtual MoFEMErrorCode setUpdateElementVariablesOperators ()
 
virtual MoFEMErrorCode updateElementVariables (SmartPetscObj< DM > dm, string fe_name)
 
virtual MoFEMErrorCode postProcessElement (int step, SmartPetscObj< DM > dm, string fe_name)
 
 GenericElementInterface ()
 
virtual ~GenericElementInterface ()
 
virtual MoFEMErrorCode setGlobalBoundaryMarker (BcMarkerPtr mark)
 
virtual BcMarkerPtr getGlobalBoundaryMarker ()
 
virtual MoFEMErrorCode setMonitorPtr (boost::shared_ptr< FEMethod > monitor_ptr)
 
virtual BitRefLevel getBitRefLevel ()
 
virtual BitRefLevel getBitRefLevelMask ()
 
virtual MoFEMErrorCode opFactoryDomainRhs (boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip)
 
virtual MoFEMErrorCode opFactoryDomainLhs (boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip)
 
virtual MoFEMErrorCode setUpdateElementVariablesOperators ()
 
virtual MoFEMErrorCode updateElementVariables (SmartPetscObj< DM > dm, string fe_name)
 
virtual MoFEMErrorCode postProcessElement (int step, SmartPetscObj< DM > dm, string fe_name)
 

Public Attributes

MoFEM::InterfacemField
 
SmartPetscObj< DM > dM
 
doublesnesLambdaLoadFactorPtr
 
bool isDisplacementField
 
bool isQuasiStatic
 
bool isPartitioned
 
bool isLinear
 
BitRefLevel bIt
 
string positionField
 
string meshNodeField
 
boost::ptr_map< std::string, NeumannForcesSurfaceneumann_forces
 
boost::ptr_map< std::string, NodalForcenodal_forces
 
boost::ptr_map< std::string, EdgeForceedge_forces
 
boost::shared_ptr< FluidPressurefluidPressureElementPtr
 
boost::shared_ptr< FaceElementForcesAndSourcesCorespringRhsPtr
 
boost::shared_ptr< FaceElementForcesAndSourcesCorespringLhsPtr
 
boost::shared_ptr< VolumeElementForcesAndSourcesCore > bodyForceRhsPtr
 
boost::shared_ptr< VolumeElementForcesAndSourcesCore > bodyForceLhsPtr
 
boost::shared_ptr< DirichletDisplacementBcdirichletBcPtr
 
boost::shared_ptr< KelvinVoigtDamperdamperElementPtr
 
const string domainProblemName
 
const string domainElementName
 
- Public Attributes inherited from GenericElementInterface
BcMarkerPtr mBoundaryMarker
 
int atomTest
 
int restartRunStep
 
boost::shared_ptr< MoFEM::FEMethodmonitorPtr
 
boost::shared_ptr< FEMethodmonitorPtr
 

Detailed Description

Set of functions declaring elements and setting operators for basic boundary conditions interface.

Definition at line 20 of file BasicBoundaryConditionsInterface.hpp.

Member Typedef Documentation

◆ BoundaryEle

◆ BoundaryEleOp

using BasicBoundaryConditionsInterface::BoundaryEleOp = BoundaryEle::UserDataOperator

Definition at line 25 of file BasicBoundaryConditionsInterface.hpp.

◆ DomainEle

using BasicBoundaryConditionsInterface::DomainEle = VolumeElementForcesAndSourcesCore

Definition at line 22 of file BasicBoundaryConditionsInterface.hpp.

◆ DomainEleOp

using BasicBoundaryConditionsInterface::DomainEleOp = DomainEle::UserDataOperator

Definition at line 23 of file BasicBoundaryConditionsInterface.hpp.

◆ DomainNaturalBC

Initial value:
NaturalBC<DomainEleOp>::Assembly<PETSC>::LinearForm<GAUSS>

Definition at line 29 of file BasicBoundaryConditionsInterface.hpp.

◆ OpBodyForce

Initial value:
FormsIntegrators<DomainEleOp>::Assembly<

Definition at line 27 of file BasicBoundaryConditionsInterface.hpp.

◆ OpBodyForceVector

◆ OpInertiaForce

Initial value:
FormsIntegrators<DomainEleOp>::Assembly<

Definition at line 36 of file BasicBoundaryConditionsInterface.hpp.

◆ OpMass

Constructor & Destructor Documentation

◆ 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 )
inline

Definition at line 115 of file BasicBoundaryConditionsInterface.hpp.

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) {}
PetscBool is_quasi_static
Definition plastic.cpp:143

◆ ~BasicBoundaryConditionsInterface()

BasicBoundaryConditionsInterface::~BasicBoundaryConditionsInterface ( )
inline

Definition at line 130 of file BasicBoundaryConditionsInterface.hpp.

130{}

Member Function Documentation

◆ addElementFields()

MoFEMErrorCode BasicBoundaryConditionsInterface::addElementFields ( )
inlineoverridevirtual

Implements GenericElementInterface.

Definition at line 148 of file BasicBoundaryConditionsInterface.hpp.

148{ return 0;};

◆ addElementsToDM()

MoFEMErrorCode BasicBoundaryConditionsInterface::addElementsToDM ( SmartPetscObj< DM > dm)
inlineoverridevirtual

Implements GenericElementInterface.

Definition at line 405 of file BasicBoundaryConditionsInterface.hpp.

405 {
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 };
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition acoustic.cpp:69
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
Definition DMMoFEM.cpp:488
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.

◆ createElements()

MoFEMErrorCode BasicBoundaryConditionsInterface::createElements ( )
inlineoverridevirtual

Implements GenericElementInterface.

Definition at line 150 of file BasicBoundaryConditionsInterface.hpp.

150 {
152
158
160 dirichletBcPtr = boost::make_shared<DirichletSpatialRemoveDofsBc>(
162 "DISPLACEMENT", isPartitioned);
163 else
164 dirichletBcPtr = boost::make_shared<DirichletDisplacementRemoveDofsBc>(
165 mField, positionField, domainProblemName, "DISPLACEMENT",
167 // CHKERR dynamic_cast<DirichletDisplacementRemoveDofsBc &>(
168 // *dirichletBcPtr).iNitialize();
169
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 };
@ MF_ZERO
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
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
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
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
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
MoFEMErrorCode addHOOpsFace3D(const std::string field, E &e, bool hcurl, bool hdiv)
boost::shared_ptr< FluidPressure > fluidPressureElementPtr
boost::shared_ptr< KelvinVoigtDamper > damperElementPtr
boost::shared_ptr< DirichletDisplacementBc > dirichletBcPtr
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
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.
static MoFEMErrorCode addElement(MoFEM::Interface &m_field, const std::string field_name, Range *intersect_ptr=NULL)
Add element taking information from NODESET.
static MoFEMErrorCode addSpringElements(MoFEM::Interface &m_field, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
Declare spring element.

◆ getCommandLineParameters()

MoFEMErrorCode BasicBoundaryConditionsInterface::getCommandLineParameters ( )
inlineoverridevirtual

Reimplemented from GenericElementInterface.

Definition at line 132 of file BasicBoundaryConditionsInterface.hpp.

132 {
134
135 PetscBool quasi_static = PETSC_FALSE;
136 PetscBool is_linear = PETSC_FALSE;
137 CHKERR PetscOptionsGetBool(PETSC_NULLPTR, "-is_quasi_static", &quasi_static,
138 PETSC_NULLPTR);
139 CHKERR PetscOptionsGetBool(PETSC_NULLPTR, "-is_linear", &is_linear,
140 PETSC_NULLPTR);
141
142 isQuasiStatic = quasi_static;
143 isLinear = is_linear;
144
146 };
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)

◆ getHistoryParam()

string BasicBoundaryConditionsInterface::getHistoryParam ( string prefix)
inline

Definition at line 429 of file BasicBoundaryConditionsInterface.hpp.

429 {
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_NULLPTR, PETSC_NULLPTR, 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 };
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)

◆ postProcessElement()

MoFEMErrorCode BasicBoundaryConditionsInterface::postProcessElement ( int step)
inlineoverridevirtual

Implements GenericElementInterface.

Definition at line 427 of file BasicBoundaryConditionsInterface.hpp.

427{ return 0; };

◆ setOperators()

MoFEMErrorCode BasicBoundaryConditionsInterface::setOperators ( )
inlineoverridevirtual

Implements GenericElementInterface.

Definition at line 208 of file BasicBoundaryConditionsInterface.hpp.

208 {
214
216 mField, neumann_forces, PETSC_NULLPTR, 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
227
228
229 fluidPressureElementPtr->setNeumannFluidPressureFiniteElementOperators(
230 positionField, PETSC_NULLPTR, 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_NULLPTR, PETSC_NULLPTR,
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_NULLPTR, PETSC_NULLPTR,
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
329 DomainNaturalBC::AddFluxToPipeline<OpBodyForceVector>::add(
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 SETERRQ(
350 PETSC_COMM_SELF, MOFEM_INVALID_DATA,
351 "There should be (1 density + 3 accelerations ) attributes in "
352 "BODY_FORCE blockset, but is %ld. 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,
378 CHKERR bc_mng->removeBlockDOFsOnEntities(domainProblemName, "REMOVE_Y",
379 positionField, 1, 1, true,
381 CHKERR bc_mng->removeBlockDOFsOnEntities(domainProblemName, "REMOVE_Z",
382 positionField, 2, 2, true,
384 CHKERR bc_mng->removeBlockDOFsOnEntities(domainProblemName, "REMOVE_ALL",
385 positionField, 0, 2, true,
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 };
@ BLOCKSET
@ MOFEM_INVALID_DATA
Definition definitions.h:36
#define MOFEM_LOG(channel, severity)
Log.
#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.
auto get_adj_ents(moab::Interface &moab, const Range &ents)
Definition BcManager.cpp:17
MoFEMErrorCode addHOOpsVol(const std::string field, E &e, bool h1, bool hcurl, bool hdiv, bool l2)
static constexpr int approx_order
boost::shared_ptr< FaceElementForcesAndSourcesCore > springLhsPtr
boost::shared_ptr< VolumeElementForcesAndSourcesCore > bodyForceLhsPtr
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 3 > OpMass
boost::shared_ptr< FaceElementForcesAndSourcesCore > springRhsPtr
boost::ptr_map< std::string, EdgeForce > edge_forces
boost::ptr_map< std::string, NodalForce > nodal_forces
boost::ptr_map< std::string, NeumannForcesSurface > neumann_forces
boost::shared_ptr< VolumeElementForcesAndSourcesCore > bodyForceRhsPtr
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, 3, 1 > OpInertiaForce
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
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.
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.
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.
virtual moab::Interface & get_moab()=0

◆ setupSolverFunction()

template<typename T >
MoFEMErrorCode BasicBoundaryConditionsInterface::setupSolverFunction ( const TSType type = IM)
inline

Definition at line 441 of file BasicBoundaryConditionsInterface.hpp.

441 {
444 }
MoFEMErrorCode setupSolverImpl(const TSType type=IM)

◆ setupSolverFunctionSNES()

MoFEMErrorCode BasicBoundaryConditionsInterface::setupSolverFunctionSNES ( )
inlineoverridevirtual

Reimplemented from GenericElementInterface.

Definition at line 579 of file BasicBoundaryConditionsInterface.hpp.

579 {
583 }
MoFEMErrorCode setupSolverFunction(const TSType type=IM)

◆ setupSolverFunctionTS()

MoFEMErrorCode BasicBoundaryConditionsInterface::setupSolverFunctionTS ( const TSType type)
inlineoverridevirtual

Implements GenericElementInterface.

Definition at line 590 of file BasicBoundaryConditionsInterface.hpp.

590 {
594 }

◆ setupSolverImpl()

template<typename T , bool RHS>
MoFEMErrorCode BasicBoundaryConditionsInterface::setupSolverImpl ( const TSType type = IM)
inline

Definition at line 453 of file BasicBoundaryConditionsInterface.hpp.

453 {
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 *,
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(
484 new LoadScale(snesLambdaLoadFactorPtr));
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:
492 mit->second->getLoopFe().getOpPtrVector(), {},
494 break;
495 case 1:
497 mit->second->getLoopFe().getOpPtrVector(), {},
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,
548 &DMMoFEMSNESSetJacobian);
549
550 } else if constexpr (std::is_same_v<T, TS>) {
551
552 switch (type) {
553 case IM:
554 CHKERR set_solver_pipelines(&DMMoFEMTSSetIFunction,
555 &DMMoFEMTSSetIJacobian);
556 break;
557 case IM2:
558 CHKERR set_solver_pipelines(&DMMoFEMTSSetI2Function,
559 &DMMoFEMTSSetI2Jacobian);
560 break;
561 case EX:
562 CHKERR set_solver_pipelines(&DMMoFEMTSSetRHSFunction,
563 &DMMoFEMTSSetRHSJacobian);
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 }
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
PetscErrorCode DMoFEMPreProcessFiniteElements(DM dm, MoFEM::FEMethod *method)
execute finite element method for each element in dm (problem)
Definition DMMoFEM.cpp:536
Data structure to exchange data between mofem and User Loop Methods.
structure for User Loop Methods on finite elements
Force scale operator for reading two columns.

◆ setupSolverJacobian()

template<typename T >
MoFEMErrorCode BasicBoundaryConditionsInterface::setupSolverJacobian ( const TSType type = IM)
inline

Definition at line 447 of file BasicBoundaryConditionsInterface.hpp.

◆ setupSolverJacobianSNES()

MoFEMErrorCode BasicBoundaryConditionsInterface::setupSolverJacobianSNES ( )
inlineoverridevirtual

Reimplemented from GenericElementInterface.

Definition at line 584 of file BasicBoundaryConditionsInterface.hpp.

584 {
588 }
MoFEMErrorCode setupSolverJacobian(const TSType type=IM)

◆ setupSolverJacobianTS()

MoFEMErrorCode BasicBoundaryConditionsInterface::setupSolverJacobianTS ( const TSType type)
inlineoverridevirtual

Implements GenericElementInterface.

Definition at line 596 of file BasicBoundaryConditionsInterface.hpp.

596 {
600 }

◆ updateElementVariables()

MoFEMErrorCode BasicBoundaryConditionsInterface::updateElementVariables ( )
inlineoverridevirtual

Reimplemented from GenericElementInterface.

Definition at line 426 of file BasicBoundaryConditionsInterface.hpp.

426{ return 0; };

Member Data Documentation

◆ bIt

BitRefLevel BasicBoundaryConditionsInterface::bIt

Definition at line 88 of file BasicBoundaryConditionsInterface.hpp.

◆ bodyForceLhsPtr

boost::shared_ptr<VolumeElementForcesAndSourcesCore> BasicBoundaryConditionsInterface::bodyForceLhsPtr

Definition at line 103 of file BasicBoundaryConditionsInterface.hpp.

◆ bodyForceRhsPtr

boost::shared_ptr<VolumeElementForcesAndSourcesCore> BasicBoundaryConditionsInterface::bodyForceRhsPtr

Definition at line 102 of file BasicBoundaryConditionsInterface.hpp.

◆ damperElementPtr

boost::shared_ptr<KelvinVoigtDamper> BasicBoundaryConditionsInterface::damperElementPtr

Definition at line 107 of file BasicBoundaryConditionsInterface.hpp.

◆ dirichletBcPtr

boost::shared_ptr<DirichletDisplacementBc> BasicBoundaryConditionsInterface::dirichletBcPtr

Definition at line 106 of file BasicBoundaryConditionsInterface.hpp.

◆ dM

SmartPetscObj<DM> BasicBoundaryConditionsInterface::dM

Definition at line 69 of file BasicBoundaryConditionsInterface.hpp.

◆ domainElementName

const string BasicBoundaryConditionsInterface::domainElementName

Definition at line 110 of file BasicBoundaryConditionsInterface.hpp.

◆ domainProblemName

const string BasicBoundaryConditionsInterface::domainProblemName

Definition at line 109 of file BasicBoundaryConditionsInterface.hpp.

◆ edge_forces

boost::ptr_map<std::string, EdgeForce> BasicBoundaryConditionsInterface::edge_forces

Definition at line 95 of file BasicBoundaryConditionsInterface.hpp.

◆ fluidPressureElementPtr

boost::shared_ptr<FluidPressure> BasicBoundaryConditionsInterface::fluidPressureElementPtr

Definition at line 97 of file BasicBoundaryConditionsInterface.hpp.

◆ isDisplacementField

bool BasicBoundaryConditionsInterface::isDisplacementField

Definition at line 83 of file BasicBoundaryConditionsInterface.hpp.

◆ isLinear

bool BasicBoundaryConditionsInterface::isLinear

Definition at line 86 of file BasicBoundaryConditionsInterface.hpp.

◆ isPartitioned

bool BasicBoundaryConditionsInterface::isPartitioned

Definition at line 85 of file BasicBoundaryConditionsInterface.hpp.

◆ isQuasiStatic

bool BasicBoundaryConditionsInterface::isQuasiStatic

Definition at line 84 of file BasicBoundaryConditionsInterface.hpp.

◆ meshNodeField

string BasicBoundaryConditionsInterface::meshNodeField

Definition at line 91 of file BasicBoundaryConditionsInterface.hpp.

◆ mField

MoFEM::Interface& BasicBoundaryConditionsInterface::mField

Definition at line 68 of file BasicBoundaryConditionsInterface.hpp.

◆ neumann_forces

boost::ptr_map<std::string, NeumannForcesSurface> BasicBoundaryConditionsInterface::neumann_forces

Definition at line 93 of file BasicBoundaryConditionsInterface.hpp.

◆ nodal_forces

boost::ptr_map<std::string, NodalForce> BasicBoundaryConditionsInterface::nodal_forces

Definition at line 94 of file BasicBoundaryConditionsInterface.hpp.

◆ positionField

string BasicBoundaryConditionsInterface::positionField

Definition at line 90 of file BasicBoundaryConditionsInterface.hpp.

◆ snesLambdaLoadFactorPtr

double* BasicBoundaryConditionsInterface::snesLambdaLoadFactorPtr

Definition at line 71 of file BasicBoundaryConditionsInterface.hpp.

◆ springLhsPtr

boost::shared_ptr<FaceElementForcesAndSourcesCore> BasicBoundaryConditionsInterface::springLhsPtr

Definition at line 100 of file BasicBoundaryConditionsInterface.hpp.

◆ springRhsPtr

boost::shared_ptr<FaceElementForcesAndSourcesCore> BasicBoundaryConditionsInterface::springRhsPtr

Definition at line 99 of file BasicBoundaryConditionsInterface.hpp.


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