v0.14.0
Public Member Functions | Protected Attributes | List of all members
MoFEM::EssentialPreProc< TemperatureCubitBcData > Struct Reference

Specialization for TemperatureCubitBcData. More...

#include <src/boundary_conditions/EssentialTemperatureCubitBcData.hpp>

Collaboration diagram for MoFEM::EssentialPreProc< TemperatureCubitBcData >:
[legend]

Public Member Functions

 EssentialPreProc (MoFEM::Interface &m_field, boost::shared_ptr< FEMethod > fe_ptr, std::vector< boost::shared_ptr< ScalingMethod >> smv)
 
MoFEMErrorCode operator() ()
 

Protected Attributes

MoFEM::InterfacemField
 
boost::weak_ptr< FEMethodfePtr
 
VecOfTimeScalingMethods vecOfTimeScalingMethods
 

Detailed Description

Specialization for TemperatureCubitBcData.

Specialization to enforce blocksets which TemperatureCubitBcData ptr. That is to enforce constrains on temperature. set

Template Parameters
Examples
poisson_2d_homogeneous.cpp.

Definition at line 91 of file EssentialTemperatureCubitBcData.hpp.

Constructor & Destructor Documentation

◆ EssentialPreProc()

MoFEM::EssentialPreProc< TemperatureCubitBcData >::EssentialPreProc ( MoFEM::Interface m_field,
boost::shared_ptr< FEMethod fe_ptr,
std::vector< boost::shared_ptr< ScalingMethod >>  smv 
)

Definition at line 15 of file EssentialTemperatureCubitBcData.cpp.

18  : mField(m_field), fePtr(fe_ptr), vecOfTimeScalingMethods(smv) {}

Member Function Documentation

◆ operator()()

Definition at line 20 of file EssentialTemperatureCubitBcData.cpp.

20  {
22 
23  if (auto fe_method_ptr = fePtr.lock()) {
24 
25  auto bc_mng = mField.getInterface<BcManager>();
26  auto fb = mField.getInterface<FieldBlas>();
27  const auto problem_name = fe_method_ptr->problemPtr->getName();
28 
29  for (auto bc : bc_mng->getBcMapByBlockName()) {
30  if (auto temp_bc = bc.second->tempBcPtr) {
31 
32  auto &bc_id = bc.first;
33 
34  auto regex_str = (boost::format("%s_(.*)") % problem_name).str();
35  if (std::regex_match(bc_id, std::regex(regex_str))) {
36 
37  auto [field_name, block_name] =
38  BcManager::extractStringFromBlockId(bc_id, problem_name);
39 
40  MOFEM_LOG("WORLD", Sev::noisy)
41  << "Apply EssentialPreProc<TemperatureCubitBcData>: "
42  << problem_name << "_" << field_name << "_" << block_name;
43 
44  auto verts = bc.second->bcEnts.subset_by_type(MBVERTEX);
45  auto v = temp_bc->data.value1;
46  for (auto s : vecOfTimeScalingMethods) {
47  v *= s->getScale(fe_method_ptr->ts_t);
48  }
49 
50  auto lambda = [&](boost::shared_ptr<FieldEntity> field_entity_ptr) {
52  for (auto &d : field_entity_ptr->getEntFieldData())
53  d = v;
55  };
56  CHKERR fb->fieldLambdaOnEntities(lambda, field_name, &verts);
57  }
58  }
59  }
60 
61  } else {
62  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
63  "Can not lock shared pointer");
64  }
65 
67 }

Member Data Documentation

◆ fePtr

boost::weak_ptr<FEMethod> MoFEM::EssentialPreProc< TemperatureCubitBcData >::fePtr
protected

Definition at line 100 of file EssentialTemperatureCubitBcData.hpp.

◆ mField

Definition at line 99 of file EssentialTemperatureCubitBcData.hpp.

◆ vecOfTimeScalingMethods

Definition at line 101 of file EssentialTemperatureCubitBcData.hpp.


The documentation for this struct was generated from the following files:
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
MoFEM::BcManager::extractStringFromBlockId
static std::pair< std::string, std::string > extractStringFromBlockId(const std::string block_id, const std::string prb_name)
Extract block name and block name form block id.
Definition: BcManager.cpp:1389
MoFEM::EssentialPreProc< TemperatureCubitBcData >::fePtr
boost::weak_ptr< FEMethod > fePtr
Definition: EssentialTemperatureCubitBcData.hpp:100
MoFEM::EssentialPreProc< TemperatureCubitBcData >::mField
MoFEM::Interface & mField
Definition: EssentialTemperatureCubitBcData.hpp:99
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
lambda
static double lambda
Definition: incompressible_elasticity.cpp:199
MoFEM::EssentialPreProc< TemperatureCubitBcData >::vecOfTimeScalingMethods
VecOfTimeScalingMethods vecOfTimeScalingMethods
Definition: EssentialTemperatureCubitBcData.hpp:101
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
sdf_hertz_2d_axisymm_plane.d
float d
Definition: sdf_hertz_2d_axisymm_plane.py:4
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346