Commit a8463128 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#531 Remove part of the code made obsolete by present ticket. Much is still to...

#531 Remove part of the code made obsolete by present ticket. Much is still to be removed (some as comments have been let at the moment to healp write the new ones, and others such as TwoUnknowns monolithic are still required while the non monolithic Stokes doesn't work again).
parent ef82aca9
......@@ -236,9 +236,6 @@
BE4CD1311A89F5FE00EEDB5F /* State.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE4CD12E1A89F5FE00EEDB5F /* State.hxx */; };
BE4DDE8F1AE1332900D60CCC /* GlobalMatrixOrVectorPropertiesStorage.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE4DDE871AE1332900D60CCC /* GlobalMatrixOrVectorPropertiesStorage.hpp */; };
BE4DDE901AE1332900D60CCC /* GlobalMatrixOrVectorPropertiesStorage.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE4DDE881AE1332900D60CCC /* GlobalMatrixOrVectorPropertiesStorage.hxx */; };
BE4DDE911AE1332900D60CCC /* GlobalLinearAlgebraHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE4DDE891AE1332900D60CCC /* GlobalLinearAlgebraHelper.cpp */; };
BE4DDE921AE1332900D60CCC /* GlobalLinearAlgebraHelper.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE4DDE8A1AE1332900D60CCC /* GlobalLinearAlgebraHelper.hpp */; };
BE4DDE931AE1332900D60CCC /* GlobalLinearAlgebraHelper.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE4DDE8B1AE1332900D60CCC /* GlobalLinearAlgebraHelper.hxx */; };
BE4DDE941AE1332900D60CCC /* GlobalVariationalOperator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE4DDE8C1AE1332900D60CCC /* GlobalVariationalOperator.cpp */; };
BE4DDE951AE1332900D60CCC /* GlobalVariationalOperator.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE4DDE8D1AE1332900D60CCC /* GlobalVariationalOperator.hpp */; };
BE4DDE961AE1332900D60CCC /* GlobalVariationalOperator.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE4DDE8E1AE1332900D60CCC /* GlobalVariationalOperator.hxx */; };
......@@ -1943,9 +1940,6 @@
BE4CD12E1A89F5FE00EEDB5F /* State.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = State.hxx; sourceTree = "<group>"; };
BE4DDE871AE1332900D60CCC /* GlobalMatrixOrVectorPropertiesStorage.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GlobalMatrixOrVectorPropertiesStorage.hpp; sourceTree = "<group>"; };
BE4DDE881AE1332900D60CCC /* GlobalMatrixOrVectorPropertiesStorage.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GlobalMatrixOrVectorPropertiesStorage.hxx; sourceTree = "<group>"; };
BE4DDE891AE1332900D60CCC /* GlobalLinearAlgebraHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GlobalLinearAlgebraHelper.cpp; sourceTree = "<group>"; };
BE4DDE8A1AE1332900D60CCC /* GlobalLinearAlgebraHelper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GlobalLinearAlgebraHelper.hpp; sourceTree = "<group>"; };
BE4DDE8B1AE1332900D60CCC /* GlobalLinearAlgebraHelper.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GlobalLinearAlgebraHelper.hxx; sourceTree = "<group>"; };
BE4DDE8C1AE1332900D60CCC /* GlobalVariationalOperator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GlobalVariationalOperator.cpp; sourceTree = "<group>"; };
BE4DDE8D1AE1332900D60CCC /* GlobalVariationalOperator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GlobalVariationalOperator.hpp; sourceTree = "<group>"; };
BE4DDE8E1AE1332900D60CCC /* GlobalVariationalOperator.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GlobalVariationalOperator.hxx; sourceTree = "<group>"; };
......@@ -3344,9 +3338,6 @@
BE4DDE851AE1332900D60CCC /* Private */ = {
isa = PBXGroup;
children = (
BE4DDE891AE1332900D60CCC /* GlobalLinearAlgebraHelper.cpp */,
BE4DDE8A1AE1332900D60CCC /* GlobalLinearAlgebraHelper.hpp */,
BE4DDE8B1AE1332900D60CCC /* GlobalLinearAlgebraHelper.hxx */,
BE4DDE8C1AE1332900D60CCC /* GlobalVariationalOperator.cpp */,
BE4DDE8D1AE1332900D60CCC /* GlobalVariationalOperator.hpp */,
BE4DDE8E1AE1332900D60CCC /* GlobalVariationalOperator.hxx */,
......@@ -5445,7 +5436,6 @@
BE90E1031A2491AE00CCAFDE /* QuadratureRuleList.hxx in Headers */,
BEA3FA8C1AF10CFB00D3F871 /* Recursivity.hpp in Headers */,
BE90E13A1A2491AE00CCAFDE /* DirichletBoundaryCondition.hxx in Headers */,
BE4DDE931AE1332900D60CCC /* GlobalLinearAlgebraHelper.hxx in Headers */,
BE90E1371A2491AE00CCAFDE /* ComponentManager.hxx in Headers */,
BE90E1001A2491AE00CCAFDE /* QuadratureRule.hpp in Headers */,
BE2B663C1A2778C700E80864 /* HexahedronQ2c.hpp in Headers */,
......@@ -5458,7 +5448,6 @@
BE90E0B41A2491AE00CCAFDE /* Component.hpp in Headers */,
BE90E1551A2491AE00CCAFDE /* CompNA.hpp in Headers */,
BEA3FA7F1AF10AA000D3F871 /* Recursivity.hpp in Headers */,
BE4DDE921AE1332900D60CCC /* GlobalLinearAlgebraHelper.hpp in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -6440,7 +6429,6 @@
BE90E0A81A2491AE00CCAFDE /* CiarletGeymonat.cpp in Sources */,
BE90E0FC1A2491AE00CCAFDE /* QuadraturePoint.cpp in Sources */,
BE90E0881A2491AE00CCAFDE /* Mass.cpp in Sources */,
BE4DDE911AE1332900D60CCC /* GlobalLinearAlgebraHelper.cpp in Sources */,
BE4054031AC196480024D5F9 /* FEltSpace.cpp in Sources */,
BE90E11E1A2491AE00CCAFDE /* UnknownManager.cpp in Sources */,
BE90E1521A2491AE00CCAFDE /* Comp3.cpp in Sources */,
......
......@@ -28,7 +28,6 @@
# include "FiniteElement/FiniteElement/EnumFiniteElt.hpp"
# include "FiniteElement/FiniteElement/LocalFEltSpace.hpp"
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/GlobalVariationalOperator.hpp"
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/GlobalLinearAlgebraHelper.hpp"
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/Recursivity.hpp"
......@@ -320,17 +319,7 @@ namespace HappyHeart
* \param[in] global_linear_algebra Structure which holds the global matrix and/or vector into which assembling
* is to be done. This is used here solely to recover the coefficients to apply.
*/
template<MatrixVectorNature LinearAlgebraNatureT>
void PerformElementaryCalculation(const LocalFEltSpace& local_felt_space,
LocalVariationalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<LinearAlgebraNatureT>& global_linear_algebra,
std::tuple<>&&) const;
// void PerformElementaryCalculation(const LocalFEltSpace& local_felt_space,
// LocalVariationalOperatorT& local_operator,
// std::tuple<>&&) const;
/*!
* \brief Overload when there variadic arguments to handle.
*
......@@ -347,11 +336,7 @@ namespace HappyHeart
* the local ones.
*
*/
template<MatrixVectorNature LinearAlgebraNatureT, typename... Args>
void PerformElementaryCalculation(const LocalFEltSpace& local_felt_space,
LocalVariationalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<LinearAlgebraNatureT>& global_linear_algebra,
std::tuple<Args...>&& args) const;
template<typename... Args>
void PerformElementaryCalculation531(const LocalFEltSpace& local_felt_space,
......
......@@ -339,39 +339,7 @@ namespace HappyHeart
return it != local_operator_per_ref_geom_elt_.cend();
}
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
>
template<MatrixVectorNature MatrixVectorNatureT, typename... Args>
void
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
::PerformElementaryCalculation(const LocalFEltSpace& local_felt_space,
LocalVariationalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNatureT>& global_linear_algebra,
std::tuple<Args...>&& additional_arguments) const
{
auto&& compute_elt_array_variadic_arguments =
static_cast<const DerivedT*>(this)->SupplArgumentsComputeEltArray(local_operator,
local_felt_space,
std::move(additional_arguments));
auto&& coefficient_list =
Private::AssemblingHelper<GetMatrixVectorNature(), MatrixVectorNatureT>::GetCoefficientList(global_linear_algebra);
auto&& compute_elt_array_arguments = std::tuple_cat(coefficient_list,
compute_elt_array_variadic_arguments);
Utilities::Tuple::CallMethodWithArgumentsFromTuple<void>(local_operator,
&LocalVariationalOperatorT::template ComputeEltArray<MatrixVectorNatureT>,
compute_elt_array_arguments);
}
template
<
......@@ -418,28 +386,6 @@ namespace HappyHeart
local_operator.template ComputeEltArray<LocalVariationalOperatorT::GetMatrixVectorNature()>();
}
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
>
template<MatrixVectorNature MatrixVectorNatureT>
void
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
::PerformElementaryCalculation(const LocalFEltSpace& local_felt_space,
LocalVariationalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNatureT>& global_linear_algebra,
std::tuple<>&&) const
{
static_cast<void>(local_felt_space);
Utilities::Tuple::CallMethodWithArgumentsFromTuple<void>(local_operator,
&LocalVariationalOperatorT::template ComputeEltArray<MatrixVectorNatureT>,
Private::AssemblingHelper<GetMatrixVectorNature(), MatrixVectorNatureT>::GetCoefficientList(global_linear_algebra));
}
template
......
......@@ -12,7 +12,6 @@
# include "Geometry/RefGeomElt.hpp"
# include "FiniteElement/Operators/Crtp/UnknownAndNumberingSubsetList.hpp"
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/GlobalLinearAlgebraHelper.hpp"
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/GlobalVariationalOperator.hpp"
# include "FiniteElement/FiniteElement/LocalFEltSpace.hpp"
......@@ -83,34 +82,6 @@ namespace HappyHeart
const LocalOperatorT& local_operator);
/*!
* \brief Once elementary calculation has been performed, transmit its result to the global matrix or vector.
*
*
* \param[in] local_felt_space Local finite element space considered.
* \param[in] local_operator Local operator considered.
* \param[out] global_linear_algebra A shallow wrapper over global matrix and/or vector and their coefficients.
*/
template<class LocalOperatorT>
void InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::matrix>& global_linear_algebra) const;
//! Same as namesake defined above when assembling into a vector.
template<class LocalOperatorT>
void InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector>& global_linear_algebra) const;
//! Same as namesake defined above when assembling both into a vector and into a matrix.
template<class LocalOperatorT>
void InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector_and_matrix>& global_linear_algebra) const;
};
......
......@@ -31,64 +31,7 @@ namespace HappyHeart
}
template<class LocalOperatorT>
void OneUnknown::InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::matrix>& global_linear_algebra) const
{
const auto& elementary_data = local_operator.GetElementaryData();
const auto& local_matrix = elementary_data.GetMatrixResult();
auto& global_matrix = global_linear_algebra.GetNonCstMatrix();
const auto& unknown = local_operator.GetUnknown();
const auto& unknown_and_numbering_subset = elementary_data.GetRefFElt(unknown).GetUnknownAndNumberingSubset();
const auto& local2global = local_felt_space.GetFiniteElt(unknown_and_numbering_subset).template GetLocal2Global<MpiScale::program_wise>();
Private::ReportValuesInGlobalMatrix(local_matrix, local2global, global_matrix);
}
template<class LocalOperatorT>
void OneUnknown::InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector>& global_linear_algebra) const
{
const auto& elementary_data = local_operator.GetElementaryData();
const auto& local_vector = elementary_data.GetVectorResult();
auto& global_vector = global_linear_algebra.GetNonCstVector();
const auto& unknown = local_operator.GetUnknown();
const auto& unknown_and_numbering_subset = elementary_data.GetRefFElt(unknown).GetUnknownAndNumberingSubset();
const auto& local2global = local_felt_space.GetFiniteElt(unknown_and_numbering_subset).template GetLocal2Global<MpiScale::program_wise>();
Private::ReportValuesInGlobalVector(local_vector, local2global, global_vector);
}
template<class LocalOperatorT>
void OneUnknown::InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector_and_matrix>& global_linear_algebra) const
{
const auto& elementary_data = local_operator.GetElementaryData();
const auto& local_matrix = elementary_data.GetMatrixResult();
auto& global_matrix = global_linear_algebra.GetNonCstMatrix();
const auto& unknown = local_operator.GetUnknown();
const auto& unknown_and_numbering_subset = elementary_data.GetRefFElt(unknown).GetUnknownAndNumberingSubset();
const auto& local2global = local_felt_space.GetFiniteElt(unknown_and_numbering_subset).template GetLocal2Global<MpiScale::program_wise>();
const auto& local_vector = elementary_data.GetVectorResult();
auto& global_vector = global_linear_algebra.GetNonCstVector();
Private::ReportValuesInGlobalMatrix(local_matrix, local2global, global_matrix);
Private::ReportValuesInGlobalVector(local_vector, local2global, global_vector);
}
} //namespace Policy
......
......@@ -20,7 +20,6 @@
# include "Geometry/RefGeomElt.hpp"
# include "FiniteElement/Operators/Crtp/UnknownAndNumberingSubsetList.hpp"
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/GlobalLinearAlgebraHelper.hpp"
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/GlobalVariationalOperator.hpp"
# include "FiniteElement/FiniteElement/LocalFEltSpace.hpp"
......@@ -78,34 +77,7 @@ namespace HappyHeart
const LocalOperatorT& local_operator);
/*!
* \brief Once elementary calculation has been performed, transmit its result to the global matrix or vector.
*
*
* \param[in] local_felt_space Local finite element space considered.
* \param[in] local_operator Local operator considered.
* \param[out] global_linear_algebra A shallow wrapper over global matrix and/or vector and their coefficients.
*/
template<class LocalOperatorT>
void InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::matrix>& global_linear_algebra) const;
//! Same as namesake defined above when assembling into a vector.
template<class LocalOperatorT>
void InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector>& global_linear_algebra) const;
//! Same as namesake defined above when assembling both into a vector and into a matrix.
template<class LocalOperatorT>
void InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector_and_matrix>& global_linear_algebra) const;
private:
......
......@@ -37,70 +37,7 @@ namespace HappyHeart
}
template<class LocalOperatorT>
void TwoUnknownsMonolithic
::InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::matrix>& global_linear_algebra) const
{
const auto& elementary_data = local_operator.GetElementaryData();
std::lock_guard<std::mutex> lock(this->GetMutex());
const auto& aggregated_local2global = ComputeAggregateLocal2Global(local_felt_space,
local_operator);
Private::ReportValuesInGlobalMatrix(elementary_data.GetMatrixResult(),
aggregated_local2global,
global_linear_algebra.GetNonCstMatrix());
}
template<class LocalOperatorT>
void TwoUnknownsMonolithic
::InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector>& global_linear_algebra) const
{
const auto& elementary_data = local_operator.GetElementaryData();
std::lock_guard<std::mutex> lock(this->GetMutex());
const auto& aggregated_local2global = ComputeAggregateLocal2Global(local_felt_space,
local_operator,
global_linear_algebra);
Private::ReportValuesInGlobalVector(elementary_data.GetVectorResult(),
aggregated_local2global,
global_linear_algebra.GetNonCstVector());
}
template<class LocalOperatorT>
void TwoUnknownsMonolithic
::InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector_and_matrix>& global_linear_algebra) const
{
const auto& elementary_data = local_operator.GetElementaryData();
std::lock_guard<std::mutex> lock(this->GetMutex());
const auto& aggregated_local2global = ComputeAggregateLocal2Global(local_felt_space,
local_operator);
Private::ReportValuesInGlobalVector(elementary_data.GetVectorResult(),
aggregated_local2global,
global_linear_algebra.GetNonCstVector());
Private::ReportValuesInGlobalMatrix(elementary_data.GetMatrixResult(),
aggregated_local2global,
global_linear_algebra.GetNonCstMatrix());
}
template<class LocalOperatorT>
const std::vector<PetscInt>& TwoUnknownsMonolithic
::ComputeAggregateLocal2Global(const LocalFEltSpace& local_felt_space,
......
......@@ -16,7 +16,6 @@
# include "Geometry/RefGeomElt.hpp"
# include "FiniteElement/Operators/Crtp/UnknownAndNumberingSubsetList.hpp"
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/GlobalLinearAlgebraHelper.hpp"
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/GlobalVariationalOperator.hpp"
# include "FiniteElement/FiniteElement/LocalFEltSpace.hpp"
......@@ -72,34 +71,7 @@ namespace HappyHeart
template<class LocalOperatorT>
void InitLocalOperator(RefGeomElt::shared_ptr ref_geom_elt_ptr,
const LocalOperatorT& local_operator);
/*!
* \brief Once elementary calculation has been performed, transmit its result to the global matrix or vector.
*
*
* \param[in] local_felt_space Local finite element space considered.
* \param[in] local_operator Local operator considered.
* \param[out] global_linear_algebra A shallow wrapper over global matrix and/or vector and their coefficients.
*/
template<class LocalOperatorT>
void InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::matrix>& global_linear_algebra) const;
//! Same as namesake defined above when assembling into a vector.
template<class LocalOperatorT>
void InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector>& global_linear_algebra) const;
//! Same as namesake defined above when assembling both into a vector and into a matrix.
template<class LocalOperatorT>
void InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector_and_matrix>& global_linear_algebra) const;
private:
......
......@@ -43,94 +43,7 @@ namespace HappyHeart
}
template<class LocalOperatorT>
void TwoUnknownsNonMonolithic
::InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::matrix>& global_linear_algebra) const
{
const auto& elementary_data = local_operator.GetElementaryData();
const auto& unknown1 = local_operator.GetUnknown(0);
const auto& unknown_and_numbering_subset1
= elementary_data.GetRefFElt(unknown1).GetUnknownAndNumberingSubset();
const auto& unknown2 = local_operator.GetUnknown(1);
const auto& unknown_and_numbering_subset2
= elementary_data.GetRefFElt(unknown2).GetUnknownAndNumberingSubset();
const auto& row_local2global =
local_felt_space.GetFiniteElt(unknown_and_numbering_subset1).template GetLocal2Global<MpiScale::program_wise>();
const auto& column_local2global =
local_felt_space.GetFiniteElt(unknown_and_numbering_subset2).template GetLocal2Global<MpiScale::program_wise>();
std::lock_guard<std::mutex> lock(this->GetMutex());
const auto& reduced_matrix = ComputeReducedMatrix(local_operator);
Private::ReportValuesInGlobalMatrix(reduced_matrix,
row_local2global,
column_local2global,
global_linear_algebra.GetNonCstMatrix());
}
template<class LocalOperatorT>
void TwoUnknownsNonMonolithic
::InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector>& global_linear_algebra) const
{
const auto& elementary_data = local_operator.GetElementaryData();
const auto& unknown = local_operator.GetUnknown(0);
const auto& unknown_and_numbering_subset
= elementary_data.GetRefFElt(unknown).GetUnknownAndNumberingSubset();
const auto& local2global =
local_felt_space.GetFiniteElt(unknown_and_numbering_subset).template GetLocal2Global<MpiScale::program_wise>();
Private::ReportValuesInGlobalVector(elementary_data.GetVectorResult(),
local2global,
global_linear_algebra.GetNonCstVector());
}
template<class LocalOperatorT>
void TwoUnknownsNonMonolithic
::InjectIntoGlobalLinearAlgebra(const LocalFEltSpace& local_felt_space,
const LocalOperatorT& local_operator,
Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector_and_matrix>& global_linear_algebra) const
{
const auto& elementary_data = local_operator.GetElementaryData();
const auto& unknown1 = local_operator.GetUnknown(0);
const auto& unknown_and_numbering_subset1
= elementary_data.GetRefFElt(unknown1).GetUnknownAndNumberingSubset();
const auto& unknown2 = local_operator.GetUnknown(1);
const auto& unknown_and_numbering_subset2
= elementary_data.GetRefFElt(unknown2).GetUnknownAndNumberingSubset();
const auto& row_local2global =
local_felt_space.GetFiniteElt(unknown_and_numbering_subset1).template GetLocal2Global<MpiScale::program_wise>();
const auto& column_local2global =
local_felt_space.GetFiniteElt(unknown_and_numbering_subset2).template GetLocal2Global<MpiScale::program_wise>();
// #494 See if the right unknown was chosen here...
Private::ReportValuesInGlobalVector(elementary_data.GetVectorResult(),
row_local2global,
global_linear_algebra.GetNonCstVector());
std::lock_guard<std::mutex> lock(this->GetMutex());
const auto& reduced_matrix = ComputeReducedMatrix(local_operator);
Private::ReportValuesInGlobalMatrix(reduced_matrix,
row_local2global,
column_local2global,
global_linear_algebra.GetNonCstMatrix());
}
template<class LocalOperatorT>
const LocalMatrix& TwoUnknownsNonMonolithic
......
//
// GlobalLinearAlgebraHelper.cpp
// HappyHeart
//
// Created by Sebastien Gilles on 26/06/14.
// Copyright (c) 2014 Inria. All rights reserved.
//
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/GlobalLinearAlgebraHelper.hpp"
namespace HappyHeart
{
namespace Private
{
GlobalLinearAlgebraHelper<MatrixVectorNature::matrix>
::GlobalLinearAlgebraHelper(const std::pair<GlobalMatrix&, double>& matrix_and_coefficient)
: Crtp::GlobalMatrixOrVectorPropertiesStorage<GlobalLinearAlgebraHelper<MatrixVectorNature::matrix>, IsMatrixOrVector::matrix>(matrix_and_coefficient)
{ }
GlobalLinearAlgebraHelper<MatrixVectorNature::vector>
::GlobalLinearAlgebraHelper(const std::pair<GlobalVector&, double>& vector_and_coefficient)
: Crtp::GlobalMatrixOrVectorPropertiesStorage<GlobalLinearAlgebraHelper<MatrixVectorNature::vector>, IsMatrixOrVector::vector>(vector_and_coefficient)
{ }
GlobalLinearAlgebraHelper<MatrixVectorNature::vector_and_matrix>
::GlobalLinearAlgebraHelper(const std::pair<GlobalMatrix&, double>& matrix_and_coefficient,
const std::pair<GlobalVector&, double>& vector_and_coefficient)
: Crtp::GlobalMatrixOrVectorPropertiesStorage<GlobalLinearAlgebraHelper<MatrixVectorNature::vector_and_matrix>, IsMatrixOrVector::matrix>(matrix_and_coefficient),
Crtp::GlobalMatrixOrVectorPropertiesStorage<GlobalLinearAlgebraHelper<MatrixVectorNature::vector_and_matrix>, IsMatrixOrVector::vector>(vector_and_coefficient)