19 double &ambient_temperature,
20 boost::shared_ptr<Range> &ents,
26 auto cubit_meshset_ptr =
27 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(ms_id,
29 std::vector<double> block_data;
30 CHKERR cubit_meshset_ptr->getAttributes(block_data);
31 if (block_data.size() < 2) {
33 "Expected that convection block has two attributes (heat "
34 "transfer coefficient and ambient temperature)");
36 heat_transfer_coefficient = block_data[0];
37 ambient_temperature = block_data[1];
41 <<
"Heat transfer coefficient " << heat_transfer_coefficient;
43 <<
"Ambient temperature " << ambient_temperature;
45 ents = boost::make_shared<Range>();
47 m_field.
get_moab().get_entities_by_handle(cubit_meshset_ptr->meshset,
60template <AssemblyType A,
typename EleOp>
67 boost::shared_ptr<VectorDouble> t_ptr);
72 boost::shared_ptr<VectorDouble>
tPtr;
73 MoFEMErrorCode
iNtegrate(EntitiesFieldData::EntData &data);
76template <AssemblyType A,
typename EleOp>
83 std::string row_field_name, std::string col_field_name);
88 MoFEMErrorCode
iNtegrate(EntitiesFieldData::EntData &row_data,
89 EntitiesFieldData::EntData &col_data);
92template <AssemblyType A,
typename EleOp>
93OpFluxRhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>, 1, 1,
A, GAUSS,
96 boost::shared_ptr<VectorDouble> t_ptr)
100 this->heatTransferCoefficient, this->ambientTemperature,
101 this->entsPtr, m_field, ms_id, Sev::inform),
102 "Cannot read convection data from blockset");
105template <AssemblyType A,
typename EleOp>
108 GAUSS,
EleOp>::iNtegrate(EntitiesFieldData::EntData
113 auto t_w = OpBase::getFTensor0IntegrationWeight();
115 auto t_row_base = row_data.getFTensor0N();
118 auto t_temp = getFTensor0FromVec(*tPtr);
122 -t_w * heatTransferCoefficient * (t_temp - ambientTemperature);
137 auto t_normal = OpBase::getFTensor1Normal();
140 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
141 if (fe_type == MBTRI) {
148template <AssemblyType A,
typename EleOp>
149OpFluxLhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>, 1, 1,
A,
GAUSS,
151 std::string row_field_name,
152 std::string col_field_name)
153 :
OpBase(row_field_name, col_field_name,
OpBase::OPROWCOL) {
159 this->heatTransferCoefficient, this->ambientTemperature,
160 this->entsPtr, m_field, ms_id, Sev::verbose),
161 "Cannot read convection data from blockset");
164template <AssemblyType A,
typename EleOp>
168 EleOp>::iNtegrate(EntitiesFieldData::EntData &row_data,
169 EntitiesFieldData::EntData &col_data) {
173 auto t_w = OpBase::getFTensor0IntegrationWeight();
175 auto t_row_base = row_data.getFTensor0N();
181 const auto alpha = t_w * t_row_base;
183 auto t_col_base = col_data.getFTensor0N(gg, 0);
196 auto t_normal = OpBase::getFTensor1Normal();
201 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
202 if (fe_type == MBTRI) {
211struct AddFluxToRhsPipelineImpl<
221 static MoFEMErrorCode
add(
223 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
225 boost::shared_ptr<VectorDouble> u_ptr, std::string block_name, Sev sev
230 using OP = OpFluxRhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>,
233 auto add_op = [&](
auto &&meshset_vec_ptr) {
234 for (
auto m : meshset_vec_ptr) {
246 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
249 (boost::format(
"%s(.*)") % block_name).str()
258 "Handling of bc type not implemented");
267struct AddFluxToLhsPipelineImpl<
277 static MoFEMErrorCode
add(
279 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
281 std::string col_field_name, std::string block_name, Sev sev
286 using OP = OpFluxLhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>,
289 auto add_op = [&](
auto &&meshset_vec_ptr) {
290 for (
auto m : meshset_vec_ptr) {
293 new OP(m_field,
m->getMeshsetId(), row_field_name, col_field_name));
302 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
305 (boost::format(
"%s(.*)") % block_name).str()
314 "Handling of bc type not implemented");
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
CubitBC
Types of sets and boundary conditions.
@ MOFEM_DATA_INCONSISTENCY
#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 IntegrationType I
constexpr auto field_name
FTensor::Index< 'm', 3 > m
AddFluxToLhsPipelineImpl()=delete
static MoFEMErrorCode add(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, MoFEM::Interface &m_field, std::string row_field_name, std::string col_field_name, std::string block_name, Sev sev)
static MoFEMErrorCode add(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, MoFEM::Interface &m_field, std::string field_name, boost::shared_ptr< VectorDouble > u_ptr, std::string block_name, Sev sev)
AddFluxToRhsPipelineImpl()=delete
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
Deprecated interface functions.
VectorDouble locF
local entity vector
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points
MatrixDouble locMat
local entity block matrix
int nbCols
number if dof on column
int nbRowBaseFunctions
number or row base functions
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
double ambientTemperature
double heatTransferCoefficient
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
double ambientTemperature
double heatTransferCoefficient
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
boost::shared_ptr< VectorDouble > tPtr
static MoFEMErrorCode getParameters(double &heat_transfer_coefficient, double &ambient_temperature, boost::shared_ptr< Range > &ents, MoFEM::Interface &m_field, int ms_id, Sev sev)
GetConvectionParameters()=delete