31template <
typename ShapeFunctionLiquidVelocity,
typename ShapeFunctionPressure,
37 ShapeFunctionLiquidVelocity::NPOINTS * GlobalDim;
40 ShapeFunctionLiquidVelocity::NPOINTS * GlobalDim;
55 bool const is_axially_symmetric,
62 unsigned const n_integration_points =
64 _ip_data.reserve(n_integration_points);
66 auto const shape_matrices_v =
71 auto const shape_matrices_p =
76 for (
unsigned ip = 0; ip < n_integration_points; ip++)
79 shape_matrices_v[ip].N, shape_matrices_v[ip].dNdx,
80 shape_matrices_p[ip].N, shape_matrices_p[ip].dNdx,
82 shape_matrices_v[ip].integralMeasure *
83 shape_matrices_v[ip].detJ);
87 ip_data.N_v_op = ShapeMatrixTypeLiquidVelocity::template MatrixType<
92 ShapeMatrixTypeLiquidVelocity::template MatrixType<
93 GlobalDim * GlobalDim,
97 for (
int i = 0; i < GlobalDim; ++i)
102 .noalias() = shape_matrices_v[ip].N;
105 .template block<GlobalDim,
108 .noalias() = shape_matrices_v[ip].dNdx;
114 std::vector<double>
const& local_x,
115 std::vector<double>
const& ,
116 std::vector<double>& ,
117 std::vector<double>& local_K_data,
118 std::vector<double>& local_b_data)
override
121 assert(local_x.size() == local_matrix_size);
123 auto local_p = Eigen::Map<const NodalVectorType>(
127 typename ShapeMatrixTypeLiquidVelocity::template MatrixType<
128 local_matrix_size, local_matrix_size>>(
129 local_K_data, local_matrix_size, local_matrix_size);
131 typename ShapeMatrixTypeLiquidVelocity::template VectorType<
132 local_matrix_size>>(local_b_data, local_matrix_size);
137 local_K.template block<liquid_velocity_size, liquid_velocity_size>(
140 auto Kvp = local_K.template block<liquid_velocity_size, pressure_size>(
143 auto Kpv = local_K.template block<pressure_size, liquid_velocity_size>(
146 auto bv = local_b.template segment<liquid_velocity_size>(
149 unsigned const n_integration_points =
160 assert(GlobalDim == 2);
161 auto const identity_mat =
162 Eigen::Matrix<double, GlobalDim, GlobalDim>::Identity().eval();
163 auto const unit_vector = Eigen::Map<const Eigen::RowVectorXd>(
164 identity_mat.data(), identity_mat.size())
170 auto const& phase = medium.
phase(
"AqueousLiquid");
172 for (
unsigned ip(0); ip < n_integration_points; ++ip)
178 auto const& N_p = ip_data.N_p;
179 auto const& N_v_op = ip_data.N_v_op;
181 auto const& dNdx_v = ip_data.dNdx_v;
182 auto const& dNdx_v_op = ip_data.dNdx_v_op;
183 auto const& dNdx_p = ip_data.dNdx_p;
185 auto const& w = ip_data.integration_weight;
187 double p_int_pt = 0.0;
195 .template value<double>(vars, pos, t, dt);
203 .value(vars, pos, t, dt));
206 w * N_v_op.transpose() * mu * K.inverse() * N_v_op;
209 for (
int i = 0; i < GlobalDim; ++i)
215 .noalias() += w * dNdx_v.transpose() * mu * dNdx_v;
219 Kvp.noalias() += w * N_v_op.transpose() * dNdx_p;
222 Kpv.noalias() += w * N_p.transpose() * unit_vector * dNdx_v_op;
225 bv.noalias() += w * N_v_op.transpose() * b;
230 const unsigned integration_point)
const override
232 auto const& N_p =
_ip_data[integration_point].N_p;
235 return Eigen::Map<const Eigen::RowVectorXd>(N_p.data(), N_p.size());
241 Eigen::VectorXd
const& local_x,
242 Eigen::VectorXd
const& )
override
248 ShapeFunctionPressure,
249 typename ShapeFunctionLiquidVelocity::MeshElement, GlobalDim>(
262 ShapeFunctionLiquidVelocity::NPOINTS>,
265 GlobalDim, ShapeFunctionLiquidVelocity::NPOINTS>>>
Medium * getMedium(std::size_t element_id)
Phase const & phase(std::size_t index) const
double liquid_phase_pressure
std::size_t getID() const
Returns the ID of the element.
MathLib::WeightedPoint const & getWeightedPoint(unsigned const igp) const
unsigned getNumberOfPoints() const
void setElementID(std::size_t element_id)
void setIntegrationPoint(unsigned integration_point)
MeshLib::Element const & _element
void computeSecondaryVariableConcrete(double const, double const, Eigen::VectorXd const &local_x, Eigen::VectorXd const &) override
static const int liquid_velocity_index
static const int pressure_index
ShapeMatrixPolicyType< ShapeFunctionLiquidVelocity, GlobalDim > ShapeMatrixTypeLiquidVelocity
static const int pressure_size
bool const _is_axially_symmetric
void assemble(double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &, std::vector< double > &, std::vector< double > &local_K_data, std::vector< double > &local_b_data) override
StokesFlowProcessData const & _process_data
LocalAssemblerData(MeshLib::Element const &element, std::size_t const, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, StokesFlowProcessData const &process_data)
NumLib::GenericIntegrationMethod const & _integration_method
static const int liquid_velocity_size
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix(const unsigned integration_point) const override
Provides the shape matrix at the given integration point.
typename ShapeMatrixTypePressure::NodalVectorType NodalVectorType
std::vector< IntegrationPointData< ShapeMatrixTypeLiquidVelocity, ShapeMatrixTypePressure, GlobalDim, ShapeFunctionLiquidVelocity::NPOINTS >, Eigen::aligned_allocator< IntegrationPointData< ShapeMatrixTypeLiquidVelocity, ShapeMatrixTypePressure, GlobalDim, ShapeFunctionLiquidVelocity::NPOINTS > > > _ip_data
ShapeMatrixPolicyType< ShapeFunctionPressure, GlobalDim > ShapeMatrixTypePressure
Eigen::Matrix< double, GlobalDim, GlobalDim > formEigenTensor(MaterialPropertyLib::PropertyDataType const &values)
Eigen::Map< Vector > createZeroedVector(std::vector< double > &data, Eigen::VectorXd::Index size)
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)
void interpolateToHigherOrderNodes(MeshLib::Element const &element, bool const is_axially_symmetric, Eigen::MatrixBase< EigenMatrixType > const &node_values, MeshLib::PropertyVector< double > &interpolated_values_global_vector)
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)
VectorType< ShapeFunction::NPOINTS > NodalVectorType
Eigen::VectorXd const specific_body_force
an external force that applies in the bulk of the fluid, like gravity.
MaterialPropertyLib::MaterialSpatialDistributionMap media_map
MeshLib::PropertyVector< double > * pressure_interpolated
bool const use_stokes_brinkman_form