Skip to content
Snippets Groups Projects
Commit 9ae5f58b authored by Dmitri Naumov's avatar Dmitri Naumov Committed by GitHub
Browse files

Merge pull request #1464 from endJunction/IntegrationOrderInput

Integration order in project files.
parents dc9f7b7c c86740b5
No related branches found
No related tags found
No related merge requests found
Showing
with 72 additions and 41 deletions
......@@ -265,6 +265,10 @@ void ProjectData::parseProcesses(BaseLib::ConfigTree const& processes_config,
//! \ogs_file_param{process__name}
auto const name = process_config.getConfigParameter<std::string>("name");
auto const integration_order =
//! \ogs_file_param{process__integration_order}
process_config.getConfigParameter<int>("integration_order");
std::unique_ptr<ProcessLib::Process> process;
auto jacobian_assembler = ProcessLib::createJacobianAssembler(
......@@ -280,20 +284,22 @@ void ProjectData::parseProcesses(BaseLib::ConfigTree const& processes_config,
// here.
process = ProcessLib::GroundwaterFlow::createGroundwaterFlowProcess(
*_mesh_vec[0], std::move(jacobian_assembler),
_process_variables, _parameters, process_config,
project_directory, output_directory);
_process_variables, _parameters, integration_order,
process_config, project_directory, output_directory);
}
else if (type == "TES")
{
process = ProcessLib::TES::createTESProcess(
*_mesh_vec[0], std::move(jacobian_assembler),
_process_variables, _parameters, process_config);
_process_variables, _parameters, integration_order,
process_config);
}
else if (type == "HEAT_CONDUCTION")
{
process = ProcessLib::HeatConduction::createHeatConductionProcess(
*_mesh_vec[0], std::move(jacobian_assembler),
_process_variables, _parameters, process_config);
_process_variables, _parameters, integration_order,
process_config);
}
else if (type == "SMALL_DEFORMATION")
{
......@@ -304,13 +310,15 @@ void ProjectData::parseProcesses(BaseLib::ConfigTree const& processes_config,
process = ProcessLib::SmallDeformation::
createSmallDeformationProcess<2>(
*_mesh_vec[0], std::move(jacobian_assembler),
_process_variables, _parameters, process_config);
_process_variables, _parameters, integration_order,
process_config);
break;
case 3:
process = ProcessLib::SmallDeformation::
createSmallDeformationProcess<3>(
*_mesh_vec[0], std::move(jacobian_assembler),
_process_variables, _parameters, process_config);
_process_variables, _parameters, integration_order,
process_config);
break;
default:
OGS_FATAL(
......
......@@ -15,8 +15,10 @@
namespace ProcessLib
{
CalculateSurfaceFlux::CalculateSurfaceFlux(MeshLib::Mesh& boundary_mesh,
std::size_t bulk_property_number_of_components)
CalculateSurfaceFlux::CalculateSurfaceFlux(
MeshLib::Mesh& boundary_mesh,
std::size_t bulk_property_number_of_components,
unsigned const integration_order)
{
DBUG("Create local balance assemblers.");
// Populate the vector of local assemblers.
......@@ -53,7 +55,6 @@ CalculateSurfaceFlux::CalculateSurfaceFlux(MeshLib::Mesh& boundary_mesh,
if (!bulk_face_ids)
OGS_FATAL("OriginalFaceIDs boundary mesh property not found.");
const unsigned integration_order = 2;
ProcessLib::createLocalAssemblers<CalculateSurfaceFluxLocalAssembler>(
boundary_mesh.getDimension() + 1, // or bulk_mesh.getDimension()?
boundary_mesh.getElements(), *dof_table, _local_assemblers,
......
......@@ -22,8 +22,10 @@ public:
/// @param mesh This mesh represents the boundary that is integrated over.
/// @param bulk_property_number_of_components The number of components the
/// variable has.
/// @param integration_order Integration order used in local assembly.
CalculateSurfaceFlux(MeshLib::Mesh& boundary_mesh,
std::size_t bulk_property_number_of_components);
std::size_t bulk_property_number_of_components,
unsigned const integration_order);
/// Executes for each element of the mesh the local intergration procedure.
/// @param x The global solution the intergration values will be fetched of.
......
......@@ -26,6 +26,7 @@ std::unique_ptr<Process> createGroundwaterFlowProcess(
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<ProcessVariable> const& variables,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
BaseLib::ConfigTree const& config,
std::string const& project_directory,
std::string const& output_directory)
......@@ -88,7 +89,7 @@ std::unique_ptr<Process> createGroundwaterFlowProcess(
}
return std::unique_ptr<Process>{new GroundwaterFlowProcess{
mesh, std::move(jacobian_assembler), parameters,
mesh, std::move(jacobian_assembler), parameters, integration_order,
std::move(process_variables), std::move(process_data),
std::move(secondary_variables), std::move(named_function_caller),
surface_mesh.release(), std::move(balance_pv_name),
......
......@@ -23,6 +23,7 @@ std::unique_ptr<Process> createGroundwaterFlowProcess(
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<ProcessVariable> const& variables,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
BaseLib::ConfigTree const& config,
std::string const& project_directory,
std::string const& output_directory);
......
......@@ -21,6 +21,7 @@ GroundwaterFlowProcess::GroundwaterFlowProcess(
MeshLib::Mesh& mesh,
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
std::vector<std::reference_wrapper<ProcessVariable>>&& process_variables,
GroundwaterFlowProcessData&& process_data,
SecondaryVariableCollection&& secondary_variables,
......@@ -29,8 +30,8 @@ GroundwaterFlowProcess::GroundwaterFlowProcess(
std::string&& balance_pv_name,
std::string&& balance_out_fname)
: Process(mesh, std::move(jacobian_assembler), parameters,
std::move(process_variables), std::move(secondary_variables),
std::move(named_function_caller)),
integration_order, std::move(process_variables),
std::move(secondary_variables), std::move(named_function_caller)),
_process_data(std::move(process_data)),
_balance_mesh(balance_mesh),
_balance_pv_name(std::move(balance_pv_name)),
......
......@@ -34,6 +34,7 @@ public:
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&&
jacobian_assembler,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
std::vector<std::reference_wrapper<ProcessVariable>>&&
process_variables,
GroundwaterFlowProcessData&& process_data,
......@@ -72,7 +73,8 @@ public:
init_values);
auto balance = ProcessLib::CalculateSurfaceFlux(
*_balance_mesh,
getProcessVariables()[0].get().getNumberOfComponents());
getProcessVariables()[0].get().getNumberOfComponents(),
_integration_order);
boost::optional<MeshLib::PropertyVector<double>&> balance_pv(
_balance_mesh->getProperties()
......
......@@ -23,6 +23,7 @@ std::unique_ptr<Process> createHeatConductionProcess(
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<ProcessVariable> const& variables,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
BaseLib::ConfigTree const& config)
{
//! \ogs_file_param{process__type}
......@@ -73,7 +74,7 @@ std::unique_ptr<Process> createHeatConductionProcess(
named_function_caller);
return std::unique_ptr<Process>{new HeatConductionProcess{
mesh, std::move(jacobian_assembler), parameters,
mesh, std::move(jacobian_assembler), parameters, integration_order,
std::move(process_variables), std::move(process_data),
std::move(secondary_variables), std::move(named_function_caller)}};
}
......
......@@ -22,6 +22,7 @@ std::unique_ptr<Process> createHeatConductionProcess(
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<ProcessVariable> const& variables,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
BaseLib::ConfigTree const& config);
} // namespace HeatConduction
......
......@@ -21,13 +21,14 @@ HeatConductionProcess::HeatConductionProcess(
MeshLib::Mesh& mesh,
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
std::vector<std::reference_wrapper<ProcessVariable>>&& process_variables,
HeatConductionProcessData&& process_data,
SecondaryVariableCollection&& secondary_variables,
NumLib::NamedFunctionCaller&& named_function_caller)
: Process(mesh, std::move(jacobian_assembler), parameters,
std::move(process_variables), std::move(secondary_variables),
std::move(named_function_caller)),
integration_order, std::move(process_variables),
std::move(secondary_variables), std::move(named_function_caller)),
_process_data(std::move(process_data))
{
}
......
......@@ -28,6 +28,7 @@ public:
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&&
jacobian_assembler,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
std::vector<std::reference_wrapper<ProcessVariable>>&&
process_variables,
HeatConductionProcessData&& process_data,
......
......@@ -22,6 +22,7 @@ Process::Process(
MeshLib::Mesh& mesh,
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
std::vector<std::reference_wrapper<ProcessVariable>>&& process_variables,
SecondaryVariableCollection&& secondary_variables,
NumLib::NamedFunctionCaller&& named_function_caller)
......@@ -29,6 +30,7 @@ Process::Process(
_secondary_variables(std::move(secondary_variables)),
_named_function_caller(std::move(named_function_caller)),
_global_assembler(std::move(jacobian_assembler)),
_integration_order(integration_order),
_process_variables(std::move(process_variables)),
_boundary_conditions(parameters)
{
......
......@@ -40,15 +40,14 @@ public:
using NonlinearSolver = NumLib::NonlinearSolverBase;
using TimeDiscretization = NumLib::TimeDiscretization;
Process(
MeshLib::Mesh& mesh,
std::unique_ptr<AbstractJacobianAssembler>&&
jacobian_assembler,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
std::vector<std::reference_wrapper<ProcessVariable>>&&
process_variables,
SecondaryVariableCollection&& secondary_variables,
NumLib::NamedFunctionCaller&& named_function_caller);
Process(MeshLib::Mesh& mesh,
std::unique_ptr<AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
std::vector<std::reference_wrapper<ProcessVariable>>&&
process_variables,
SecondaryVariableCollection&& secondary_variables,
NumLib::NamedFunctionCaller&& named_function_caller);
/// Preprocessing before starting assembly for new timestep.
void preTimestep(GlobalVector const& x, const double t,
......@@ -182,8 +181,9 @@ protected:
VectorMatrixAssembler _global_assembler;
unsigned const _integration_order;
private:
unsigned const _integration_order = 2;
GlobalSparsityPattern _sparsity_pattern;
/// Variables used by this process.
......
......@@ -35,6 +35,7 @@ createSmallDeformationProcess(
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<ProcessVariable> const& variables,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
BaseLib::ConfigTree const& config)
{
//! \ogs_file_param{process__type}
......@@ -104,7 +105,7 @@ createSmallDeformationProcess(
return std::unique_ptr<SmallDeformationProcess<DisplacementDim>>{
new SmallDeformationProcess<DisplacementDim>{
mesh, std::move(jacobian_assembler), parameters,
mesh, std::move(jacobian_assembler), parameters, integration_order,
std::move(process_variables), std::move(process_data),
std::move(secondary_variables), std::move(named_function_caller)}};
}
......@@ -114,6 +115,7 @@ template std::unique_ptr<Process> createSmallDeformationProcess<2>(
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<ProcessVariable> const& variables,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
BaseLib::ConfigTree const& config);
template std::unique_ptr<Process> createSmallDeformationProcess<3>(
......@@ -121,6 +123,7 @@ template std::unique_ptr<Process> createSmallDeformationProcess<3>(
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<ProcessVariable> const& variables,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
BaseLib::ConfigTree const& config);
} // namespace SmallDeformation
......
......@@ -23,6 +23,7 @@ std::unique_ptr<Process> createSmallDeformationProcess(
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<ProcessVariable> const& variables,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
BaseLib::ConfigTree const& config);
} // namespace SmallDeformation
......
......@@ -33,13 +33,15 @@ public:
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&&
jacobian_assembler,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
std::vector<std::reference_wrapper<ProcessVariable>>&&
process_variables,
SmallDeformationProcessData<DisplacementDim>&& process_data,
SecondaryVariableCollection&& secondary_variables,
NumLib::NamedFunctionCaller&& named_function_caller)
: Process(mesh, std::move(jacobian_assembler), parameters,
std::move(process_variables), std::move(secondary_variables),
integration_order, std::move(process_variables),
std::move(secondary_variables),
std::move(named_function_caller)),
_process_data(std::move(process_data))
{
......
......@@ -21,6 +21,7 @@ std::unique_ptr<Process> createTESProcess(
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<ProcessVariable> const& variables,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
BaseLib::ConfigTree const& config)
{
//! \ogs_file_param{process__type}
......@@ -41,7 +42,7 @@ std::unique_ptr<Process> createTESProcess(
named_function_caller);
return std::unique_ptr<Process>{new TESProcess{
mesh, std::move(jacobian_assembler), parameters,
mesh, std::move(jacobian_assembler), parameters, integration_order,
std::move(process_variables), std::move(secondary_variables),
std::move(named_function_caller), config}};
}
......
......@@ -22,6 +22,7 @@ std::unique_ptr<Process> createTESProcess(
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<ProcessVariable> const& variables,
std::vector<std::unique_ptr<ParameterBase>> const& /*parameters*/,
unsigned const integration_order,
BaseLib::ConfigTree const& config);
} // namespace TES
......
......@@ -20,13 +20,14 @@ TESProcess::TESProcess(
MeshLib::Mesh& mesh,
std::unique_ptr<AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
std::vector<std::reference_wrapper<ProcessVariable>>&& process_variables,
SecondaryVariableCollection&& secondary_variables,
NumLib::NamedFunctionCaller&& named_function_caller,
const BaseLib::ConfigTree& config)
: Process(mesh, std::move(jacobian_assembler), parameters,
std::move(process_variables), std::move(secondary_variables),
std::move(named_function_caller))
integration_order, std::move(process_variables),
std::move(secondary_variables), std::move(named_function_caller))
{
DBUG("Create TESProcess.");
......
......@@ -31,15 +31,15 @@ namespace TES
class TESProcess final : public Process
{
public:
TESProcess(
MeshLib::Mesh& mesh,
std::unique_ptr<AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
std::vector<std::reference_wrapper<ProcessVariable>>&&
process_variables,
SecondaryVariableCollection&& secondary_variables,
NumLib::NamedFunctionCaller&& named_function_caller,
BaseLib::ConfigTree const& config);
TESProcess(MeshLib::Mesh& mesh,
std::unique_ptr<AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
std::vector<std::reference_wrapper<ProcessVariable>>&&
process_variables,
SecondaryVariableCollection&& secondary_variables,
NumLib::NamedFunctionCaller&& named_function_caller,
BaseLib::ConfigTree const& config);
void preTimestepConcreteProcess(GlobalVector const& x, const double t,
const double delta_t) override;
......
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