diff --git a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.cpp b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.cpp index 5caf1007c06cf6a4e7af6e4e9c0ea1930dde5377..6aa0b2a37c7814eb3cb8f7468c6c62dec7d11a13 100644 --- a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.cpp +++ b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.cpp @@ -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)); } diff --git a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h index 8ea98af4e6c86744520189811dcc6492f694f9ba..1c5254d2f2b708bf8af7c8f996155bc2bf22a8c5 100644 --- a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h +++ b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h @@ -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 diff --git a/ProcessLib/TES/TESProcess.cpp b/ProcessLib/TES/TESProcess.cpp index a73f5571f1adb4ce193d3c98a6cfcc39c73415b2..3d00df47d7b99c767cb5a5faa6d805c638384977 100644 --- a/ProcessLib/TES/TESProcess.cpp +++ b/ProcessLib/TES/TESProcess.cpp @@ -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)); diff --git a/ProcessLib/TES/TESProcess.h b/ProcessLib/TES/TESProcess.h index 3f670b68db058379135ca06411e0cebf042109d1..f57c30706f1c2957870d69eced29a5c450af6b6e 100644 --- a/ProcessLib/TES/TESProcess.h +++ b/ProcessLib/TES/TESProcess.h @@ -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; };