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 187 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 197 of file ThermoElasticOps.hpp.

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

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