13#ifndef __THERMAL_ELEMENT_HPP
14#define __THERMAL_ELEMENT_HPP
99 std::map<int, BlockData>
110 std::map<int, FluxData>
123 std::map<int, ConvectionData>
138 std::map<int, RadiationData>
170 EntitiesFieldData::EntData &data);
176 template <
typename OP>
181 VectorDouble &field_at_gauss_pts)
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;
232 field_name, common_data.temperatureAtGaussPts) {}
243 field_name, common_data.temperatureAtGaussPts) {}
254 field_name, common_data.temperatureRateAtGaussPts) {}
287 EntitiesFieldData::EntData &data);
321 EntitiesFieldData::EntData &row_data,
322 EntitiesFieldData::EntData &col_data);
347 EntitiesFieldData::EntData &data);
373 EntitiesFieldData::EntData &row_data,
374 EntitiesFieldData::EntData &col_data);
387 bool ho_geometry =
false)
394 bool ho_geometry =
false)
407 EntitiesFieldData::EntData &data);
424 CommonData &common_data,
bool ho_geometry =
false)
432 CommonData &common_data,
bool ho_geometry =
false)
448 EntitiesFieldData::EntData &row_data,
449 EntitiesFieldData::EntData &col_data);
464 CommonData &common_data,
bool ho_geometry =
false)
472 CommonData &common_data,
bool ho_geometry =
false)
486 EntitiesFieldData::EntData &data);
501 CommonData &common_data,
bool ho_geometry =
false)
509 CommonData &common_data,
bool ho_geometry =
false)
521 EntitiesFieldData::EntData &data);
534 bool ho_geometry =
false)
541 bool ho_geometry =
false)
553 EntitiesFieldData::EntData &row_data,
554 EntitiesFieldData::EntData &col_data);
569 const std::string rate_name)
586 using Ele = ForcesAndSourcesCore;
587 using VolEle = VolumeElementForcesAndSourcesCore;
588 using VolOp = VolumeElementForcesAndSourcesCore::UserDataOperator;
597 const std::string temp_name,
598 std::vector<std::array<double, 3>> eval_points = {})
608 CHKERRABORT(PETSC_COMM_WORLD,
ierr);
610 auto no_rule = [](int, int, int) {
return -1; };
612 tempPtr = boost::make_shared<VectorDouble>();
614 boost::shared_ptr<Ele> vol_ele(
dataFieldEval->feMethodPtr.lock());
615 vol_ele->getRuleHook = no_rule;
617 vol_ele->getOpPtrVector().push_back(
618 new OpCalculateScalarFieldValues(
"TEMP",
tempPtr));
636 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
650 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
664 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
678 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
695 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
701 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
707 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
714 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
721 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS");
ForcesAndSourcesCore::UserDataOperator UserDataOperator
static PetscErrorCode ierr
#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 ...
MoFEMErrorCode addThermalElements(const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
add thermal element on tets
MoFEMErrorCode setThermalFluxFiniteElementRhsOperators(string field_name, Vec &F, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
this function is used in case of stationary problem for heat flux terms
MoFEMErrorCode setThermalFiniteElementRhsOperators(string field_name, Vec &F)
this function is used in case of stationary problem to set elements for rhs
MoFEMErrorCode setThermalFiniteElementLhsOperators(string field_name, Mat A)
this function is used in case of stationary heat conductivity problem for lhs
MoFEMErrorCode addThermalFluxElement(const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
add heat flux element
MoFEMErrorCode addThermalConvectionElement(const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
add convection element
MoFEMErrorCode addThermalRadiationElement(const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
add Non-linear Radiation element
MoFEMErrorCode setTimeSteppingProblem(string field_name, string rate_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
set up operators for unsteady heat flux; convection; radiation problem
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
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Volume finite element base.
VolumeElementForcesAndSourcesCore(Interface &m_field, const EntityType type=MBTET)
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(Tangent Matrix) for transient Thermal Proble...
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
MoFEMErrorCode postProcess()
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()
MoFEMErrorCode setThermalConvectionFiniteElementLhsOperators(string field_name, Mat A, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
std::map< int, RadiationData > setOfRadiation
std::map< int, ConvectionData > setOfConvection
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
MyTriFE & getLoopFeRadiationLhs()
MoFEMErrorCode setThermalConvectionFiniteElementRhsOperators(string field_name, Vec &F, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")