v0.15.0
Loading...
Searching...
No Matches
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 191 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 201 of file ThermoElasticOps.hpp.

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

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