23#ifndef __DIRICHLET_HPP__
24#define __DIRICHLET_HPP__
26using namespace boost::numeric;
46 MoFEMErrorCode
getBcData(DisplacementCubitBcData &mydata,
48 MoFEMErrorCode
getBcData(std::vector<double> &mydata,
64 const std::string &
field_name, Mat Aij, Vec X, Vec
F,
65 string blockset_name =
"DISPLACEMENT");
68 string blockset_name =
"DISPLACEMENT");
131 int coeff =
fieldPtr->getNbOfCoeffs();
133 for (
int i = 0;
i != coeff;
i++) {
134 if (bc_it.bc_flags[
i]) {
135 if (
entPtr->getEntType() == MBVERTEX) {
136 entPtr->getEntFieldData()[
i] = bc_it.scaled_values[
i];
137 }
else if (!
entPtr->getEntFieldData().empty()) {
138 entPtr->getEntFieldData()[
i] = 0;
154 string material_positions)
170 CHKERR mField.get_field_ents(&field_ents);
171 auto &field_ents_by_uid = field_ents->get<Unique_mi_tag>();
173 auto get_coords = [&]() {
174 VectorDouble coords({0, 0, 0});
175 if (
entPtr->getEntType() == MBVERTEX) {
177 field_ents_by_uid.find(FieldEntity::getLocalUniqueIdCalculate(
179 if (eit != field_ents_by_uid.end())
180 noalias(coords) = (*eit)->getEntFieldData();
182 CHKERR mField.get_moab().get_coords(&ent, 1, &*coords.data().begin());
187 int coeff =
fieldPtr->getNbOfCoeffs();
188 auto coords = get_coords();
191 for (
int i = 0;
i != coeff;
i++) {
192 if (bc_it.bc_flags[
i]) {
193 if (
entPtr->getEntType() == MBVERTEX) {
194 entPtr->getEntFieldData()[
i] = coords(
i) + bc_it.scaled_values[
i];
195 }
else if (!
entPtr->getEntFieldData().empty()) {
196 entPtr->getEntFieldData()[
i] = 0;
215 Vec
f,
const std::string material_positions =
"MESH_NODE_POSITIONS",
216 const std::string blockset_name =
"DISPLACEMENT")
222 const std::string material_positions =
"MESH_NODE_POSITIONS",
223 const std::string blockset_name =
"DISPLACEMENT")
291 const std::string &problem_name,
292 string blockset_name =
"DISPLACEMENT",
293 bool is_partitioned =
false)
300 return boost::make_shared<BcEntMethodDisp>(
this, data);
317 const std::string &problem_name,
318 const std::string material_positions =
"MESH_NODE_POSITIONS",
319 string blockset_name =
"DISPLACEMENT",
bool is_partitioned =
false)
325 return boost::make_shared<BcEntMethodSpatial>(
this, data,
360 const std::string &blockset_name, Mat aij,
367 const std::string &blockset_name)
DEPRECATED typedef DirichletSetFieldFromBlockWithFlags DirichletSetFieldFromBlock
DEPRECATED typedef DirichletFixFieldAtEntitiesBc FixBcAtEntities
DEPRECATED typedef DirichletDisplacementBc DisplacementBCFEMethodPreAndPostProc
DEPRECATED typedef DirichletSetFieldFromBlockWithFlags DirichletBCFromBlockSetFEMethodPreAndPostProc
DEPRECATED typedef DirichletSetFieldFromBlockWithFlags DirichletBCFromBlockSetFEMethodPreAndPostProcWithFlags
DEPRECATED typedef DirichletTemperatureBc TemperatureBCFEMethodPreAndPostProc
DEPRECATED typedef DirichletSpatialPositionsBc SpatialPositionsBCFEMethodPreAndPostProc
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
multi_index_container< boost::shared_ptr< FieldEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, member< FieldEntity, UId, &FieldEntity::localUId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FieldEntity::interface_type_RefEntity, EntityHandle, &FieldEntity::getEnt > > > > FieldEntity_multiIndex
MultiIndex container keeps FieldEntity.
FTensor::Index< 'i', SPACE_DIM > i
const double v
phase velocity of light in medium (cm/ns)
constexpr auto field_name
MoFEMErrorCode postProcess()
function is run at the end of loop
DirichletDisplacementBc * dirichletBcPtr
MoFEMErrorCode operator()()
function is run for every finite element
BcEntMethodDisp(DirichletDisplacementBc *dirichlet_bc_ptr, DataFromBc &data_from_dirichlet_bc)
DataFromBc & dataFromDirichletBc
MoFEMErrorCode preProcess()
function is run at the beginning of loop
DataFromBc & dataFromDirichletBc
MoFEMErrorCode postProcess()
function is run at the end of loop
BcEntMethodSpatial(DirichletDisplacementBc *dirichlet_bc_ptr, DataFromBc &data_from_dirichlet_bc, string material_positions)
MoFEMErrorCode preProcess()
function is run at the beginning of loop
DirichletDisplacementBc * dirichletBcPtr
MoFEMErrorCode operator()()
function is run for every finite element
Data from Cubit blocksets.
FTensor::Tensor1< double, 3 > t_centr
MoFEMErrorCode getBcData(DisplacementCubitBcData &mydata, const MoFEM::CubitMeshSets *it)
MoFEMErrorCode getEntitiesFromBc(MoFEM::Interface &mField, const MoFEM::CubitMeshSets *it)
VectorDouble scaled_values
FTensor::Tensor1< double, 3 > t_normal
VectorDouble initial_values
Set Dirichlet boundary conditions on displacements.
const std::string blocksetName
MoFEMErrorCode postProcess()
function is run at the end of loop
std::map< DofIdx, FieldData > mapZeroRows
MoFEMErrorCode getRotationBcFromBlock(std::vector< DataFromBc > &bc_data)
Get the Rotation Bc From Block object Use ROTATION blockset name with 7 atributes: 1,...
const std::string fieldName
field name to set Dirichlet BC
MoFEMErrorCode operator()()
function is run for every finite element
double dIag
diagonal value set on zeroed column and rows
std::vector< int > dofsIndices
MoFEMErrorCode preProcess()
function is run at the beginning of loop
MoFEMErrorCode getBcDataFromSetsAndBlocks(std::vector< DataFromBc > &bc_data)
Get the Bc Data From Sets And Blocks object Use DISPLACEMENT blockset name (default) with 6 atributes...
MoFEMErrorCode applyScaleBcData(DataFromBc &bc_data)
std::vector< double > dofsXValues
boost::ptr_vector< MethodForForceScaling > methodsOp
std::vector< double > dofsValues
MoFEM::Interface & mField
virtual MoFEMErrorCode iNitialize()
MoFEMErrorCode calculateRotationForDof(VectorDouble3 &coords, DataFromBc &bc_data)
Calculate displacements from rotation for particular dof.
Set Dirichlet boundary conditions on displacements by removing dofs.
MoFEMErrorCode preProcess()
function is run at the beginning of loop
virtual boost::shared_ptr< EntityMethod > getEntMethodPtr(DataFromBc &data)
DirichletDisplacementRemoveDofsBc(MoFEM::Interface &m_field, const std::string &field_name, const std::string &problem_name, string blockset_name="DISPLACEMENT", bool is_partitioned=false)
boost::shared_ptr< vector< DataFromBc > > bcDataPtr
MoFEMErrorCode operator()()
function is run for every finite element
MoFEMErrorCode iNitialize()
MoFEMErrorCode postProcess()
function is run at the end of loop
MoFEMErrorCode iNitialize()
std::vector< std::string > fieldNames
DirichletFixFieldAtEntitiesBc(MoFEM::Interface &m_field, const std::string field_name, Mat aij, Vec x, Vec f, Range &ents)
DirichletFixFieldAtEntitiesBc(MoFEM::Interface &m_field, const std::string field_name, Range &ents)
MoFEMErrorCode postProcess()
function is run at the end of loop
MoFEMErrorCode preProcess()
function is run at the beginning of loop
Add boundary conditions form block set having 6 attributes.
DirichletSetFieldFromBlockWithFlags(MoFEM::Interface &m_field, const std::string &field_name, const std::string &blockset_name)
DirichletSetFieldFromBlockWithFlags(MoFEM::Interface &m_field, const std::string &field_name, const std::string &blockset_name, Mat aij, Vec x, Vec f)
Set Dirichlet boundary conditions on spatial displacements.
MoFEMErrorCode iNitialize()
std::vector< std::string > fixFields
DirichletSpatialPositionsBc(MoFEM::Interface &m_field, const std::string &field_name, Mat aij, Vec x, Vec f, const std::string material_positions="MESH_NODE_POSITIONS", const std::string blockset_name="DISPLACEMENT")
DirichletSpatialPositionsBc(MoFEM::Interface &m_field, const std::string &field_name, const std::string material_positions="MESH_NODE_POSITIONS", const std::string blockset_name="DISPLACEMENT")
std::string materialPositions
Set Dirichlet boundary conditions on spatial positions by removing dofs.
std::string materialPositions
boost::shared_ptr< EntityMethod > getEntMethodPtr(DataFromBc &data) override
DirichletSpatialRemoveDofsBc(MoFEM::Interface &m_field, const std::string &field_name, const std::string &problem_name, const std::string material_positions="MESH_NODE_POSITIONS", string blockset_name="DISPLACEMENT", bool is_partitioned=false)
DirichletTemperatureBc(MoFEM::Interface &m_field, const std::string &field_name, Mat aij, Vec x, Vec f)
MoFEMErrorCode iNitialize()
DirichletTemperatureBc(MoFEM::Interface &m_field, const std::string &field_name)
this struct keeps basic methods for moab meshset about material and boundary conditions
Deprecated interface functions.
Data structure to exchange data between mofem and User Loop Methods on entities.
boost::shared_ptr< Field > fieldPtr
boost::shared_ptr< FieldEntity > entPtr
structure for User Loop Methods on finite elements
calculate reactions from vector of internal forces on meshsets
const ReactionsMap & getReactionsMap() const
Get the Reactions Map.
MoFEM::Interface & mField
ReactionsMap reactionsMap
MoFEMErrorCode calculateReactions(Vec &internal)
calculate reactions from a given vector
Reactions(MoFEM::Interface &m_field, string problem_name, string field_name)
std::map< int, VectorDouble > ReactionsMap
const VectorDouble & getReactionsFromSet(const int &id) const
Get the Reactions at specified meshset id.