v0.16.0
Loading...
Searching...
No Matches
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_thermo_elasticity/src/ThermoElasticOps.hpp"

Public Member Functions

 AddFluxToRhsPipelineImpl ()=delete
 
 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, FEFun fe_fun, Sev sev)
 
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 194 of file ThermoElasticOps.hpp.

Constructor & Destructor Documentation

◆ AddFluxToRhsPipelineImpl() [1/2]

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

◆ AddFluxToRhsPipelineImpl() [2/2]

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() [1/2]

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,
FEFun  fe_fun,
Sev  sev 
)
inlinestatic

Definition at line 204 of file ThermoElasticOps.hpp.

211 {
213
214 using OP_SOURCE = typename FormsIntegrators<OpBase>::template Assembly<
215 A>::template LinearForm<I>::template OpSource<1, 1>;
216 using OP_TEMP = typename FormsIntegrators<OpBase>::template Assembly<
217 A>::template LinearForm<I>::template OpBaseTimesScalar<1>;
218
219 auto add_op = [&](auto &&meshset_vec_ptr) {
221 auto *json_config = m_field.getInterface<JsonConfigManager>();
222 for (auto m : meshset_vec_ptr) {
223 const auto params_from_json =
224 json_config->getParamsFromBlockset(block_name, m->getMeshsetId());
225 double target_temperature = 0;
226 double beta = 0;
227 if (!params_from_json.empty()) {
228 target_temperature = params_from_json.at("target_temperature");
229 beta = params_from_json.at("beta");
230 } else {
231 std::vector<double> block_data;
232 m->getAttributes(block_data);
233 if (block_data.size() < 2) {
234 SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY,
235 "Expected two parameters");
236 }
237 target_temperature = block_data[0];
238 beta = block_data[1];
239 }
240 auto ents_ptr = boost::make_shared<Range>();
241 CHKERR m_field.get_moab().get_entities_by_handle(m->meshset,
242 *(ents_ptr), true);
243
244 MOFEM_TAG_AND_LOG("WORLD", sev, "SetTargetTemperature")
245 << "Add " << *m << " target temperature " << target_temperature
246 << " penalty " << beta;
247
248 auto op_source = new OP_SOURCE(
250 [target_temperature, beta](double, double, double) {
251 return target_temperature * beta;
252 },
253 ents_ptr);
254 op_source->feScalingFun = fe_fun;
255 pipeline.push_back(op_source);
256 auto op_temp = new OP_TEMP(
257 field_name, temp_ptr,
258 [beta](double, double, double) { return -beta; }, ents_ptr);
259 op_temp->feScalingFun = fe_fun;
260 pipeline.push_back(op_temp);
261 }
263 };
264
265 CHKERR add_op(
266
267 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
268
269 (boost::format("%s(.*)") % block_name).str()
270
271 ))
272
273 );
274
275 MOFEM_LOG_CHANNEL("WORLD");
276
278 }
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
constexpr AssemblyType A
constexpr auto field_name
FTensor::Index< 'm', 3 > m
virtual moab::Interface & get_moab()=0
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.

◆ add() [2/2]

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

528 {
530
531 using OP_SOURCE = typename FormsIntegrators<OpBase>::template Assembly<
532 A>::template LinearForm<I>::template OpSource<1, 1>;
533 using OP_TEMP = typename FormsIntegrators<OpBase>::template Assembly<
534 A>::template LinearForm<I>::template OpBaseTimesScalar<1>;
535
536 auto add_op = [&](auto &&meshset_vec_ptr) {
538 for (auto m : meshset_vec_ptr) {
539 std::vector<double> block_data;
540 m->getAttributes(block_data);
541 if (block_data.size() < 2) {
542 SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY,
543 "Expected two parameters");
544 }
545 double target_temperature = block_data[0];
546 double beta =
547 block_data[1]; // Set temperature parameter [ W/K * (1/m^3)]
548 auto ents_ptr = boost::make_shared<Range>();
549 CHKERR m_field.get_moab().get_entities_by_handle(m->meshset,
550 *(ents_ptr), true);
551
552 MOFEM_TAG_AND_LOG("WORLD", sev, "SetTargetTemperature")
553 << "Add " << *m << " target temperature " << target_temperature
554 << " penalty " << beta;
555
556 pipeline.push_back(new OP_SOURCE(
558 [target_temperature, beta](double, double, double) {
559 return target_temperature * beta;
560 },
561 ents_ptr));
562 pipeline.push_back(new OP_TEMP(
563 field_name, temp_ptr,
564 [beta](double, double, double) { return -beta; }, ents_ptr));
565 }
567 };
568
569 CHKERR add_op(
570
571 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
572
573 (boost::format("%s(.*)") % block_name).str()
574
575 ))
576
577 );
578
579 MOFEM_LOG_CHANNEL("WORLD");
580
582 }

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