9#ifndef __THERMALSTRESSELEMENT_HPP
10#define __THERMALSTRESSELEMENT_HPP
57 EntitiesFieldData::EntData &data) {
59 if (data.getFieldData().size() == 0)
61 int nb_dofs = data.getFieldData().size();
62 int nb_gauss_pts = data.getN().size1();
65 if (type == MBVERTEX) {
69 for (
int gg = 0; gg < nb_gauss_pts; gg++) {
71 inner_prod(data.getN(gg, nb_dofs), data.getFieldData());
92 EntitiesFieldData::EntData &data) {
95 if (data.getIndices().size() == 0)
101 const auto &dof_ptr = data.getFieldDofs()[0];
102 int rank = dof_ptr->getNbOfCoeffs();
105 "data inconsistency");
108 unsigned int nb_dofs = data.getIndices().size();
109 if (nb_dofs % rank != 0) {
111 "data inconsistency");
113 if (data.getN().size2() < nb_dofs / rank) {
115 "data inconsistency N.size2 %d nb_dof %d rank %d",
116 data.getN().size2(), nb_dofs, rank);
120 bzero(&*
Nf.data().begin(), nb_dofs *
sizeof(FieldData));
123 if (type == MBVERTEX) {
129 for (
unsigned int gg = 0; gg < data.getN().size1(); gg++) {
144 diff_N = &data.getDiffN()(gg, 0);
145 cblas_daxpy(nb_dofs, val, diff_N, 1, &
Nf[0], 1);
148 CHKERR VecSetValues(
F, data.getIndices().size(), &data.getIndices()[0],
156 const std::string fe_name,
const std::string
field_name,
157 const std::string thermal_field_name,
158 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS") {
170 fe_name, mesh_nodals_positions);
175 CHKERR it->getAttributeDataStructure(mydata);
176 setOfBlocks[it->getMeshsetId()].youngModulus = mydata.data.Young;
177 setOfBlocks[it->getMeshsetId()].poissonRatio = mydata.data.Poisson;
179 mydata.data.ThermalExpansion;
181 it->meshset, MBTET,
setOfBlocks[it->getMeshsetId()].tEts,
true);
183 setOfBlocks[it->getMeshsetId()].tEts, MBTET, fe_name);
186 CHKERR PetscOptionsGetReal(PETSC_NULL, PETSC_NULL,
"-my_ref_temp",
188 if (flg == PETSC_TRUE) {
189 PetscPrintf(
mField.
get_comm(),
"set refernce temperature %3.2f\n",
200 const std::string fe_name,
const std::string
field_name,
201 const std::string thermal_field_name,
202 const std::string mesh_nodals_positions =
"MESH_NODE_POSITIONS") {
204 mesh_nodals_positions);
208 string thermal_field_name, Vec &
F,
212 std::map<int, BlockData>::iterator sit =
setOfBlocks.begin();
ForcesAndSourcesCore::UserDataOperator UserDataOperator
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_row)=0
set field col which finite element use
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_filed)=0
set finite element field data
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)=0
set field row which finite element use
virtual bool check_field(const std::string &name) const =0
check if field is in database
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
implementation of Data Operators for Forces and Sources
constexpr auto field_name
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
Deprecated interface functions.
boost::shared_ptr< const NumeredEntFiniteElement > getNumeredEntFiniteElementPtr() const
Return raw pointer to NumeredEntFiniteElement.
@ OPROW
operator doWork function is executed on FE rows
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
double getVolume() const
element volume (linear geometry)
Volume finite element base.
VolumeElementForcesAndSourcesCore(Interface &m_field, const EntityType type=MBTET)
VectorDouble temperatureAtGaussPts
MyVolumeFE(MoFEM::Interface &m_field)
OpGetTemperatureAtGaussPts(const std::string field_name, CommonData &common_data, int _verb=0)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
OpThermalStressRhs(const std::string field_name, Vec _F, BlockData &data, CommonData &common_data, int _verb=0)
Implentation of thermal stress element.
DEPRECATED MoFEMErrorCode addThermalSterssElement(const std::string fe_name, const std::string field_name, const std::string thermal_field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
MyVolumeFE & getLoopThermalStressRhs()
ThermalStressElement(MoFEM::Interface &m_field)
std::map< int, BlockData > setOfBlocks
MoFEM::Interface & mField
MoFEMErrorCode addThermalStressElement(const std::string fe_name, const std::string field_name, const std::string thermal_field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
MyVolumeFE feThermalStressRhs
MoFEMErrorCode setThermalStressRhsOperators(string field_name, string thermal_field_name, Vec &F, int verb=0)