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

#531 Remove the UnknownPolicy from GlobalVariationalOperator.

parent d30d1f0c
......@@ -222,15 +222,6 @@
BE4B47051AE107730078955C /* LocalVariationalOperator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE4B47021AE107730078955C /* LocalVariationalOperator.cpp */; };
BE4B47061AE107730078955C /* LocalVariationalOperator.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE4B47031AE107730078955C /* LocalVariationalOperator.hpp */; };
BE4B47071AE107730078955C /* LocalVariationalOperator.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE4B47041AE107730078955C /* LocalVariationalOperator.hxx */; };
BE4B47121AE108650078955C /* OneUnknown.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE4B47091AE108650078955C /* OneUnknown.cpp */; };
BE4B47131AE108650078955C /* OneUnknown.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE4B470A1AE108650078955C /* OneUnknown.hpp */; };
BE4B47141AE108650078955C /* OneUnknown.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE4B470B1AE108650078955C /* OneUnknown.hxx */; };
BE4B47151AE108650078955C /* TwoUnknownsMonolithic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE4B470C1AE108650078955C /* TwoUnknownsMonolithic.cpp */; };
BE4B47161AE108650078955C /* TwoUnknownsMonolithic.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE4B470D1AE108650078955C /* TwoUnknownsMonolithic.hpp */; };
BE4B47171AE108650078955C /* TwoUnknownsMonolithic.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE4B470E1AE108650078955C /* TwoUnknownsMonolithic.hxx */; };
BE4B47181AE108650078955C /* TwoUnknownsNonMonolithic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE4B470F1AE108650078955C /* TwoUnknownsNonMonolithic.cpp */; };
BE4B47191AE108650078955C /* TwoUnknownsNonMonolithic.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE4B47101AE108650078955C /* TwoUnknownsNonMonolithic.hpp */; };
BE4B471A1AE108650078955C /* TwoUnknownsNonMonolithic.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE4B47111AE108650078955C /* TwoUnknownsNonMonolithic.hxx */; };
BE4CD12F1A89F5FE00EEDB5F /* State.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE4CD12C1A89F5FE00EEDB5F /* State.cpp */; };
BE4CD1301A89F5FE00EEDB5F /* State.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE4CD12D1A89F5FE00EEDB5F /* State.hpp */; };
BE4CD1311A89F5FE00EEDB5F /* State.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE4CD12E1A89F5FE00EEDB5F /* State.hxx */; };
......@@ -280,6 +271,7 @@
BE6462391AEE1AEF00D5162A /* GlobalVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE6462361AEE1AEF00D5162A /* GlobalVector.cpp */; };
BE64623A1AEE1AEF00D5162A /* GlobalVector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE6462371AEE1AEF00D5162A /* GlobalVector.hpp */; };
BE64623B1AEE1AEF00D5162A /* GlobalVector.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE6462381AEE1AEF00D5162A /* GlobalVector.hxx */; };
BE699CFD1AF2539E009CBF44 /* ScalarDivVectorial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE699CFA1AF2539E009CBF44 /* ScalarDivVectorial.cpp */; };
BE6AE0CB1AE631C6006DF2BA /* VariationalFormulation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE6AE0C81AE631C6006DF2BA /* VariationalFormulation.cpp */; };
BE6BE4E31A665A90009AC2F3 /* IOFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE6BE4E01A665A90009AC2F3 /* IOFormat.cpp */; };
BE6C215F19AF2FDB00CC674B /* libUtilities.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEA8A379177AD4FE009436C9 /* libUtilities.a */; };
......@@ -1922,15 +1914,6 @@
BE4B47021AE107730078955C /* LocalVariationalOperator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalVariationalOperator.cpp; sourceTree = "<group>"; };
BE4B47031AE107730078955C /* LocalVariationalOperator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = LocalVariationalOperator.hpp; sourceTree = "<group>"; };
BE4B47041AE107730078955C /* LocalVariationalOperator.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = LocalVariationalOperator.hxx; sourceTree = "<group>"; };
BE4B47091AE108650078955C /* OneUnknown.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OneUnknown.cpp; sourceTree = "<group>"; };
BE4B470A1AE108650078955C /* OneUnknown.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = OneUnknown.hpp; sourceTree = "<group>"; };
BE4B470B1AE108650078955C /* OneUnknown.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = OneUnknown.hxx; sourceTree = "<group>"; };
BE4B470C1AE108650078955C /* TwoUnknownsMonolithic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TwoUnknownsMonolithic.cpp; sourceTree = "<group>"; };
BE4B470D1AE108650078955C /* TwoUnknownsMonolithic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TwoUnknownsMonolithic.hpp; sourceTree = "<group>"; };
BE4B470E1AE108650078955C /* TwoUnknownsMonolithic.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TwoUnknownsMonolithic.hxx; sourceTree = "<group>"; };
BE4B470F1AE108650078955C /* TwoUnknownsNonMonolithic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TwoUnknownsNonMonolithic.cpp; sourceTree = "<group>"; };
BE4B47101AE108650078955C /* TwoUnknownsNonMonolithic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TwoUnknownsNonMonolithic.hpp; sourceTree = "<group>"; };
BE4B47111AE108650078955C /* TwoUnknownsNonMonolithic.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TwoUnknownsNonMonolithic.hxx; sourceTree = "<group>"; };
BE4C4E4318E96468005EF46C /* Volume.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Volume.cpp; sourceTree = "<group>"; };
BE4C4E4418E96468005EF46C /* Volume.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Volume.hpp; sourceTree = "<group>"; };
BE4C4E4518E96468005EF46C /* Volume.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Volume.hxx; sourceTree = "<group>"; };
......@@ -2031,6 +2014,7 @@
BE6789A519E6D100002CAC33 /* OrientedFace.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = OrientedFace.hxx; sourceTree = "<group>"; };
BE6789B219E6DCBA002CAC33 /* Orientation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Orientation.hpp; sourceTree = "<group>"; };
BE6789B319E6DCBA002CAC33 /* Orientation.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Orientation.hxx; sourceTree = "<group>"; };
BE699CFA1AF2539E009CBF44 /* ScalarDivVectorial.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScalarDivVectorial.cpp; sourceTree = "<group>"; };
BE6AE0C81AE631C6006DF2BA /* VariationalFormulation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VariationalFormulation.cpp; sourceTree = "<group>"; };
BE6AE0C91AE631C6006DF2BA /* VariationalFormulation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = VariationalFormulation.hpp; sourceTree = "<group>"; };
BE6AE0CA1AE631C6006DF2BA /* VariationalFormulation.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = VariationalFormulation.hxx; sourceTree = "<group>"; };
......@@ -3290,7 +3274,6 @@
children = (
BE4B46FE1AE107690078955C /* GlobalVariationalOperator.hpp */,
BE4B46FF1AE107690078955C /* GlobalVariationalOperator.hxx */,
BE4B47081AE108650078955C /* Policy */,
BE4DDE851AE1332900D60CCC /* Private */,
);
path = GlobalVariationalOperator;
......@@ -3306,22 +3289,6 @@
path = LocalVariationalOperator;
sourceTree = "<group>";
};
BE4B47081AE108650078955C /* Policy */ = {
isa = PBXGroup;
children = (
BE4B47091AE108650078955C /* OneUnknown.cpp */,
BE4B470A1AE108650078955C /* OneUnknown.hpp */,
BE4B470B1AE108650078955C /* OneUnknown.hxx */,
BE4B470C1AE108650078955C /* TwoUnknownsMonolithic.cpp */,
BE4B470D1AE108650078955C /* TwoUnknownsMonolithic.hpp */,
BE4B470E1AE108650078955C /* TwoUnknownsMonolithic.hxx */,
BE4B470F1AE108650078955C /* TwoUnknownsNonMonolithic.cpp */,
BE4B47101AE108650078955C /* TwoUnknownsNonMonolithic.hpp */,
BE4B47111AE108650078955C /* TwoUnknownsNonMonolithic.hxx */,
);
path = Policy;
sourceTree = "<group>";
};
BE4CD1291A89F5B500EEDB5F /* InterpolationOperatorInstances */ = {
isa = PBXGroup;
children = (
......@@ -4834,6 +4801,7 @@
BEF185FF19C7386900C3DBA7 /* Mass.cpp */,
BEF1860019C7386900C3DBA7 /* Mass.hpp */,
BEF1860119C7386900C3DBA7 /* Mass.hxx */,
BE699CFA1AF2539E009CBF44 /* ScalarDivVectorial.cpp */,
BEF1860319C7386900C3DBA7 /* ScalarDivVectorial.hpp */,
BEF1860419C7386900C3DBA7 /* ScalarDivVectorial.hxx */,
);
......@@ -5269,7 +5237,6 @@
BE8F0E321A80FFED00D81C9F /* TransientSource.hpp in Headers */,
BE90E12B1A2491AE00CCAFDE /* Dof.hpp in Headers */,
BE90E0861A2491AE00CCAFDE /* GradPhiGradPhi.hpp in Headers */,
BE4B47191AE108650078955C /* TwoUnknownsNonMonolithic.hpp in Headers */,
BE90E15A1A2491AE00CCAFDE /* ComponentFactory.hpp in Headers */,
BE2B66461A2778C700E80864 /* Spectral.hxx in Headers */,
BE2B66611A2778C700E80864 /* RefFEltInLocalNumbering.hxx in Headers */,
......@@ -5287,13 +5254,11 @@
BE2B66531A2778C700E80864 /* ElementaryDataStorage.hxx in Headers */,
BE90E0BA1A2491AE00CCAFDE /* Helper.hpp in Headers */,
BE90E0FD1A2491AE00CCAFDE /* QuadraturePoint.hpp in Headers */,
BE4B47171AE108650078955C /* TwoUnknownsMonolithic.hxx in Headers */,
BE90E1141A2491AE00CCAFDE /* QuadratureRuleList.hpp in Headers */,
BE90E0F81A2491AE00CCAFDE /* FiniteElt.hxx in Headers */,
BE90E1261A2491AE00CCAFDE /* NodeBearer.hxx in Headers */,
BE90E14F1A2491AE00CCAFDE /* Comp2.hpp in Headers */,
BEB917101AD3D37A0096A3D9 /* UnknownAndNumberingSubset.hpp in Headers */,
BE4B47161AE108650078955C /* TwoUnknownsMonolithic.hpp in Headers */,
BEB03EAF1A3601EF00E99AAC /* Force.hxx in Headers */,
BE95129B1A8D09A0009E0082 /* InterpolateToSubsetFeltSpace.hxx in Headers */,
BE90E0A61A2491AE00CCAFDE /* GradOnGradientBasedHyperelasticityTensor.hxx in Headers */,
......@@ -5309,7 +5274,6 @@
BE2B663E1A2778C700E80864 /* GeometryBasedBasicRefFElt.hxx in Headers */,
BE90E1291A2491AE00CCAFDE /* Node.hxx in Headers */,
BE4CD1311A89F5FE00EEDB5F /* State.hxx in Headers */,
BE4B47131AE108650078955C /* OneUnknown.hpp in Headers */,
BE90E0831A2491AE00CCAFDE /* GradOnGradientBasedElasticityTensor.hpp in Headers */,
BE4CD1301A89F5FE00EEDB5F /* State.hpp in Headers */,
BE90E1061A2491AE00CCAFDE /* GaussQuadratureFormula.hxx in Headers */,
......@@ -5330,7 +5294,6 @@
BE8F0E681A81260600D81C9F /* ___FILEBASENAME___.hxx in Headers */,
BE90E0981A2491AE00CCAFDE /* GradOnGradientBasedElasticityTensor.hxx in Headers */,
BE8F0E331A80FFED00D81C9F /* TransientSource.hxx in Headers */,
BE4B47141AE108650078955C /* OneUnknown.hxx in Headers */,
BE90E11F1A2491AE00CCAFDE /* UnknownManager.hpp in Headers */,
BE90E09A1A2491AE00CCAFDE /* GradPhiGradPhi.hpp in Headers */,
BE90E0651A2491AE00CCAFDE /* GodOfDof.hxx in Headers */,
......@@ -5382,7 +5345,6 @@
BE90E1101A2491AE00CCAFDE /* Quadrangle.hpp in Headers */,
BE95129A1A8D09A0009E0082 /* InterpolateToSubsetFeltSpace.hpp in Headers */,
BE90E12C1A2491AE00CCAFDE /* Dof.hxx in Headers */,
BE4B471A1AE108650078955C /* TwoUnknownsNonMonolithic.hxx in Headers */,
BE4B47061AE107730078955C /* LocalVariationalOperator.hpp in Headers */,
BE90E0791A2491AE00CCAFDE /* InterfaceSpecialization.hpp in Headers */,
BEFC37261ADFB82800522E07 /* UnknownAndNumberingSubsetList.hxx in Headers */,
......@@ -6354,7 +6316,6 @@
BE2B664B1A2778C700E80864 /* TriangleP1.cpp in Sources */,
BE90E1151A2491AE00CCAFDE /* GaussQuadratureFormula.cpp in Sources */,
BE90E0991A2491AE00CCAFDE /* GradPhiGradPhi.cpp in Sources */,
BE4B47151AE108650078955C /* TwoUnknownsMonolithic.cpp in Sources */,
BE90E1481A2491AE00CCAFDE /* Comp12.cpp in Sources */,
BE8F0E311A80FFED00D81C9F /* TransientSource.cpp in Sources */,
BE3E66451ACEB61100A3F7E2 /* Partition.cpp in Sources */,
......@@ -6369,9 +6330,9 @@
BE90E1071A2491AE00CCAFDE /* Point.cpp in Sources */,
BE8F0E2D1A80FF2E00D81C9F /* TransientSource.cpp in Sources */,
13EDDEC81AB03E1B00A1E8F9 /* PointP1.cpp in Sources */,
BE4B47181AE108650078955C /* TwoUnknownsNonMonolithic.cpp in Sources */,
BE90E1181A2491AE00CCAFDE /* Unknown.cpp in Sources */,
BE2B66421A2778C700E80864 /* QuadrangleQ2c.cpp in Sources */,
BE699CFD1AF2539E009CBF44 /* ScalarDivVectorial.cpp in Sources */,
BEB03EB51A36056B00E99AAC /* Force.cpp in Sources */,
BE90E0631A2491AE00CCAFDE /* GodOfDof.cpp in Sources */,
BE90E09F1A2491AE00CCAFDE /* ScalarDivVectorial.cpp in Sources */,
......@@ -6380,7 +6341,6 @@
BE90E1591A2491AE00CCAFDE /* ComponentFactory.cpp in Sources */,
BE90E1461A2491AE00CCAFDE /* Comp1.cpp in Sources */,
BE90E12A1A2491AE00CCAFDE /* Dof.cpp in Sources */,
BE4B47121AE108650078955C /* OneUnknown.cpp in Sources */,
BEDAC3C71AD7FBB500AA2156 /* NdofHolder.cpp in Sources */,
BEA3FA7E1AF10AA000D3F871 /* Recursivity.cpp in Sources */,
BE90E06E1A2491AE00CCAFDE /* ReduceToProcessorWise.cpp in Sources */,
......
......@@ -29,6 +29,7 @@
# include "FiniteElement/FiniteElement/LocalFEltSpace.hpp"
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/GlobalVariationalOperator.hpp"
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/Recursivity.hpp"
# include "FiniteElement/Operators/Crtp/UnknownAndNumberingSubsetList.hpp"
namespace HappyHeart
......@@ -45,27 +46,24 @@ namespace HappyHeart
*
* \tparam LocalVariationalOperatorT Class that defines the expected elementary behaviour; it must be derived from
* LocalVariationalOperator.
* \tparam UnknownPolicyT Policy that describes unknowns related to the operator: whether there are 1 or 2, and
* if the latter whether they are handled monolithically or not. The policies are in UnknownPolicies folder.
*/
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
class GlobalVariationalOperator : public UnknownPolicyT
class GlobalVariationalOperator : public Crtp::UnknownAndNumberingSubsetList<GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>>
{
private:
//! Convenient alias to parent.
using UnknownPolicyParent = UnknownPolicyT;
//! Alias over UnknownAndNumberingSubsetList parent.
using UnknownAndNumberingSubsetListParent =
Crtp::UnknownAndNumberingSubsetList<GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>>;
public:
//! Typedef over the class that handles the elementary calculation.
//! Alias over the class that handles the elementary calculation.
using LocalVariationalOperator = LocalVariationalOperatorT;
/*!
......@@ -131,8 +129,6 @@ namespace HappyHeart
/*!
* \brief Constructor when two unknowns are involved.
*
* If \a UnknownPolicyT is TwoUnknownsNonMonolithic, \a unknown1 is the one considered first (i.e. the left-up
* block of the complete global matrix would be (unknown1, unknown1).
*/
template<typename... Args>
explicit GlobalVariationalOperator(const FEltSpace& felt_space,
......
......@@ -16,17 +16,16 @@ namespace HappyHeart
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
template<typename... Args>
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
::GlobalVariationalOperator(const FEltSpace& felt_space,
const UnknownAndNumberingSubset::vector_const_shared_ptr unknown_storage,
const unsigned int geom_mesh_region_dimension,
AllocateGradientFEltPhi do_allocate_gradient_felt_phi,
Args&&... args)
: UnknownPolicyParent(unknown_storage),
: UnknownAndNumberingSubsetListParent(unknown_storage),
felt_space_(felt_space),
do_allocate_gradient_felt_phi_(do_allocate_gradient_felt_phi)
{
......@@ -37,11 +36,10 @@ namespace HappyHeart
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
template<typename... Args>
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
:: GlobalVariationalOperator(const FEltSpace& felt_space,
const Unknown& unknown1,
const Unknown& unknown2,
......@@ -59,11 +57,10 @@ namespace HappyHeart
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
template<typename... Args>
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
:: GlobalVariationalOperator(const FEltSpace& felt_space,
const Unknown& unknown,
unsigned int geom_mesh_region_dimension,
......@@ -80,100 +77,23 @@ namespace HappyHeart
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
constexpr MatrixVectorNature
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
::GetMatrixVectorNature()
{
return LocalVariationalOperatorT::GetMatrixVectorNature();
}
//
// template
// <
// class DerivedT,
// class LocalVariationalOperatorT,
// class UnknownPolicyT
// >
// template<typename... Args>
// void
// GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
// ::AssembleWithVariadicArguments(double coefficient, GlobalVector& global_vector,
// const Domain& domain,
// Args&& ...args) const
// {
// static_assert(GetMatrixVectorNature() != MatrixVectorNature::matrix,
// "This version of Assemble() makes sense only for vectorial operators!");
//
// Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector>
// vector_and_coeff(GlobalVectorWithCoefficient(global_vector, coefficient));
//
// AssembleImpl(vector_and_coeff, domain, std::forward_as_tuple(args...));
// }
//
//
// template
// <
// class DerivedT,
// class LocalVariationalOperatorT,
// class UnknownPolicyT
// >
//
// template<typename... Args>
// void
// GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
// ::AssembleWithVariadicArguments(double coefficient, GlobalMatrix& global_matrix,
// const Domain& domain,
// Args&& ...args) const
// {
// static_assert(GetMatrixVectorNature() != MatrixVectorNature::vector,
// "This version of Assemble() makes sense only for matricial operators!");
//
// Private::GlobalLinearAlgebraHelper<MatrixVectorNature::matrix>
// matrix_and_coeff(GlobalMatrixWithCoefficient(global_matrix, coefficient));
//
// AssembleImpl(matrix_and_coeff, domain, std::forward_as_tuple(args...));
// }
//
//
//
// template
// <
// class DerivedT,
// class LocalVariationalOperatorT,
// class UnknownPolicyT
// >
// template<typename... Args>
// void
// GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
// ::AssembleWithVariadicArguments(double matrix_coefficient, GlobalMatrix& global_matrix,
// double vector_coefficient, GlobalVector& global_vector,
// const Domain& domain, Args&&... args) const
// {
// static_assert(GetMatrixVectorNature() == MatrixVectorNature::vector_and_matrix,
// "This version of Assemble() makes sense only for operators with both matricial and "
// "vectorial components!");
//
// Private::GlobalLinearAlgebraHelper<MatrixVectorNature::vector_and_matrix>
// linear_algebra_and_coeff(GlobalMatrixWithCoefficient(global_matrix, matrix_coefficient),
// GlobalVectorWithCoefficient(global_vector, vector_coefficient)
// );
//
// AssembleImpl(linear_algebra_and_coeff, domain, std::forward_as_tuple(args...));
// }
//
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
std::vector<double>
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
::ExtractFiniteEltValuesFrom(const RefFEltInLocalNumbering& ref_felt,
const LocalFEltSpace& local_felt_space,
const GlobalVector& vector) const
......@@ -194,79 +114,26 @@ namespace HappyHeart
template
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
inline const FEltSpace& GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
inline const FEltSpace& GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
::GetFEltSpace() const
{
return felt_space_;
}
// template
// <
// class DerivedT,
// class LocalVariationalOperatorT,
// class UnknownPolicyT
// >
// template<MatrixVectorNature LinearAlgebraNatureT, typename... Args>
// void
// GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
// ::AssembleImpl(Private::GlobalLinearAlgebraHelper<LinearAlgebraNatureT>& global_linear_algebra,
// const Domain& domain,
// std::tuple<Args...>&& additional_arguments) const
// {
// const auto& finite_elt_storage = this->GetFEltSpace().GetLocalFEltSpacePerRefFeltSpace(domain);
//
// for (const auto& pair : finite_elt_storage)
// {
// auto& ref_felt_space_ptr = pair.first;
// assert(!(!ref_felt_space_ptr));
// const auto& ref_felt_space = *ref_felt_space_ptr;
//
// const auto& ref_geom_elt_ptr = ref_felt_space.GetRefGeomEltPtr();
//
// if (!DoConsider(ref_geom_elt_ptr))
// continue;
//
// auto& local_operator = GetNonCstLocalOperator(ref_geom_elt_ptr);
//
// const auto& local_felt_space_list = pair.second;
//
// for (const auto& local_felt_space_ptr : local_felt_space_list)
// {
// assert(!(!local_felt_space_ptr));
//
// auto& local_felt_space = *local_felt_space_ptr;
// local_operator.SetLocalFEltSpace(local_felt_space);
//
// PerformElementaryCalculation(local_felt_space,
// local_operator,
// global_linear_algebra,
// std::move(additional_arguments));
//
// UnknownPolicyParent::InjectIntoGlobalLinearAlgebra(local_felt_space,
// local_operator,
// global_linear_algebra);
// }
// }
//
// Private::Assembly(global_linear_algebra);
// }
//
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
template<class LinearAlgebraTupleT, typename... Args>
void GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
void GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
::Assemble531(LinearAlgebraTupleT&& linear_algebra_tuple,
const Domain& domain,
Args&&... args) const
......@@ -312,11 +179,10 @@ namespace HappyHeart
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
LocalVariationalOperatorT&
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
::GetNonCstLocalOperator(const RefGeomElt::shared_ptr& ref_geom_elt) const
{
auto it = local_operator_per_ref_geom_elt_.find(ref_geom_elt);
......@@ -328,11 +194,9 @@ namespace HappyHeart
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
bool GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
bool GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
::DoConsider(const RefGeomElt::shared_ptr& ref_geom_elt) const
{
auto it = local_operator_per_ref_geom_elt_.find(ref_geom_elt);
......@@ -344,12 +208,11 @@ namespace HappyHeart
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
template<typename... Args>
void
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
::PerformElementaryCalculation531(const LocalFEltSpace& local_felt_space,
LocalVariationalOperatorT& local_operator,
std::tuple<Args...>&& additional_arguments) const
......@@ -373,11 +236,10 @@ namespace HappyHeart
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
void
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
::PerformElementaryCalculation531(const LocalFEltSpace& local_felt_space,
LocalVariationalOperatorT& local_operator,
std::tuple<>&& ) const
......@@ -391,11 +253,10 @@ namespace HappyHeart
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
template<typename... Args>
void GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
void GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
::CreateLocalOperatorList(const unsigned int geom_mesh_region_dimension,
Args&&... args)
{
......@@ -436,24 +297,19 @@ namespace HappyHeart
std::move(elementary_data),
std::forward<decltype(args)>(args)...);
UnknownPolicyParent::InitLocalOperator(ref_geom_elt_ptr, *local_operator_ptr);
pair_type&& ret_pair{ref_geom_elt_ptr, std::move(local_operator_ptr)};
local_operator_per_ref_geom_elt_.insert(std::move(ret_pair));
}
}
}
template
<
class DerivedT,
class LocalVariationalOperatorT,
class UnknownPolicyT
class LocalVariationalOperatorT
>
inline AllocateGradientFEltPhi GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT, UnknownPolicyT>
inline AllocateGradientFEltPhi GlobalVariationalOperator<DerivedT, LocalVariationalOperatorT>
::DoAllocateGradientFEltPhi() const
{
return do_allocate_gradient_felt_phi_;
......
//
// OneUnknown.cpp
// HappyHeart
//
// Created by Sebastien Gilles on 17/04/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#include "FiniteElement/Operators/GlobalVariationalOperator/Policy/OneUnknown.hpp"
namespace HappyHeart
{
namespace GlobalVariationalOperatorNS
{
namespace Policy
{
OneUnknown::OneUnknown(const UnknownAndNumberingSubset::vector_const_shared_ptr unknown_storage)
: UnknownAndNumberingSubsetListParent(unknown_storage)
{ }
} //namespace Policy
} //namespace GlobalVariationalOperatorNS
} // namespace HappyHeart
//
// OneUnknown.hpp
// HappyHeart
//
// Created by Sebastien Gilles on 17/04/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef _HAPPY_HEART__FINITE_ELEMENT__OPERATORS__GLOBAL_VARIATIONAL_OPERATOR__POLICY__ONE_UNKNOWN_HPP_
# define _HAPPY_HEART__FINITE_ELEMENT__OPERATORS__GLOBAL_VARIATIONAL_OPERATOR__POLICY__ONE_UNKNOWN_HPP_
# include "Geometry/RefGeomElt.hpp"
# include "FiniteElement/Operators/Crtp/UnknownAndNumberingSubsetList.hpp"
# include "FiniteElement/Operators/GlobalVariationalOperator/Private/GlobalVariationalOperator.hpp"
<