Skip to content
Snippets Groups Projects
Commit d12f49ce authored by wenqing's avatar wenqing
Browse files

[Coupling] Modified Process::constructDofTable() for the assembly of coupled equations

 in one class either with the monolithic scheme or with the staggered scheme.
parent e70228a5
No related branches found
No related tags found
No related merge requests found
......@@ -175,22 +175,25 @@ void Process::constructDofTable()
_mesh_subset_all_nodes =
std::make_unique<MeshLib::MeshSubset>(_mesh, &_mesh.getNodes());
// Collect the mesh subsets in a vector.
// Vector of mesh subsets.
std::vector<MeshLib::MeshSubsets> all_mesh_subsets;
for (ProcessVariable const& pv : _process_variables)
{
std::generate_n(
std::back_inserter(all_mesh_subsets),
pv.getNumberOfComponents(),
[&]() {
return MeshLib::MeshSubsets{_mesh_subset_all_nodes.get()};
});
}
// Create a vector of the number of variable components
// Vector of the number of variable components
std::vector<int> vec_var_n_components;
if (_is_monolithic_scheme)
{
// Collect the mesh subsets in a vector.
for (ProcessVariable const& pv : _process_variables)
{
std::generate_n(
std::back_inserter(all_mesh_subsets),
pv.getNumberOfComponents(),
[&]() {
return MeshLib::MeshSubsets{_mesh_subset_all_nodes.get()};
});
}
// Create a vector of the number of variable components
for (ProcessVariable const& pv : _process_variables)
vec_var_n_components.push_back(pv.getNumberOfComponents());
}
......@@ -199,6 +202,16 @@ void Process::constructDofTable()
// Assuming that all equations of the coupled process use the same
// element order. Other cases can be considered by overloading this
// member function in the derived class.
// Collect the mesh subsets in a vector.
std::generate_n(
std::back_inserter(all_mesh_subsets),
_process_variables[0].get().getNumberOfComponents(),
[&]() {
return MeshLib::MeshSubsets{_mesh_subset_all_nodes.get()};
});
// Create a vector of the number of variable components.
vec_var_n_components.push_back(
_process_variables[0].get().getNumberOfComponents());
}
......@@ -213,7 +226,8 @@ void Process::initializeExtrapolator()
NumLib::LocalToGlobalIndexMap const* dof_table_single_component;
bool manage_storage;
if (_local_to_global_index_map->getNumberOfComponents() == 1)
if (_local_to_global_index_map->getNumberOfComponents() == 1 ||
!_is_monolithic_scheme)
{
// For single-variable-single-component processes reuse the existing DOF
// table.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment