|
| v0.14.0
|
Go to the documentation of this file.
9 #ifndef __THERMALSTRESSELEMENT_HPP
10 #define __THERMALSTRESSELEMENT_HPP
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());
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);
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);
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();
226 #endif //__THERMALSTRESSELEMENT_HPP
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
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")
ThermalStressElement(MoFEM::Interface &m_field)
OpGetTemperatureAtGaussPts(const std::string field_name, CommonData &common_data, int _verb=0)
VolumeElementForcesAndSourcesCore(Interface &m_field, const EntityType type=MBTET)
MoFEM::Interface & mField
VectorDouble temperatureAtGaussPts
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
virtual MPI_Comm & get_comm() const =0
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
MyVolumeFE(MoFEM::Interface &m_field)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
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")
MoFEMErrorCode setThermalStressRhsOperators(string field_name, string thermal_field_name, Vec &F, int verb=0)
double getVolume() const
element volume (linear geometry)
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Deprecated interface functions.
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
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
#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 moab::Interface & get_moab()=0
implementation of Data Operators for Forces and Sources
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
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
OpThermalStressRhs(const std::string field_name, Vec _F, BlockData &data, CommonData &common_data, int _verb=0)
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
boost::shared_ptr< const NumeredEntFiniteElement > getNumeredEntFiniteElementPtr() const
Return raw pointer to NumeredEntFiniteElement.
virtual bool check_field(const std::string &name) const =0
check if field is in database
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
Volume finite element base.
MyVolumeFE feThermalStressRhs
EntitiesFieldData::EntData EntData
constexpr auto field_name
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
std::map< int, BlockData > setOfBlocks
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
double FieldData
Field data type.
const FTensor::Tensor2< T, Dim, Dim > Vec
@ MOFEM_DATA_INCONSISTENCY
UBlasVector< double > VectorDouble
MyVolumeFE & getLoopThermalStressRhs()
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Implentation of thermal stress element.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ OPROW
operator doWork function is executed on FE rows