Skip to content
Snippets Groups Projects
Commit 8f7440e4 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[PL/CT] Provide information whether linear solver needs to compute

parent 0a6a8230
No related branches found
No related tags found
No related merge requests found
......@@ -44,15 +44,37 @@ ComponentTransportProcess::ComponentTransportProcess(
std::unique_ptr<ProcessLib::SurfaceFluxData>&& surfaceflux,
std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
chemical_solver_interface,
bool const is_linear)
bool const is_linear,
bool const ls_compute_only_upon_timestep_change)
: Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
integration_order, std::move(process_variables),
std::move(secondary_variables), use_monolithic_scheme),
_process_data(std::move(process_data)),
_surfaceflux(std::move(surfaceflux)),
_chemical_solver_interface(std::move(chemical_solver_interface)),
_asm_mat_cache{is_linear, use_monolithic_scheme}
_asm_mat_cache{is_linear, use_monolithic_scheme},
_ls_compute_only_upon_timestep_change{
ls_compute_only_upon_timestep_change}
{
if (ls_compute_only_upon_timestep_change)
{
if (!is_linear)
{
OGS_FATAL(
"Using the linear solver compute() method only upon timestep "
"change only makes sense for linear model equations.");
}
WARN(
"You specified that the ComponentTransport linear solver will do "
"the compute() step only upon timestep change. This is an expert "
"option. It is your responsibility to ensure that "
"the conditions for the correct use of this feature are met! "
"Otherwise OGS might compute garbage without being recognized. "
"There is no "
"safety net!");
}
_residua.push_back(MeshLib::getOrCreateMeshProperty<double>(
mesh, "LiquidMassFlowRate", MeshLib::MeshItemType::Node, 1));
......
......@@ -111,7 +111,8 @@ public:
std::unique_ptr<ProcessLib::SurfaceFluxData>&& surfaceflux,
std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
chemical_solver_interface,
bool const is_linear);
bool const is_linear,
bool const ls_compute_only_upon_timestep_change);
//! \name ODESystem interface
//! @{
......@@ -141,6 +142,11 @@ public:
const double dt,
int const process_id) override;
bool shouldLinearSolverComputeOnlyUponTimestepChange() const override
{
return _ls_compute_only_upon_timestep_change;
}
private:
void initializeConcreteProcess(
NumLib::LocalToGlobalIndexMap const& dof_table,
......@@ -176,6 +182,8 @@ private:
std::vector<MeshLib::PropertyVector<double>*> _residua;
AssembledMatrixCache _asm_mat_cache;
bool const _ls_compute_only_upon_timestep_change;
};
} // namespace ComponentTransport
......
......@@ -256,6 +256,11 @@ std::unique_ptr<Process> createComponentTransportProcess(
//! \ogs_file_param{prj__processes__process__ComponentTransport__is_linear}
config.getConfigParameter("is_linear", false);
auto const ls_compute_only_upon_timestep_change =
//! \ogs_file_param{prj__processes__process__ComponentTransport__linear_solver_compute_only_upon_timestep_change}
config.getConfigParameter(
"linear_solver_compute_only_upon_timestep_change", false);
auto const rotation_matrices = MeshLib::getElementRotationMatrices(
mesh_space_dimension, mesh.getDimension(), mesh.getElements());
std::vector<Eigen::VectorXd> projected_specific_body_force_vectors;
......@@ -298,7 +303,8 @@ std::unique_ptr<Process> createComponentTransportProcess(
integration_order, std::move(process_variables),
std::move(process_data), std::move(secondary_variables),
use_monolithic_scheme, std::move(surfaceflux),
std::move(chemical_solver_interface), is_linear);
std::move(chemical_solver_interface), is_linear,
ls_compute_only_upon_timestep_change);
}
} // namespace ComponentTransport
......
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