24 std::array<double, 3> &gravity,
25 std::array<double, 3> &zero_pressure,
26 boost::shared_ptr<Range> &ents,
30 auto cubit_meshset_ptr =
31 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(ms_id,
33 std::vector<double> block_data;
34 CHKERR cubit_meshset_ptr->getAttributes(block_data);
35 if (block_data.size() != 1 + 3 + 3) {
37 "Expected that block has two attribute");
39 density = block_data[0];
40 gravity = {block_data[1], block_data[2], block_data[3]};
41 zero_pressure = {block_data[4], block_data[5], block_data[6]};
45 <<
"Density " << density;
47 <<
"Gravity " << gravity[0] <<
" " << gravity[1] <<
" " << gravity[2];
49 <<
"Zero pressure " << zero_pressure[0] <<
" " << zero_pressure[1]
50 <<
" " << zero_pressure[2];
52 ents = boost::make_shared<Range>();
54 m_field.
get_moab().get_entities_by_handle(cubit_meshset_ptr->meshset,
67template <
int FIELD_DIM, AssemblyType A,
typename EleOp>
74 std::vector<boost::shared_ptr<ScalingMethod>> smv,
84 MoFEMErrorCode
iNtegrate(EntitiesFieldData::EntData &data);
87template <
int FIELD_DIM, AssemblyType A,
typename EleOp>
92 std::vector<boost::shared_ptr<ScalingMethod>> smv,
95 vecOfTimeScalingMethods(smv), rhsScale(
scale) {
97 this->fluidDensity, this->gravityAcceleration,
98 this->zeroPressure, this->entsPtr, m_field, ms_id),
99 "Can not read spring stiffness data from blockset");
102template <
int FIELD_DIM, AssemblyType A,
typename EleOp>
105 GAUSS,
EleOp>::iNtegrate(EntitiesFieldData::EntData
111 auto t_w = OpBase::getFTensor0IntegrationWeight();
113 auto t_row_base = row_data.getFTensor0N();
116 auto t_normal = OpBase::getFTensor1NormalsAtGaussPts();
118 auto t_coord = OpBase::getFTensor1CoordsAtGaussPts();
120 auto t_gravity = getFTensor1FromPtr<FIELD_DIM>(gravityAcceleration.data());
121 auto t_zero_pressure = getFTensor1FromPtr<FIELD_DIM>(zeroPressure.data());
124 for (
auto &o : vecOfTimeScalingMethods) {
125 s *= o->getScale(OpBase::getTStime());
131 const double alpha = t_w * rhsScale;
134 t_level(
i) = t_coord(
i) - t_zero_pressure(
i);
135 auto dot = t_gravity(
i) * t_level(
i);
138 t_force(
i) = -s * fluidDensity * dot * t_normal(
i);
141 auto t_nf = getFTensor1FromArray<FIELD_DIM, FIELD_DIM>(
OpBase::locF);
144 t_nf(
i) += (alpha * t_row_base) * t_force(
i);
161struct AddFluxToRhsPipelineImpl<
171 static MoFEMErrorCode
add(
173 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
175 std::vector<boost::shared_ptr<ScalingMethod>> smv,
double scale,
176 std::string block_name, Sev sev
181 using OP = OpFluxRhsImpl<ElasticExample::FluidLevelType<BLOCKSET>,
BASE_DIM,
184 auto add_op = [&](
auto &&meshset_vec_ptr) {
185 for (
auto m : meshset_vec_ptr) {
197 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
200 (boost::format(
"%s(.*)") % block_name).str()
209 "Handling of bc type not implemented");
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
CubitBC
Types of sets and boundary conditions.
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
constexpr IntegrationType I
constexpr auto field_name
FTensor::Index< 'm', 3 > m
static MoFEMErrorCode add(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, MoFEM::Interface &m_field, std::string field_name, std::vector< boost::shared_ptr< ScalingMethod > > smv, double scale, std::string block_name, Sev sev)
AddFluxToRhsPipelineImpl()=delete
static MoFEMErrorCode getParams(double &density, std::array< double, 3 > &gravity, std::array< double, 3 > &zero_pressure, boost::shared_ptr< Range > &ents, MoFEM::Interface &m_field, int ms_id)
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
Deprecated interface functions.
VectorDouble locF
local entity vector
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points
int nbRowBaseFunctions
number or row base functions
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
std::array< double, 3 > gravityAcceleration
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
std::array< double, 3 > zeroPressure
std::vector< boost::shared_ptr< ScalingMethod > > vecOfTimeScalingMethods