Commit 0a9d8f7b authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#527 Replace the alias GlobalVector and GlobalMatrix by a struct inherited...

#527 Replace the alias GlobalVector and GlobalMatrix by a struct inherited from the Petsc Wrappers. The goal will be now to enrigh the newly introduced classes.
parent bef29cd4
......@@ -277,6 +277,12 @@
BE64622C1AEE199900D5162A /* NumberingSubsetManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE6462261AEE199900D5162A /* NumberingSubsetManager.cpp */; };
BE64622D1AEE199900D5162A /* NumberingSubsetManager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE6462271AEE199900D5162A /* NumberingSubsetManager.hpp */; };
BE64622E1AEE199900D5162A /* NumberingSubsetManager.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE6462281AEE199900D5162A /* NumberingSubsetManager.hxx */; };
BE6462331AEE1AE100D5162A /* GlobalMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE6462301AEE1AE100D5162A /* GlobalMatrix.cpp */; };
BE6462341AEE1AE100D5162A /* GlobalMatrix.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE6462311AEE1AE100D5162A /* GlobalMatrix.hpp */; };
BE6462351AEE1AE100D5162A /* GlobalMatrix.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE6462321AEE1AE100D5162A /* GlobalMatrix.hxx */; };
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 */; };
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 */; };
......@@ -2019,6 +2025,12 @@
BE6462261AEE199900D5162A /* NumberingSubsetManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NumberingSubsetManager.cpp; sourceTree = "<group>"; };
BE6462271AEE199900D5162A /* NumberingSubsetManager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = NumberingSubsetManager.hpp; sourceTree = "<group>"; };
BE6462281AEE199900D5162A /* NumberingSubsetManager.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = NumberingSubsetManager.hxx; sourceTree = "<group>"; };
BE6462301AEE1AE100D5162A /* GlobalMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GlobalMatrix.cpp; sourceTree = "<group>"; };
BE6462311AEE1AE100D5162A /* GlobalMatrix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GlobalMatrix.hpp; sourceTree = "<group>"; };
BE6462321AEE1AE100D5162A /* GlobalMatrix.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GlobalMatrix.hxx; sourceTree = "<group>"; };
BE6462361AEE1AEF00D5162A /* GlobalVector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GlobalVector.cpp; sourceTree = "<group>"; };
BE6462371AEE1AEF00D5162A /* GlobalVector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GlobalVector.hpp; sourceTree = "<group>"; };
BE6462381AEE1AEF00D5162A /* GlobalVector.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GlobalVector.hxx; sourceTree = "<group>"; };
BE6576E41A1F41F800D9A8B7 /* GeometricMeshRegion_Connectivity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GeometricMeshRegion_Connectivity.hpp; sourceTree = "<group>"; };
BE66FED819EBD84C0025DEE2 /* LocalData.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = LocalData.hpp; sourceTree = "<group>"; };
BE66FED919EBD84C0025DEE2 /* LocalData.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = LocalData.hxx; sourceTree = "<group>"; };
......@@ -3524,6 +3536,7 @@
BE6462221AEE199900D5162A /* NumberingSubset.cpp */,
BE6462231AEE199900D5162A /* NumberingSubset.hpp */,
BE6462241AEE199900D5162A /* NumberingSubset.hxx */,
BE64622F1AEE1AC600D5162A /* LinearAlgebra */,
BE6462251AEE199900D5162A /* Private */,
BE968B6917AB94A100995748 /* InputParameter */,
);
......@@ -3668,6 +3681,19 @@
path = Private;
sourceTree = "<group>";
};
BE64622F1AEE1AC600D5162A /* LinearAlgebra */ = {
isa = PBXGroup;
children = (
BE6462301AEE1AE100D5162A /* GlobalMatrix.cpp */,
BE6462311AEE1AE100D5162A /* GlobalMatrix.hpp */,
BE6462321AEE1AE100D5162A /* GlobalMatrix.hxx */,
BE6462361AEE1AEF00D5162A /* GlobalVector.cpp */,
BE6462371AEE1AEF00D5162A /* GlobalVector.hpp */,
BE6462381AEE1AEF00D5162A /* GlobalVector.hxx */,
);
path = LinearAlgebra;
sourceTree = "<group>";
};
BE6789B119E6DCBA002CAC33 /* Crtp */ = {
isa = PBXGroup;
children = (
......@@ -5156,6 +5182,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
BE6462351AEE1AE100D5162A /* GlobalMatrix.hxx in Headers */,
BE4053EC1AC172580024D5F9 /* FEltSpace.hxx in Headers */,
BE90DED11A24903700CCAFDE /* Mpi.hxx in Headers */,
BE90DEDE1A24903700CCAFDE /* Fluid.hpp in Headers */,
......@@ -5178,8 +5205,11 @@
BE90DEDF1A24903700CCAFDE /* Miscellaneous.hpp in Headers */,
BE90DED01A24903700CCAFDE /* Mpi.hpp in Headers */,
BE87A4EF1A6FEFF100E92902 /* InitHappyHeart.hxx in Headers */,
BE64623B1AEE1AEF00D5162A /* GlobalVector.hxx in Headers */,
BE90DEDC1A24903700CCAFDE /* Petsc.hpp in Headers */,
BE40541A1AC1C14D0024D5F9 /* Unknown.hpp in Headers */,
BE6462341AEE1AE100D5162A /* GlobalMatrix.hpp in Headers */,
BE64623A1AEE1AEF00D5162A /* GlobalVector.hpp in Headers */,
BE2E0CD21ABB08E800B543E8 /* Domain.hpp in Headers */,
BE4053F81AC1729B0024D5F9 /* FEltSpace.hpp in Headers */,
BE2E0CC91ABAFBA800B543E8 /* Domain.hxx in Headers */,
......@@ -6210,6 +6240,7 @@
BE90DED51A24903700CCAFDE /* TransientParameters.cpp in Sources */,
BE45B9161A9621F200812586 /* Force.cpp in Sources */,
BE2E0CD11ABB08E800B543E8 /* Domain.cpp in Sources */,
BE6462391AEE1AEF00D5162A /* GlobalVector.cpp in Sources */,
BE45B9091A9611D400812586 /* Diffusion.cpp in Sources */,
BE45B9121A9611D400812586 /* Transient.cpp in Sources */,
BE45B9101A9611D400812586 /* Result.cpp in Sources */,
......@@ -6224,6 +6255,7 @@
BE6462291AEE199900D5162A /* NumberingSubset.cpp in Sources */,
BE42C2751A94ADCA00D03605 /* BoundaryCondition.cpp in Sources */,
BE45B90C1A9611D400812586 /* InitialCondition.cpp in Sources */,
BE6462331AEE1AE100D5162A /* GlobalMatrix.cpp in Sources */,
BEDAC3DB1AD8108E00AA2156 /* NumberingSubset.cpp in Sources */,
BE45B90E1A9611D400812586 /* Miscellaneous.cpp in Sources */,
BE45B9111A9611D400812586 /* Solid.cpp in Sources */,
......
//
// GlobalMatrix.cpp
// HappyHeart
//
// Created by Sebastien Gilles on 27/04/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#include "Core/LinearAlgebra/GlobalMatrix.hpp"
namespace HappyHeart
{
} // namespace HappyHeart
//
// GlobalMatrix.hpp
// HappyHeart
//
// Created by Sebastien Gilles on 27/04/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef __HappyHeart__GlobalMatrix__HPP
# define __HappyHeart__GlobalMatrix__HPP
# include <memory>
# include <vector>
# include "ThirdParty/Wrappers/Petsc/Matrix/Matrix.hpp"
namespace HappyHeart
{
struct GlobalMatrix : public Wrappers::Petsc::Matrix
{
};
/*!
* \brief Useful typedef to avoid cluttering the main programs with too low-level C++.
*
* \code
* GlobalVectorWithCoefficient(vm.GetNonCstForce(), 1.)
* \endcode
*
* is probably easier to grasp than either:
* \code
* std::pair<GlobalVector&, double>(vm.GetNonCstForce(), 1.)
* \endcode
*
* or
*
* \code
* std::make_pair(std::ref(vm.GetNonCstForce()), 1.)
* \endcode
*/
using GlobalMatrixWithCoefficient = std::pair<GlobalMatrix&, double>;
// class GlobalMatrix
// {
//
// public:
//
// //! Alias to unique pointer.
// using unique_ptr = std::unique_ptr<GlobalMatrix>;
//
// //! Alias to vector of unique pointers.
// using vector_unique_ptr = std::vector<unique_ptr>;
//
// public:
//
// /// \name Special members.
// ///@{
//
// //! Constructor.
// explicit GlobalMatrix() = default;
//
// //! Destructor.
// ~GlobalMatrix() = default;
//
// //! Copy constructor.
// GlobalMatrix(const GlobalMatrix&) = default;
//
// //! Move constructor.
// GlobalMatrix(GlobalMatrix&&) = default;
//
// //! Copy affectation.
// GlobalMatrix& operator=(const GlobalMatrix&) = default;
//
// //! Move affectation.
// GlobalMatrix& operator=(GlobalMatrix&&) = default;
//
// ///@}
//
// private:
//
//
//
// };
} // namespace HappyHeart
# include "Core/LinearAlgebra/GlobalMatrix.hxx"
#endif /* defined(__HappyHeart__GlobalMatrix__HPP) */
//
// GlobalMatrix.hxx
// HappyHeart
//
// Created by Sebastien Gilles on 27/04/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef __HappyHeart__GlobalMatrix__HXX
#define __HappyHeart__GlobalMatrix__HXX
namespace HappyHeart
{
} // namespace HappyHeart
#endif /* defined(__HappyHeart__GlobalMatrix__HXX) */
//
// GlobalVector.cpp
// HappyHeart
//
// Created by Sebastien Gilles on 27/04/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#include "Core/LinearAlgebra/GlobalVector.hpp"
namespace HappyHeart
{
} // namespace HappyHeart
//
// GlobalVector.hpp
// HappyHeart
//
// Created by Sebastien Gilles on 27/04/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef __HappyHeart__GlobalVector__HPP
# define __HappyHeart__GlobalVector__HPP
# include <memory>
# include <vector>
# include "ThirdParty/Wrappers/Petsc/Vector/Vector.hpp"
namespace HappyHeart
{
struct GlobalVector : public Wrappers::Petsc::Vector
{
};
/*!
* \brief Useful typedef to avoid cluttering the main programs with too low-level C++.
*
* \code
* GlobalVectorWithCoefficient(vm.GetNonCstForce(), 1.)
* \endcode
*
* is probably easier to grasp than either:
* \code
* std::pair<GlobalVector&, double>(vm.GetNonCstForce(), 1.)
* \endcode
*
* or
*
* \code
* std::make_pair(std::ref(vm.GetNonCstForce()), 1.)
* \endcode
*/
using GlobalVectorWithCoefficient = std::pair<GlobalVector&, double>;
// class GlobalVector
// {
//
// public:
//
// //! Alias to unique pointer.
// using unique_ptr = std::unique_ptr<GlobalVector>;
//
// //! Alias to vector of unique pointers.
// using vector_unique_ptr = std::vector<unique_ptr>;
//
// public:
//
// /// \name Special members.
// ///@{
//
// //! Constructor.
// explicit GlobalVector() = default;
//
// //! Destructor.
// ~GlobalVector() = default;
//
// //! Copy constructor.
// GlobalVector(const GlobalVector&) = default;
//
// //! Move constructor.
// GlobalVector(GlobalVector&&) = default;
//
// //! Copy affectation.
// GlobalVector& operator=(const GlobalVector&) = default;
//
// //! Move affectation.
// GlobalVector& operator=(GlobalVector&&) = default;
//
// ///@}
//
// private:
//
//
//
// };
} // namespace HappyHeart
# include "Core/LinearAlgebra/GlobalVector.hxx"
#endif /* defined(__HappyHeart__GlobalVector__HPP) */
//
// GlobalVector.hxx
// HappyHeart
//
// Created by Sebastien Gilles on 27/04/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef __HappyHeart__GlobalVector__HXX
#define __HappyHeart__GlobalVector__HXX
namespace HappyHeart
{
} // namespace HappyHeart
#endif /* defined(__HappyHeart__GlobalVector__HXX) */
......@@ -9,6 +9,8 @@
#include "Utilities/Containers/Vector.hpp"
#include "Utilities/Containers/UnorderedMap.hpp"
#include "Core/LinearAlgebra/GlobalVector.hpp"
#include "FiniteElement/FiniteElementSpace/Private/Impl/FEltSpaceInternalStorage.hpp"
#include "FiniteElement/FiniteElementSpace/GodOfDof.hpp"
......
......@@ -28,8 +28,19 @@ namespace HappyHeart
std::vector<std::pair<RefFEltSpace::const_unique_ptr, LocalFEltSpace::vector_shared_ptr>>;
// Forward declaration.
// ============================
// Forward declarations.
// ============================
class GodOfDof;
class GlobalVector;
// ============================
// End of forward declarations.
// ============================
namespace Private
......
......@@ -13,6 +13,9 @@
# include "Utilities/MatrixOrVector.hpp"
# include "Core/LinearAlgebra/GlobalVector.hpp"
# include "Core/LinearAlgebra/GlobalMatrix.hpp"
namespace HappyHeart
{
......
......@@ -14,6 +14,8 @@
# include "Utilities/MatrixOrVector.hpp"
# include "Core/LinearAlgebra/GlobalMatrix.hpp"
namespace HappyHeart
{
......
......@@ -10,6 +10,8 @@
#include "ThirdParty/Wrappers/Petsc/Vector/AccessVectorContent.hpp"
#include "Core/LinearAlgebra/GlobalVector.hpp"
#include "FiniteElement/Operators/InterpolationOperatorInstances/State.hpp"
#include "FiniteElement/FiniteElementSpace/FEltSpace.hpp"
#include "FiniteElement/FiniteElementSpace/GodOfDof.hpp"
......
......@@ -14,6 +14,8 @@
# include "Utilities/MatrixOrVector.hpp"
# include "Core/LinearAlgebra/GlobalMatrix.hpp"
namespace HappyHeart
{
......
......@@ -14,6 +14,8 @@
# include "Utilities/MatrixOrVector.hpp"
# include "Core/LinearAlgebra/GlobalVector.hpp"
namespace HappyHeart
{
......
......@@ -57,7 +57,7 @@ namespace HappyHeart
* by a 'Init***()' method or by using 'DuplicateLayout', 'Copy' or 'CompleteCopy'methods.
*
*/
class Matrix final
class Matrix
{
public:
......
......@@ -30,48 +30,17 @@ namespace HappyHeart
using BlockLocalMatrix = ::Seldon::SubMatrix<LocalMatrix>;
using BlockLocalVector = ::Seldon::SubVector<LocalVector>;
using GlobalMatrix = Wrappers::Petsc::Matrix;
using GlobalVector = Wrappers::Petsc::Vector;
using SeldonWrapperVector = ::Seldon::Vector<PetscScalar, Seldon::HappyHeartPetsc, Seldon::PetscPseudoAllocator>;
/*!
* \brief Useful typedef to avoid cluttering the main programs with too low-level C++.
*
* \code
* GlobalVectorWithCoefficient(vm.GetNonCstForce(), 1.)
* \endcode
*
* is probably easier to grasp than either:
* \code
* std::pair<GlobalVector&, double>(vm.GetNonCstForce(), 1.)
* \endcode
*
* or
*
* \code
* std::make_pair(std::ref(vm.GetNonCstForce()), 1.)
* \endcode
*/
using GlobalVectorWithCoefficient = std::pair<GlobalVector&, double>;
//! Same as GlobalVectorWithCoefficient for matrices.
using GlobalMatrixWithCoefficient = std::pair<GlobalMatrix&, double>;
//! Enum that split the cases for matrix and vector.
enum class IsMatrixOrVector
enum class IsMatrixOrVector
{
vector,
matrix
};
enum class AssemblingMoment { never, once_in_static, static_only, once_in_dynamic, dynamic_only, everytime };
enum class MatrixVectorNature
{
vector,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment