v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
AddFluxToLhsPipelineImpl< OpFluxLhsImpl< 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

 AddFluxToLhsPipelineImpl ()=delete
 
 AddFluxToLhsPipelineImpl ()=delete
 

Static Public Member Functions

static MoFEMErrorCode add (boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, MoFEM::Interface &m_field, const std::string field_name, 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 AddFluxToLhsPipelineImpl< OpFluxLhsImpl< ThermoElasticOps::SetTargetTemperature, 1, 1, A, I, OpBase >, A, I, OpBase >

Definition at line 282 of file ThermoElasticOps.hpp.

Constructor & Destructor Documentation

◆ AddFluxToLhsPipelineImpl() [1/2]

template<AssemblyType A, IntegrationType I, typename OpBase >
AddFluxToLhsPipelineImpl< OpFluxLhsImpl< ThermoElasticOps::SetTargetTemperature, 1, 1, A, I, OpBase >, A, I, OpBase >::AddFluxToLhsPipelineImpl ( )
delete

◆ AddFluxToLhsPipelineImpl() [2/2]

template<AssemblyType A, IntegrationType I, typename OpBase >
AddFluxToLhsPipelineImpl< OpFluxLhsImpl< ThermoElasticOps::SetTargetTemperature, 1, 1, A, I, OpBase >, A, I, OpBase >::AddFluxToLhsPipelineImpl ( )
delete

Member Function Documentation

◆ add() [1/2]

template<AssemblyType A, IntegrationType I, typename OpBase >
static MoFEMErrorCode AddFluxToLhsPipelineImpl< OpFluxLhsImpl< 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 595 of file ThermoElasticOps.hpp.

601 {
603
604 using OP_MASS = typename FormsIntegrators<OpBase>::template Assembly<
606
607 auto add_op = [&](auto &&meshset_vec_ptr) {
609 for (auto m : meshset_vec_ptr) {
610 std::vector<double> block_data;
611 m->getAttributes(block_data);
612 if (block_data.size() != 2) {
613 SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY,
614 "Expected two parameters");
615 }
616 double beta =
617 block_data[1]; // Set temperature parameter [ W/K * (1/m^3)]
618 auto ents_ptr = boost::make_shared<Range>();
619 CHKERR m_field.get_moab().get_entities_by_handle(m->meshset,
620 *(ents_ptr), true);
621
622 MOFEM_TAG_AND_LOG("WORLD", sev, "SetTargetTemperature")
623 << "Add " << *m << " penalty " << beta;
624
625 pipeline.push_back(new OP_MASS(
627 [beta](double, double, double) { return -beta; }, ents_ptr));
628 }
630 };
631
632 CHKERR add_op(
633
634 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
635
636 (boost::format("%s(.*)") % block_name).str()
637
638 ))
639
640 );
641
642 MOFEM_LOG_CHANNEL("WORLD");
643
645 }
#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
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpMass
[Only used with Hooke equation (linear material model)]
Definition seepage.cpp:56
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 AddFluxToLhsPipelineImpl< OpFluxLhsImpl< 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,
std::string  block_name,
FEFun  fe_fun,
Sev  sev 
)
inlinestatic

Definition at line 291 of file ThermoElasticOps.hpp.

297 {
299
300 using OP_MASS = typename FormsIntegrators<OpBase>::template Assembly<
302
303 auto add_op = [&](auto &&meshset_vec_ptr) {
305 auto *json_config = m_field.getInterface<JsonConfigManager>();
306 for (auto m : meshset_vec_ptr) {
307 const auto params_from_json =
308 json_config->getParamsFromBlockset(block_name, m->getMeshsetId());
309 double beta = 0;
310 if (!params_from_json.empty()) {
311 beta = params_from_json.at("beta");
312 } else {
313 std::vector<double> block_data;
314 m->getAttributes(block_data);
315 if (block_data.size() != 2) {
316 SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY,
317 "Expected two parameters");
318 }
319 beta = block_data[1];
320 }
321 auto ents_ptr = boost::make_shared<Range>();
322 CHKERR m_field.get_moab().get_entities_by_handle(m->meshset,
323 *(ents_ptr), true);
324
325 MOFEM_TAG_AND_LOG("WORLD", sev, "SetTargetTemperature")
326 << "Add " << *m << " penalty " << beta;
327
328 auto op_mass = new OP_MASS(
330 [beta](double, double, double) { return beta; }, ents_ptr);
331 op_mass->feScalingFun = fe_fun;
332 pipeline.push_back(op_mass);
333 }
335 };
336
337 CHKERR add_op(
338
339 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
340
341 (boost::format("%s(.*)") % block_name).str()
342
343 ))
344
345 );
346
347 MOFEM_LOG_CHANNEL("WORLD");
348
350 }

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