diff --git a/ProcessLib/StaggeredCouplingTerm.cpp b/ProcessLib/StaggeredCouplingTerm.cpp index a6468487e85ee94465d003347c91cd093ed460cc..a6c7b0da65dcde82471730a9aaa7159c9c0a0fa6 100644 --- a/ProcessLib/StaggeredCouplingTerm.cpp +++ b/ProcessLib/StaggeredCouplingTerm.cpp @@ -23,4 +23,25 @@ const StaggeredCouplingTerm createVoidStaggeredCouplingTerm() return StaggeredCouplingTerm(coupled_processes, coupled_xs, 0.0, empty); } +std::unordered_map<std::type_index, const std::vector<double>> +getCurrentLocalSolutionsOfCoupledProcesses( + const std::unordered_map<std::type_index, GlobalVector const&>& + global_coupled_xs, + const std::vector<GlobalIndexType>& indices) +{ + std::unordered_map<std::type_index, const std::vector<double>> + local_coupled_xs; + + // Get local nodal solutions of the coupled equations. + for (auto const& global_coupled_x_pair : global_coupled_xs) + { + auto const& coupled_x = global_coupled_x_pair.second; + auto const local_coupled_x = coupled_x.get(indices); + BaseLib::insertIfTypeIndexKeyUniqueElseError( + local_coupled_xs, global_coupled_x_pair.first, local_coupled_x, + "local_coupled_x"); + } + return local_coupled_xs; +} + } // end of ProcessLib diff --git a/ProcessLib/StaggeredCouplingTerm.h b/ProcessLib/StaggeredCouplingTerm.h index 8089d0a07e0103b14d0b562544f46815fbb6992a..8e362536a174a17e2f3df526815b912eda275757 100644 --- a/ProcessLib/StaggeredCouplingTerm.h +++ b/ProcessLib/StaggeredCouplingTerm.h @@ -104,4 +104,10 @@ struct LocalCouplingTerm */ const StaggeredCouplingTerm createVoidStaggeredCouplingTerm(); +std::unordered_map<std::type_index, const std::vector<double>> +getCurrentLocalSolutionsOfCoupledProcesses( + const std::unordered_map<std::type_index, GlobalVector const&>& + global_coupled_xs, + const std::vector<GlobalIndexType>& indices); + } // end of ProcessLib diff --git a/ProcessLib/VectorMatrixAssembler.cpp b/ProcessLib/VectorMatrixAssembler.cpp index a82bd7893396397cfea906f41a591b299fb88776..ba007e7734d300e96a67400aa05d5e0c459f26ba 100644 --- a/ProcessLib/VectorMatrixAssembler.cpp +++ b/ProcessLib/VectorMatrixAssembler.cpp @@ -49,27 +49,6 @@ getPreviousLocalSolutionsOfCoupledProcesses( return local_coupled_xs0; } -static std::unordered_map<std::type_index, const std::vector<double>> -getCurrentLocalSolutionsOfCoupledProcesses( - const std::unordered_map<std::type_index, GlobalVector const&>& - global_coupled_xs, - const std::vector<GlobalIndexType>& indices) -{ - std::unordered_map<std::type_index, const std::vector<double>> - local_coupled_xs; - - // Get local nodal solutions of the coupled equations. - for (auto const& global_coupled_x_pair : global_coupled_xs) - { - auto const& coupled_x = global_coupled_x_pair.second; - auto const local_coupled_x = coupled_x.get(indices); - BaseLib::insertIfTypeIndexKeyUniqueElseError( - local_coupled_xs, global_coupled_x_pair.first, local_coupled_x, - "local_coupled_x"); - } - return local_coupled_xs; -} - VectorMatrixAssembler::VectorMatrixAssembler( std::unique_ptr<AbstractJacobianAssembler>&& jacobian_assembler) : _jacobian_assembler(std::move(jacobian_assembler))