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,
67 template <
int FIELD_DIM, AssemblyType A,
typename EleOp>
74 std::vector<boost::shared_ptr<ScalingMethod>> smv,
87 template <
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");
102 template <
int FIELD_DIM, AssemblyType A,
typename EleOp>
111 const double vol = OpBase::getMeasure();
113 auto t_w = OpBase::getFTensor0IntegrationWeight();
115 auto t_row_base = row_data.getFTensor0N();
118 auto t_normal = OpBase::getFTensor1NormalsAtGaussPts();
120 auto t_coord = OpBase::getFTensor1CoordsAtGaussPts();
122 auto t_gravity = getFTensor1FromPtr<FIELD_DIM>(gravityAcceleration.data());
123 auto t_zero_pressure = getFTensor1FromPtr<FIELD_DIM>(zeroPressure.data());
126 for (
auto &o : vecOfTimeScalingMethods) {
127 s *= o->getScale(OpBase::getTStime());
133 const double alpha = t_w * rhsScale;
136 t_level(
i) = t_coord(
i) - t_zero_pressure(
i);
137 auto dot = t_gravity(
i) * t_level(
i);
140 t_force(
i) = -s * fluidDensity * dot * t_normal(
i);
143 auto t_nf = getFTensor1FromArray<FIELD_DIM, FIELD_DIM>(
OpBase::locF);
146 t_nf(
i) += (alpha * t_row_base) * t_force(
i);
163 struct AddFluxToRhsPipelineImpl<
171 AddFluxToRhsPipelineImpl() =
delete;
175 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
177 std::vector<boost::shared_ptr<ScalingMethod>> smv,
double scale,
178 std::string block_name,
Sev sev
183 using OP = OpFluxRhsImpl<ElasticExample::FluidLevelType<BLOCKSET>,
BASE_DIM,
186 auto add_op = [&](
auto &&meshset_vec_ptr) {
187 for (
auto m : meshset_vec_ptr) {
199 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
202 (boost::format(
"%s(.*)") % block_name).str()
211 "Handling of bc type not implemented");