23template <
int GlobalDim>
27 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
28 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
29 unsigned const integration_order,
30 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
34 bool const use_monolithic_scheme)
35 :
Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
36 integration_order, std::move(process_variables),
37 std::move(secondary_variables), use_monolithic_scheme),
38 _process_data(std::move(process_data))
42template <
int GlobalDim>
46 _mesh_subset_all_nodes =
47 std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
50 _mesh_subset_base_nodes =
51 std::make_unique<MeshLib::MeshSubset>(_mesh, _base_nodes);
55 std::vector<MeshLib::MeshSubset> all_mesh_subsets_single_component{
56 *_mesh_subset_all_nodes};
57 _local_to_global_index_map_single_component =
58 std::make_unique<NumLib::LocalToGlobalIndexMap>(
59 std::move(all_mesh_subsets_single_component),
63 assert(_use_monolithic_scheme);
66 int const process_id = 0;
67 std::vector<MeshLib::MeshSubset> all_mesh_subsets(
68 getProcessVariables(process_id)[0]
70 .getNumberOfGlobalComponents(),
71 *_mesh_subset_all_nodes);
74 all_mesh_subsets.push_back(*_mesh_subset_base_nodes);
76 std::vector<int>
const vec_n_components{GlobalDim, 1};
78 _local_to_global_index_map =
79 std::make_unique<NumLib::LocalToGlobalIndexMap>(
80 std::move(all_mesh_subsets), vec_n_components,
82 assert(_local_to_global_index_map);
86template <
int GlobalDim>
90 unsigned const integration_order)
92 ProcessLib::createLocalAssemblersStokes<GlobalDim, LocalAssemblerData>(
97 _process_data.pressure_interpolated =
98 MeshLib::getOrCreateMeshProperty<double>(
103template <
int GlobalDim>
105 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
107 assert(_use_monolithic_scheme);
109 int const process_id = 0;
110 initializeProcessBoundaryConditionsAndSourceTerms(
111 *_local_to_global_index_map, process_id, media);
115template <
int GlobalDim>
120 assert(_use_monolithic_scheme);
122 auto const& l = *_local_to_global_index_map;
124 return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
125 &l.getGhostIndices(), &this->_sparsity_pattern};
129template <
int GlobalDim>
131 const double t,
double const dt, std::vector<GlobalVector*>
const& x,
132 std::vector<GlobalVector*>
const& x_prev,
int const process_id,
135 DBUG(
"Assemble StokesFlowProcess.");
137 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
138 assert(_use_monolithic_scheme);
140 dof_tables.push_back(_local_to_global_index_map.get());
146 getActiveElementIDs(), dof_tables, t, dt, x, x_prev, process_id, &M, &K,
150template <
int GlobalDim>
152 const double ,
double const ,
153 std::vector<GlobalVector*>
const& ,
154 std::vector<GlobalVector*>
const& ,
int const ,
158 "Assembly of Jacobian matrix has not yet been implemented for "
159 "StokesFlowProcess.");
162template <
int GlobalDim>
166 std::vector<GlobalVector*>
const& x,
168 int const process_id)
175 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
176 dof_tables.reserve(x.size());
177 assert(_use_monolithic_scheme);
179 dof_tables.push_back(_local_to_global_index_map.get());
184 _local_assemblers, getActiveElementIDs(), dof_tables, t, dt, x, x_prev,
188template <
int GlobalDim>
190 std::vector<GlobalVector*>
const& x,
191 std::vector<GlobalVector*>
const& x_prev,
194 int const process_id)
201 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
202 dof_tables.reserve(x.size());
203 assert(_use_monolithic_scheme);
205 dof_tables.push_back(_local_to_global_index_map.get());
210 getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);
213template <
int GlobalDim>
217 assert(_use_monolithic_scheme);
219 return *_local_to_global_index_map;
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Global vector based on Eigen vector.
bool isAxiallySymmetric() const
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
virtual void postTimestep(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
virtual void computeSecondaryVariable(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id)
Handles configuration of several secondary variables from the project file.
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
void computeSecondaryVariableConcrete(double const, double const, std::vector< GlobalVector * > const &x, GlobalVector const &, int const) override
void assembleWithJacobianConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalVector &b, GlobalMatrix &Jac) override
void assembleConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b) override
void postTimestepConcreteProcess(std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, const double t, const double dt, int const process_id) override
void constructDofTable() override
void initializeBoundaryConditions(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media) override
NumLib::LocalToGlobalIndexMap const & getDOFTable(const int) const override
StokesFlowProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > &&process_variables, StokesFlowProcessData &&process_data, SecondaryVariableCollection &&secondary_variables, bool const use_monolithic_scheme)
MathLib::MatrixSpecifications getMatrixSpecifications(const int) const override
void assemble(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalMatrix *M, GlobalMatrix *K, GlobalVector *b)
std::vector< Node * > getBaseNodes(std::vector< Element * > const &elements)
@ BY_LOCATION
Ordering data by spatial location.
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)