13#ifndef __THERMAL_ELEMENT_HPP
14#define __THERMAL_ELEMENT_HPP
32 :
MoFEM::VolumeElementForcesAndSourcesCore(m_field) {}
99 std::map<int, BlockData>
110 std::map<int, FluxData>
123 std::map<int, ConvectionData>
138 std::map<int, RadiationData>
169 MoFEMErrorCode
doWork(
int side, EntityType type,
170 EntitiesFieldData::EntData &data);
176 template <
typename OP>
181 VectorDouble &field_at_gauss_pts)
190 MoFEMErrorCode
doWork(
int side, EntityType type,
191 EntitiesFieldData::EntData &data) {
195 if (data.getFieldData().size() == 0)
197 int nb_dofs = data.getFieldData().size();
198 int nb_gauss_pts = data.getN().size1();
202 if (type == MBVERTEX) {
209 for (
int gg = 0; gg < nb_gauss_pts; gg++) {
211 inner_prod(data.getN(gg, nb_dofs), data.getFieldData());
214 }
catch (
const std::exception &ex) {
215 std::ostringstream ss;
216 ss <<
"throw in method: " << ex.what() << std::endl;
233 field_name, common_data.temperatureAtGaussPts) {}
244 field_name, common_data.temperatureAtGaussPts) {}
255 field_name, common_data.temperatureRateAtGaussPts) {}
287 MoFEMErrorCode
doWork(
int side, EntityType type,
288 EntitiesFieldData::EntData &data);
320 MoFEMErrorCode
doWork(
int row_side,
int col_side, EntityType row_type,
322 EntitiesFieldData::EntData &row_data,
323 EntitiesFieldData::EntData &col_data);
347 MoFEMErrorCode
doWork(
int side, EntityType type,
348 EntitiesFieldData::EntData &data);
372 MoFEMErrorCode
doWork(
int row_side,
int col_side, EntityType row_type,
374 EntitiesFieldData::EntData &row_data,
375 EntitiesFieldData::EntData &col_data);
388 bool ho_geometry =
false)
395 bool ho_geometry =
false)
407 MoFEMErrorCode
doWork(
int side, EntityType type,
408 EntitiesFieldData::EntData &data);
425 CommonData &common_data,
bool ho_geometry =
false)
433 CommonData &common_data,
bool ho_geometry =
false)
447 MoFEMErrorCode
doWork(
int row_side,
int col_side, EntityType row_type,
449 EntitiesFieldData::EntData &row_data,
450 EntitiesFieldData::EntData &col_data);
465 CommonData &common_data,
bool ho_geometry =
false)
473 CommonData &common_data,
bool ho_geometry =
false)
486 MoFEMErrorCode
doWork(
int side, EntityType type,
487 EntitiesFieldData::EntData &data);
502 CommonData &common_data,
bool ho_geometry =
false)
510 CommonData &common_data,
bool ho_geometry =
false)
521 MoFEMErrorCode
doWork(
int side, EntityType type,
522 EntitiesFieldData::EntData &data);
535 bool ho_geometry =
false)
542 bool ho_geometry =
false)
552 MoFEMErrorCode
doWork(
int row_side,
int col_side, EntityType row_type,
554 EntitiesFieldData::EntData &row_data,
555 EntitiesFieldData::EntData &col_data);
570 const std::string rate_name)
587 using Ele = ForcesAndSourcesCore;
588 using VolEle = VolumeElementForcesAndSourcesCore;
589 using VolOp = VolumeElementForcesAndSourcesCore::UserDataOperator;
598 const std::string temp_name,
599 std::vector<std::array<double, 3>> eval_points = {})
602 dataFieldEval(m_field.getInterface<FieldEvaluatorInterface>()
607 ierr = m_field.getInterface<FieldEvaluatorInterface>()->buildTree<3>(
608 dataFieldEval,
"THERMAL_FE");
609 CHKERRABORT(PETSC_COMM_WORLD, ierr);
611 auto no_rule = [](int, int, int) { return -1; };
613 tempPtr = boost::make_shared<VectorDouble>();
615 boost::shared_ptr<Ele> vol_ele(
dataFieldEval->feMethodPtr.lock());
616 vol_ele->getRuleHook = no_rule;
618 vol_ele->getOpPtrVector().push_back(
619 new OpCalculateScalarFieldValues(
"TEMP",
tempPtr));
637 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
651 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
665 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
679 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
696 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
702 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
708 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
715 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
722 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
ForcesAndSourcesCore::UserDataOperator UserDataOperator
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_STD_EXCEPTION_THROW
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
constexpr auto field_name
Deprecated interface functions.
default operator for TRI element
@ OPROW
operator doWork function is executed on FE rows
@ OPROWCOL
operator doWork is executed on FE rows &columns
Volume finite element base.
data for calculation heat conductivity and heat capacity elements
MatrixDouble cOnductivity_mat
double initTemp
initial temperature
Range tEts
contains elements in block set
common data used by volume elements
VectorDouble temperatureAtGaussPts
VectorDouble temperatureRateAtGaussPts
ublas::matrix_row< MatrixDouble > getGradAtGaussPts(const int gg)
MatrixDouble gradAtGaussPts
data for calculation heat flux
Range tRis
surface triangles where hate flux is applied
MyTriFE(MoFEM::Interface &m_field)
definition of volume element
int getRule(int order)
it is used to calculate nb. of Gauss integration points
MyVolumeFE(MoFEM::Interface &m_field)
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
calculate thermal convection term in the lhs of equations
OpConvectionLhs(const std::string field_name, ConvectionData &data, bool ho_geometry=false)
OpConvectionLhs(const std::string field_name, Mat _A, ConvectionData &data, bool ho_geometry=false)
operator to calculate convection therms on body surface and assemble to rhs of equations
OpConvectionRhs(const std::string field_name, ConvectionData &data, CommonData &common_data, bool ho_geometry=false)
OpConvectionRhs(const std::string field_name, Vec _F, ConvectionData &data, CommonData &common_data, bool ho_geometry=false)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
operator to calculate temperature and rate of temperature at Gauss points
VectorDouble & fieldAtGaussPts
OpGetFieldAtGaussPts(const std::string field_name, VectorDouble &field_at_gauss_pts)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
operator calculating temperature and rate of temperature
operator to calculate temperature gradient at Gauss points
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
operator calculating temperature gradients
OpGetGradAtGaussPts(const std::string field_name, CommonData &common_data)
operator to calculate temperature rate at Gauss pts
OpGetTetRateAtGaussPts(const std::string field_name, CommonData &common_data)
operator to calculate temperature at Gauss pts
OpGetTetTemperatureAtGaussPts(const std::string field_name, CommonData &common_data)
operator to calculate temperature at Gauss pts
OpGetTriTemperatureAtGaussPts(const std::string field_name, CommonData &common_data)
operator to calculate left hand side of heat capacity terms
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
calculate heat capacity matrix
OpHeatCapacityLhs(const std::string field_name, BlockData &data, CommonData &common_data)
operator to calculate right hand side of heat capacity terms
OpHeatCapacityRhs(const std::string field_name, BlockData &data, CommonData &common_data)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate thermal conductivity matrix
operator for calculate heat flux and assemble to right hand side
OpHeatFlux(const std::string field_name, FluxData &data, bool ho_geometry=false)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate heat flux
OpHeatFlux(const std::string field_name, Vec _F, FluxData &data, bool ho_geometry=false)
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
calculate thermal radiation term in the lhs of equations(TangentMatrix) for transient Thermal Problem
OpRadiationLhs(const std::string field_name, Mat _A, RadiationData &data, CommonData &common_data, bool ho_geometry=false)
OpRadiationLhs(const std::string field_name, RadiationData &data, CommonData &common_data, bool ho_geometry=false)
operator to calculate radiation therms on body surface and assemble to rhs of transient equations(Res...
OpRadiationRhs(const std::string field_name, Vec _F, RadiationData &data, CommonData &common_data, bool ho_geometry=false)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate Transient Radiation condition on the right hand side residual
OpRadiationRhs(const std::string field_name, RadiationData &data, CommonData &common_data, bool ho_geometry=false)
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
calculate thermal conductivity matrix
OpThermalLhs(const std::string field_name, Mat _A, BlockData &data, CommonData &common_data)
OpThermalLhs(const std::string field_name, BlockData &data, CommonData &common_data)
OpThermalRhs(const std::string field_name, Vec _F, BlockData &data, CommonData &common_data)
OpThermalRhs(const std::string field_name, BlockData &data, CommonData &common_data)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate thermal conductivity matrix
TS monitore it records temperature at time steps.
const std::string tempName
boost::shared_ptr< SetPtsData > dataFieldEval
const std::string seriesName
TimeSeriesMonitor(MoFEM::Interface &m_field, const std::string series_name, const std::string temp_name, std::vector< std::array< double, 3 > > eval_points={})
std::vector< std::array< double, 3 > > evalPoints
VolumeElementForcesAndSourcesCore VolEle
FieldEvaluatorInterface::SetPtsData SetPtsData
VolumeElementForcesAndSourcesCore::UserDataOperator VolOp
boost::shared_ptr< VectorDouble > tempPtr
MoFEM::Interface & mField
this calass is to control time stepping
MoFEMErrorCode preProcess()
const std::string rateName
MoFEMErrorCode postProcess()
const std::string tempName
MoFEM::Interface & mField
UpdateAndControl(MoFEM::Interface &m_field, const std::string temp_name, const std::string rate_name)
structure grouping operators and data used for thermal problems
MyTriFE & getLoopFeConvectionLhs()
std::map< int, FluxData > setOfFluxes
maps side set id with appropriate FluxData
ThermalElement(MoFEM::Interface &m_field)
MyVolumeFE feRhs
cauclate right hand side for tetrahedral elements
MyTriFE & getLoopFeFlux()
MyVolumeFE & getLoopFeLhs()
get lhs volume element
MyTriFE & getLoopFeConvectionRhs()
MoFEM::Interface & mField
MyVolumeFE & getLoopFeRhs()
get rhs volume element
MyTriFE & getLoopFeRadiationRhs()
std::map< int, RadiationData > setOfRadiation
std::map< int, ConvectionData > setOfConvection
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
MyTriFE & getLoopFeRadiationLhs()