Skip to content

Commit

Permalink
Merge branch 'remove_staggered_flag' into 'master'
Browse files Browse the repository at this point in the history
[ProcessLib] Remove the argument use_monolithic_scheme from two member functions

See merge request ogs/ogs!4954
  • Loading branch information
endJunction committed Mar 20, 2024
2 parents 356d624 + 6fc4a42 commit 740deee
Show file tree
Hide file tree
Showing 31 changed files with 22 additions and 55 deletions.
1 change: 0 additions & 1 deletion ProcessLib/ComponentTransport/ComponentTransportFEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,6 @@ class LocalAssemblerData : public ComponentTransportLocalAssemblerInterface
void postTimestepConcrete(Eigen::VectorXd const& /*local_x*/,
Eigen::VectorXd const& /*local_x_prev*/,
double const /*t*/, double const /*dt*/,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
unsigned const n_integration_points =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ void ComponentTransportProcess::postTimestepConcreteProcess(
GlobalExecutor::executeSelectedMemberOnDereferenced(
&ComponentTransportLocalAssemblerInterface::postTimestep,
_local_assemblers, pv.getActiveElementIDs(), dof_tables, x, x_prev, t,
dt, _use_monolithic_scheme, process_id);
dt, process_id);

if (!_surfaceflux) // computing the surfaceflux is optional
{
Expand Down
2 changes: 0 additions & 2 deletions ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,6 @@ void HydroMechanicsLocalAssembler<ShapeFunctionDisplacement,
postNonLinearSolverConcrete(std::vector<double> const& local_x,
std::vector<double> const& local_x_prev,
double const t, double const dt,
bool const /*use_monolithic_scheme*/,
int const process_id)
{
// Note: local_x and local_x_prev only contain the solutions of current
Expand Down Expand Up @@ -993,7 +992,6 @@ void HydroMechanicsLocalAssembler<
DisplacementDim>::postTimestepConcrete(Eigen::VectorXd const& local_x,
Eigen::VectorXd const& local_x_prev,
double const t, double const dt,
bool const /*use_monolithic_scheme*/,
int const process_id)
{
auto const staggered_scheme_ptr =
Expand Down
2 changes: 0 additions & 2 deletions ProcessLib/HydroMechanics/HydroMechanicsFEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ class HydroMechanicsLocalAssembler
void postTimestepConcrete(Eigen::VectorXd const& local_x,
Eigen::VectorXd const& local_x_prev,
double const t, double const dt,
bool const use_monolithic_scheme,
int const process_id) override;

void computeSecondaryVariableConcrete(
Expand All @@ -275,7 +274,6 @@ class HydroMechanicsLocalAssembler
void postNonLinearSolverConcrete(std::vector<double> const& local_x,
std::vector<double> const& local_x_prev,
double const t, double const dt,
bool const use_monolithic_scheme,
int const process_id) override;

void setInitialConditionsConcrete(std::vector<double> const& local_x,
Expand Down
5 changes: 2 additions & 3 deletions ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,7 @@ void HydroMechanicsProcess<DisplacementDim>::postTimestepConcreteProcess(

GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerIF::postTimestep, _local_assemblers,
getActiveElementIDs(), dof_tables, x, x_prev, t, dt, false /*unused*/,
process_id);
getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);
}

template <int DisplacementDim>
Expand All @@ -424,7 +423,7 @@ void HydroMechanicsProcess<DisplacementDim>::postNonLinearSolverConcreteProcess(
GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerIF::postNonLinearSolver, _local_assemblers,
getActiveElementIDs(), getDOFTable(process_id), x, x_prev, t, dt,
false /*unused*/, process_id);
process_id);
}

template <int DisplacementDim>
Expand Down
2 changes: 1 addition & 1 deletion ProcessLib/LIE/HydroMechanics/HydroMechanicsProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ void HydroMechanicsProcess<GlobalDim>::postTimestepConcreteProcess(
GlobalExecutor::executeSelectedMemberOnDereferenced(
&HydroMechanicsLocalAssemblerInterface::postTimestep,
_local_assemblers, pv.getActiveElementIDs(), dof_tables, x, x_prev,
t, dt, _use_monolithic_scheme, process_id);
t, dt, process_id);
}

DBUG("Compute the secondary variables for HydroMechanicsProcess.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ class HydroMechanicsLocalAssemblerInterface
void postTimestepConcrete(Eigen::VectorXd const& local_x_,
Eigen::VectorXd const& /*local_x_prev*/,
const double t, double const dt,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
_local_u.setZero();
Expand Down
1 change: 0 additions & 1 deletion ProcessLib/LargeDeformation/LargeDeformationFEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ class LargeDeformationLocalAssembler
void postTimestepConcrete(Eigen::VectorXd const& local_x,
Eigen::VectorXd const& local_x_prev,
double const t, double const dt,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
unsigned const n_integration_points =
Expand Down
3 changes: 1 addition & 2 deletions ProcessLib/LargeDeformation/LargeDeformationProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ void LargeDeformationProcess<DisplacementDim>::postTimestepConcreteProcess(
ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerInterface::postTimestep, _local_assemblers,
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt,
_use_monolithic_scheme, process_id);
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);
}

template <int DisplacementDim>
Expand Down
10 changes: 4 additions & 6 deletions ProcessLib/LocalAssemblerInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void LocalAssemblerInterface::postTimestep(
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,
bool const use_monolithic_scheme, int const process_id)
int const process_id)
{
std::vector<double> local_x_vec;
std::vector<double> local_x_prev_vec;
Expand All @@ -155,23 +155,21 @@ void LocalAssemblerInterface::postTimestep(
auto const local_x = MathLib::toVector(local_x_vec);
auto const local_x_prev = MathLib::toVector(local_x_prev_vec);

postTimestepConcrete(local_x, local_x_prev, t, dt, use_monolithic_scheme,
process_id);
postTimestepConcrete(local_x, local_x_prev, t, dt, process_id);
}

void LocalAssemblerInterface::postNonLinearSolver(
std::size_t const mesh_item_id,
NumLib::LocalToGlobalIndexMap const& dof_table,
std::vector<GlobalVector*> const& x,
std::vector<GlobalVector*> const& x_prev, double const t, double const dt,
bool const use_monolithic_scheme, int const process_id)
int const process_id)
{
auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
auto const local_x = x[process_id]->get(indices);
auto const local_x_prev = x_prev[process_id]->get(indices);

postNonLinearSolverConcrete(local_x, local_x_prev, t, dt,
use_monolithic_scheme, process_id);
postNonLinearSolverConcrete(local_x, local_x_prev, t, dt, process_id);
}

} // namespace ProcessLib
8 changes: 2 additions & 6 deletions ProcessLib/LocalAssemblerInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,13 @@ class LocalAssemblerInterface
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, bool const use_monolithic_scheme,
int const process_id);
double const dt, int const process_id);

void postNonLinearSolver(std::size_t const mesh_item_id,
NumLib::LocalToGlobalIndexMap const& dof_table,
std::vector<GlobalVector*> const& x,
std::vector<GlobalVector*> const& x_prev,
double const t, double const dt,
bool const use_monolithic_scheme,
int const process_id);

/// Computes the flux in the point \c p_local_coords that is given in local
Expand Down Expand Up @@ -138,16 +136,14 @@ class LocalAssemblerInterface
virtual void postTimestepConcrete(Eigen::VectorXd const& /*local_x*/,
Eigen::VectorXd const& /*local_x_prev*/,
double const /*t*/, double const /*dt*/,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/)
{
}

virtual void postNonLinearSolverConcrete(
std::vector<double> const& /*local_x*/,
std::vector<double> const& /*local_x_prev*/, double const /*t*/,
double const /*dt*/, bool const /*use_monolithic_scheme*/,
int const /*process_id*/)
double const /*dt*/, int const /*process_id*/)
{
}

Expand Down
1 change: 0 additions & 1 deletion ProcessLib/PhaseField/PhaseFieldFEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ class PhaseFieldLocalAssembler : public PhaseFieldLocalAssemblerInterface
void postTimestepConcrete(Eigen::VectorXd const& /*local_x*/,
Eigen::VectorXd const& /*local_x_prev*/,
double const /*t*/, double const /*dt*/,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
unsigned const n_integration_points =
Expand Down
1 change: 0 additions & 1 deletion ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ class RichardsMechanicsLocalAssembler
void postTimestepConcrete(Eigen::VectorXd const& /*local_x*/,
Eigen::VectorXd const& /*local_x_prev*/,
double const /*t*/, double const /*dt*/,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
unsigned const n_integration_points =
Expand Down
3 changes: 1 addition & 2 deletions ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,7 @@ void RichardsMechanicsProcess<DisplacementDim>::postTimestepConcreteProcess(
getProcessVariables(process_id)[0];
GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerIF::postTimestep, _local_assemblers,
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt,
_use_monolithic_scheme, process_id);
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);
}
}

Expand Down
1 change: 0 additions & 1 deletion ProcessLib/SmallDeformation/SmallDeformationFEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ class SmallDeformationLocalAssembler
void postTimestepConcrete(Eigen::VectorXd const& local_x,
Eigen::VectorXd const& local_x_prev,
double const t, double const dt,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
unsigned const n_integration_points =
Expand Down
3 changes: 1 addition & 2 deletions ProcessLib/SmallDeformation/SmallDeformationProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ void SmallDeformationProcess<DisplacementDim>::postTimestepConcreteProcess(
ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerInterface::postTimestep, _local_assemblers,
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt,
_use_monolithic_scheme, process_id);
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);

std::unique_ptr<GlobalVector> material_forces;
ProcessLib::SmallDeformation::writeMaterialForces(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@ class SmallDeformationNonlocalLocalAssembler
void postTimestepConcrete(Eigen::VectorXd const& /*local_x*/,
Eigen::VectorXd const& /*local_x_prev*/,
double const /*t*/, double const /*dt*/,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
unsigned const n_integration_points =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,7 @@ void SmallDeformationNonlocalProcess<DisplacementDim>::
ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerInterface::postTimestep, _local_assemblers,
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt,
_use_monolithic_scheme, process_id);
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);
}

template <int DisplacementDim>
Expand Down
3 changes: 1 addition & 2 deletions ProcessLib/StokesFlow/StokesFlowProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ void StokesFlowProcess<GlobalDim>::postTimestepConcreteProcess(
ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
GlobalExecutor::executeSelectedMemberOnDereferenced(
&StokesFlowLocalAssemblerInterface::postTimestep, _local_assemblers,
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt,
_use_monolithic_scheme, process_id);
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);
}

template <int GlobalDim>
Expand Down
1 change: 0 additions & 1 deletion ProcessLib/TH2M/TH2MFEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ class TH2MLocalAssembler : public LocalAssemblerInterface<DisplacementDim>
void postTimestepConcrete(Eigen::VectorXd const& /*local_x*/,
Eigen::VectorXd const& /*local_x_prev*/,
double const /*t*/, double const /*dt*/,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
unsigned const n_integration_points =
Expand Down
2 changes: 1 addition & 1 deletion ProcessLib/TH2M/TH2MProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ void TH2MProcess<DisplacementDim>::postTimestepConcreteProcess(
GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerInterface<DisplacementDim>::postTimestep,
local_assemblers_, pv.getActiveElementIDs(), dof_tables, x, x_prev, t,
dt, _use_monolithic_scheme, process_id);
dt, process_id);
}

template <int DisplacementDim>
Expand Down
1 change: 0 additions & 1 deletion ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ class ThermoHydroMechanicsLocalAssembler
void postTimestepConcrete(Eigen::VectorXd const& local_x,
Eigen::VectorXd const& local_x_prev,
double const t, double const dt,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
unsigned const n_integration_points =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ void ThermoHydroMechanicsProcess<DisplacementDim>::postTimestepConcreteProcess(
GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerInterface<DisplacementDim>::postTimestep,
_local_assemblers, pv.getActiveElementIDs(), dof_tables, x, x_prev, t,
dt, _use_monolithic_scheme, process_id);
dt, process_id);
}

template <int DisplacementDim>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ class ThermoMechanicalPhaseFieldLocalAssembler
void postTimestepConcrete(Eigen::VectorXd const& /*local_x*/,
Eigen::VectorXd const& /*local_x_prev*/,
double const /*t*/, double const /*dt*/,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
unsigned const n_integration_points =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ void ThermoMechanicalPhaseFieldProcess<DisplacementDim>::
GlobalExecutor::executeSelectedMemberOnDereferenced(
&ThermoMechanicalPhaseFieldLocalAssemblerInterface::postTimestep,
_local_assemblers, pv.getActiveElementIDs(), dof_tables, x, x_prev, t,
dt, _use_monolithic_scheme, process_id);
dt, process_id);
}

template <int DisplacementDim>
Expand All @@ -318,13 +318,12 @@ void ThermoMechanicalPhaseFieldProcess<DisplacementDim>::

DBUG("PostNonLinearSolver ThermoMechanicalPhaseFieldProcess.");
// Calculate strain, stress or other internal variables of mechanics.
const bool use_monolithic_scheme = false;
ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];

GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerInterface::postNonLinearSolver, _local_assemblers,
pv.getActiveElementIDs(), getDOFTable(process_id), x, x_prev, t, dt,
use_monolithic_scheme, process_id);
process_id);
}

template class ThermoMechanicalPhaseFieldProcess<2>;
Expand Down
1 change: 0 additions & 1 deletion ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ class ThermoMechanicsLocalAssembler
void postTimestepConcrete(Eigen::VectorXd const& /*local_x*/,
Eigen::VectorXd const& /*local_x_prev*/,
double const /*t*/, double const /*dt*/,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
unsigned const n_integration_points =
Expand Down
3 changes: 1 addition & 2 deletions ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,7 @@ void ThermoMechanicsProcess<DisplacementDim>::postTimestepConcreteProcess(
ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerInterface::postTimestep, _local_assemblers,
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt,
_use_monolithic_scheme, process_id);
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);
}

template <int DisplacementDim>
Expand Down
1 change: 0 additions & 1 deletion ProcessLib/ThermoRichardsFlow/ThermoRichardsFlowFEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class ThermoRichardsFlowLocalAssembler : public LocalAssemblerInterface
void postTimestepConcrete(Eigen::VectorXd const& /*local_x*/,
Eigen::VectorXd const& /*local_x_prev*/,
double const /*t*/, double const /*dt*/,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
unsigned const n_integration_points =
Expand Down
3 changes: 1 addition & 2 deletions ProcessLib/ThermoRichardsFlow/ThermoRichardsFlowProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ void ThermoRichardsFlowProcess::postTimestepConcreteProcess(
ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerIF::postTimestep, _local_assemblers,
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt,
_use_monolithic_scheme, process_id);
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);
}

void ThermoRichardsFlowProcess::computeSecondaryVariableConcrete(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ struct LocalAssemblerInterface : public ProcessLib::LocalAssemblerInterface,
void postTimestepConcrete(Eigen::VectorXd const& /*local_x*/,
Eigen::VectorXd const& /*local_x_prev*/,
double const /*t*/, double const /*dt*/,
bool const /*use_monolithic_scheme*/,
int const /*process_id*/) override
{
unsigned const n_integration_points =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ void ThermoRichardsMechanicsProcess<DisplacementDim, ConstitutiveTraits>::
ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerIF::postTimestep, local_assemblers_,
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt,
_use_monolithic_scheme, process_id);
pv.getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);
}

template <int DisplacementDim, typename ConstitutiveTraits>
Expand Down

0 comments on commit 740deee

Please sign in to comment.