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

[PL] extrapolator moved to base process

parent 1685ce44
No related branches found
No related tags found
No related merge requests found
......@@ -53,27 +53,23 @@ void GroundwaterFlowProcess::initializeConcreteProcess(
mesh.getDimension(), mesh.getElements(), dof_table, integration_order,
_local_assemblers, _process_data);
// TODO Later on the DOF table can change during the simulation!
_extrapolator.reset(new ExtrapolatorImplementation(
Base::getMatrixSpecifications(), *Base::_local_to_global_index_map));
_secondary_variables.addSecondaryVariable(
"darcy_velocity_x", 1,
makeExtrapolator(
*_extrapolator, _local_assemblers,
getExtrapolator(), _local_assemblers,
&GroundwaterFlowLocalAssemblerInterface::getIntPtDarcyVelocityX));
if (mesh.getDimension() > 1) {
_secondary_variables.addSecondaryVariable(
"darcy_velocity_y", 1,
makeExtrapolator(*_extrapolator, _local_assemblers,
makeExtrapolator(getExtrapolator(), _local_assemblers,
&GroundwaterFlowLocalAssemblerInterface::
getIntPtDarcyVelocityY));
}
if (mesh.getDimension() > 2) {
_secondary_variables.addSecondaryVariable(
"darcy_velocity_z", 1,
makeExtrapolator(*_extrapolator, _local_assemblers,
makeExtrapolator(getExtrapolator(), _local_assemblers,
&GroundwaterFlowLocalAssemblerInterface::
getIntPtDarcyVelocityZ));
}
......
......@@ -42,11 +42,6 @@ public:
//! @}
private:
using ExtrapolatorInterface =
NumLib::Extrapolator;
using ExtrapolatorImplementation =
NumLib::LocalLinearLeastSquaresExtrapolator;
void initializeConcreteProcess(
NumLib::LocalToGlobalIndexMap const& dof_table,
MeshLib::Mesh const& mesh,
......@@ -60,8 +55,6 @@ private:
std::vector<std::unique_ptr<GroundwaterFlowLocalAssemblerInterface>>
_local_assemblers;
std::unique_ptr<ExtrapolatorInterface> _extrapolator;
};
} // namespace GroundwaterFlow
......
......@@ -175,28 +175,6 @@ void TESProcess::initializeConcreteProcess(
mesh.getDimension(), mesh.getElements(), dof_table, integration_order,
_local_assemblers, _assembly_params);
// TODO move the two data members somewhere else.
// for extrapolation of secondary variables
std::vector<std::unique_ptr<MeshLib::MeshSubsets>>
all_mesh_subsets_single_component;
all_mesh_subsets_single_component.emplace_back(
new MeshLib::MeshSubsets(this->_mesh_subset_all_nodes.get()));
_local_to_global_index_map_single_component.reset(
new NumLib::LocalToGlobalIndexMap(
std::move(all_mesh_subsets_single_component),
// by location order is needed for output
NumLib::ComponentOrder::BY_LOCATION));
{
auto const& l = *_local_to_global_index_map_single_component;
_extrapolator.reset(new ExtrapolatorImplementation(
MathLib::MatrixSpecifications(l.dofSizeWithoutGhosts(),
l.dofSizeWithoutGhosts(),
&l.getGhostIndices(),
nullptr),
l));
}
// secondary variables
auto add2nd = [&](std::string const& var_name, unsigned const n_components,
SecondaryVariableFunctions&& fcts) {
......@@ -206,8 +184,8 @@ void TESProcess::initializeConcreteProcess(
auto makeEx =
[&](std::vector<double> const& (TESLocalAssemblerInterface::*method)(
std::vector<double>&)const) -> SecondaryVariableFunctions {
return ProcessLib::makeExtrapolator(*_extrapolator, _local_assemblers,
method);
return ProcessLib::makeExtrapolator(getExtrapolator(),
_local_assemblers, method);
};
// add2nd("solid_density", 1, makeEx(TESIntPtVariables::SOLID_DENSITY));
......
......@@ -31,8 +31,6 @@ namespace TES
{
class TESProcess final : public Process
{
using BP = Process; //!< "Base Process"
public:
TESProcess(
MeshLib::Mesh& mesh,
......@@ -51,12 +49,8 @@ public:
NumLib::IterationResult postIteration(GlobalVector const& x) override;
bool isLinear() const override { return false; }
private:
using ExtrapolatorInterface =
NumLib::Extrapolator;
using ExtrapolatorImplementation =
NumLib::LocalLinearLeastSquaresExtrapolator;
private:
void initializeConcreteProcess(
NumLib::LocalToGlobalIndexMap const& dof_table,
MeshLib::Mesh const& mesh, unsigned const integration_order) override;
......@@ -87,8 +81,6 @@ private:
std::unique_ptr<NumLib::LocalToGlobalIndexMap>
_local_to_global_index_map_single_component;
std::unique_ptr<ExtrapolatorInterface> _extrapolator;
// used for checkBounds()
std::unique_ptr<GlobalVector> _x_previous_timestep;
};
......
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