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

Added a boolean member to class Process to distinguish the monolithic scheme...

Added a boolean member to class Process to distinguish the monolithic scheme and the staggered scheme
parent 86e4d488
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,8 @@ Process::Process(
_secondary_variables(std::move(secondary_variables)),
_named_function_caller(std::move(named_function_caller)),
_global_assembler(std::move(jacobian_assembler)),
_coupled_solutions(nullptr),
_is_monolithic_scheme(true),
_coupling_term(nullptr),
_integration_order(integration_order),
_process_variables(std::move(process_variables)),
_boundary_conditions(parameters)
......@@ -188,9 +189,19 @@ void Process::constructDofTable()
// Create a vector of the number of variable components
std::vector<int> vec_var_n_components;
for (ProcessVariable const& pv : _process_variables)
vec_var_n_components.push_back(pv.getNumberOfComponents());
if (_is_monolithic_scheme)
{
for (ProcessVariable const& pv : _process_variables)
vec_var_n_components.push_back(pv.getNumberOfComponents());
}
else // for staggered scheme
{
// 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.
vec_var_n_components.push_back(
_process_variables[0].get().getNumberOfComponents());
}
_local_to_global_index_map =
std::make_unique<NumLib::LocalToGlobalIndexMap>(
std::move(all_mesh_subsets), vec_var_n_components,
......
......@@ -77,9 +77,9 @@ public:
_coupled_solutions = coupled_solutions;
}
void preAssemble(const double t, GlobalVector const& x) override final;
virtual void setCoupledSolutionsForStaggeredSchemeToLocalAssemblers() {}
void preAssemble(const double t, GlobalVector const& x) override final;
void assemble(const double t, GlobalVector const& x, GlobalMatrix& M,
GlobalMatrix& K, GlobalVector& b) final;
......@@ -89,6 +89,11 @@ public:
GlobalMatrix& K, GlobalVector& b,
GlobalMatrix& Jac) final;
void setDecouplingSchemeType(const bool is_monolithic_scheme)
{
_is_monolithic_scheme = is_monolithic_scheme;
}
std::vector<NumLib::IndexValueVector<GlobalIndexType>> const*
getKnownSolutions(double const t) const final
{
......@@ -211,10 +216,11 @@ protected:
VectorMatrixAssembler _global_assembler;
mutable bool _is_monolithic_scheme;
/// Pointer to CoupledSolutionsForStaggeredScheme, which contains the
/// references to the
/// coupled processes and the references to the solutions of the coupled
/// processes.
/// references to the coupled processes and the references to the
/// solutions of the coupled processes.
CoupledSolutionsForStaggeredScheme* _coupled_solutions;
/// Order of the integration method for element-wise integration.
......
......@@ -336,9 +336,25 @@ std::vector<std::unique_ptr<SingleProcessData>> createPerProcessData(
}
if (per_process_data.size() != processes.size())
OGS_FATAL(
"Some processes have not been configured to be solved by this time "
"time loop.");
{
if (processes.size() > 1)
{
OGS_FATAL(
"Some processes have not been configured to be solved by this "
" time loop.");
}
else
{
const bool _is_monolithic_scheme = false;
for (auto const& process : processes)
{
process.second->setDecouplingSchemeType(_is_monolithic_scheme);
}
INFO(
"The equations of the coupled processes will be solved by the "
"staggered scheme.")
}
}
return per_process_data;
}
......
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