v0.14.0
Public Member Functions | Static Public Member Functions | List of all members
MoFEM::AddFluxToRhsPipelineImpl< MoFEM::OpFluxRhsImpl< ThermoElasticOps::SetTargetTemperature, 1, 1, A, I, OpBase >, A, I, OpBase > Struct Template Reference

#include <tutorials/adv-2/src/ThermoElasticOps.hpp>

Public Member Functions

 AddFluxToRhsPipelineImpl ()=delete
 

Static Public Member Functions

static MoFEMErrorCode add (boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, MoFEM::Interface &m_field, const std::string field_name, boost::shared_ptr< VectorDouble > temp_ptr, std::string block_name, Sev sev)
 

Detailed Description

template<AssemblyType A, IntegrationType I, typename OpBase>
struct MoFEM::AddFluxToRhsPipelineImpl< MoFEM::OpFluxRhsImpl< ThermoElasticOps::SetTargetTemperature, 1, 1, A, I, OpBase >, A, I, OpBase >

Definition at line 174 of file ThermoElasticOps.hpp.

Constructor & Destructor Documentation

◆ AddFluxToRhsPipelineImpl()

template<AssemblyType A, IntegrationType I, typename OpBase >
MoFEM::AddFluxToRhsPipelineImpl< MoFEM::OpFluxRhsImpl< ThermoElasticOps::SetTargetTemperature, 1, 1, A, I, OpBase >, A, I, OpBase >::AddFluxToRhsPipelineImpl ( )
delete

Member Function Documentation

◆ add()

template<AssemblyType A, IntegrationType I, typename OpBase >
static MoFEMErrorCode MoFEM::AddFluxToRhsPipelineImpl< MoFEM::OpFluxRhsImpl< ThermoElasticOps::SetTargetTemperature, 1, 1, A, I, OpBase >, A, I, OpBase >::add ( boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &  pipeline,
MoFEM::Interface m_field,
const std::string  field_name,
boost::shared_ptr< VectorDouble temp_ptr,
std::string  block_name,
Sev  sev 
)
inlinestatic

Definition at line 184 of file ThermoElasticOps.hpp.

190  {
192 
193  using OP_SOURCE = typename FormsIntegrators<OpBase>::template Assembly<
194  A>::template LinearForm<I>::template OpSource<1, 1>;
195  using OP_TEMP = typename FormsIntegrators<OpBase>::template Assembly<
196  A>::template LinearForm<I>::template OpBaseTimesScalar<1>;
197 
198  auto add_op = [&](auto &&meshset_vec_ptr) {
200  for (auto m : meshset_vec_ptr) {
201  std::vector<double> block_data;
202  m->getAttributes(block_data);
203  if (block_data.size() != 2) {
204  SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY,
205  "Expected two parameters");
206  }
207  double target_temperature = block_data[0];
208  double beta =
209  block_data[1]; // Set temperature parameter [ W/K * (1/m^3)]
210  auto ents_ptr = boost::make_shared<Range>();
211  CHKERR m_field.get_moab().get_entities_by_handle(m->meshset,
212  *(ents_ptr), true);
213 
214  MOFEM_TAG_AND_LOG("WORLD", sev, "SetTargetTemperature")
215  << "Add " << *m << " target temperature " << target_temperature
216  << " penalty " << beta;
217 
218  pipeline.push_back(new OP_SOURCE(
219  field_name,
220  [target_temperature, beta](double, double, double) {
221  return target_temperature * beta;
222  },
223  ents_ptr));
224  pipeline.push_back(new OP_TEMP(
225  field_name, temp_ptr,
226  [beta](double, double, double) { return -beta; }, ents_ptr));
227  }
229  };
230 
231  CHKERR add_op(
232 
233  m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
234 
235  (boost::format("%s(.*)") % block_name).str()
236 
237  ))
238 
239  );
240 
241  MOFEM_LOG_CHANNEL("WORLD");
242 
244  }

The documentation for this struct was generated from the following file:
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
MOFEM_LOG_CHANNEL
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
MOFEM_TAG_AND_LOG
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
Definition: LogManager.hpp:362
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359