Commit 423a3c0f authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1292 Replace the alias XtensorMatrix and XtensorVector by LocalMatrix and...

#1292 Replace the alias XtensorMatrix and XtensorVector by LocalMatrix and LocalVector. Remove now unused files.
parent 71d7cb71
......@@ -168,11 +168,6 @@
BE01DACE1E854DD600F3EAF7 /* InformationsAtQuadraturePoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 135F21831E7ADBC000B9E633 /* InformationsAtQuadraturePoint.cpp */; };
BE01DACF1E854DD600F3EAF7 /* InformationsAtQuadraturePoint.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 135F21841E7ADBC000B9E633 /* InformationsAtQuadraturePoint.hpp */; };
BE01DAD01E854DD600F3EAF7 /* InformationsAtQuadraturePoint.hxx in Headers */ = {isa = PBXBuildFile; fileRef = 135F21851E7ADBC000B9E633 /* InformationsAtQuadraturePoint.hxx */; };
BE01DAD11E854DDD00F3EAF7 /* ExtractBlockFromGlobalMatrix.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 135F21781E7ADBC000B9E633 /* ExtractBlockFromGlobalMatrix.hpp */; };
BE01DAD21E854DDD00F3EAF7 /* ExtractBlockFromGlobalMatrix.hxx in Headers */ = {isa = PBXBuildFile; fileRef = 135F21791E7ADBC000B9E633 /* ExtractBlockFromGlobalMatrix.hxx */; };
BE01DAD31E854DDD00F3EAF7 /* ExtractBlockFromGlobalVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 135F217A1E7ADBC000B9E633 /* ExtractBlockFromGlobalVector.cpp */; };
BE01DAD41E854DDD00F3EAF7 /* ExtractBlockFromGlobalVector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 135F217B1E7ADBC000B9E633 /* ExtractBlockFromGlobalVector.hpp */; };
BE01DAD51E854DDD00F3EAF7 /* ExtractBlockFromGlobalVector.hxx in Headers */ = {isa = PBXBuildFile; fileRef = 135F217C1E7ADBC000B9E633 /* ExtractBlockFromGlobalVector.hxx */; };
BE01DAD71E854DE300F3EAF7 /* InvariantComputation.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 135F218A1E7ADBC000B9E633 /* InvariantComputation.hpp */; };
BE01DAD81E854DE300F3EAF7 /* InvariantComputation.hxx in Headers */ = {isa = PBXBuildFile; fileRef = 135F218B1E7ADBC000B9E633 /* InvariantComputation.hxx */; };
BE01DADA1E854DE300F3EAF7 /* InvariantHolder.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 135F218D1E7ADBC000B9E633 /* InvariantHolder.hpp */; };
......@@ -2578,11 +2573,6 @@
135F21721E7ADBC000B9E633 /* LocalVariationalOperatorIterator.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = LocalVariationalOperatorIterator.hxx; sourceTree = "<group>"; };
135F21751E7ADBC000B9E633 /* DerivativeGreenLagrange.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = DerivativeGreenLagrange.hpp; sourceTree = "<group>"; };
135F21761E7ADBC000B9E633 /* DerivativeGreenLagrange.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = DerivativeGreenLagrange.hxx; sourceTree = "<group>"; };
135F21781E7ADBC000B9E633 /* ExtractBlockFromGlobalMatrix.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ExtractBlockFromGlobalMatrix.hpp; sourceTree = "<group>"; };
135F21791E7ADBC000B9E633 /* ExtractBlockFromGlobalMatrix.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ExtractBlockFromGlobalMatrix.hxx; sourceTree = "<group>"; };
135F217A1E7ADBC000B9E633 /* ExtractBlockFromGlobalVector.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ExtractBlockFromGlobalVector.cpp; sourceTree = "<group>"; };
135F217B1E7ADBC000B9E633 /* ExtractBlockFromGlobalVector.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ExtractBlockFromGlobalVector.hpp; sourceTree = "<group>"; };
135F217C1E7ADBC000B9E633 /* ExtractBlockFromGlobalVector.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ExtractBlockFromGlobalVector.hxx; sourceTree = "<group>"; };
135F217D1E7ADBC000B9E633 /* ExtractGradientBasedBlock.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ExtractGradientBasedBlock.cpp; sourceTree = "<group>"; };
135F217E1E7ADBC000B9E633 /* ExtractGradientBasedBlock.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ExtractGradientBasedBlock.hpp; sourceTree = "<group>"; };
135F217F1E7ADBC000B9E633 /* ExtractGradientBasedBlock.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ExtractGradientBasedBlock.hxx; sourceTree = "<group>"; };
......@@ -5281,23 +5271,10 @@
135F21841E7ADBC000B9E633 /* InformationsAtQuadraturePoint.hpp */,
135F21851E7ADBC000B9E633 /* InformationsAtQuadraturePoint.hxx */,
BEF3B485212DB17F00807965 /* InformationsAtQuadraturePoint */,
135F21771E7ADBC000B9E633 /* ExtractBlockFromLinearAlgebra */,
);
path = Advanced;
sourceTree = "<group>";
};
135F21771E7ADBC000B9E633 /* ExtractBlockFromLinearAlgebra */ = {
isa = PBXGroup;
children = (
135F21781E7ADBC000B9E633 /* ExtractBlockFromGlobalMatrix.hpp */,
135F21791E7ADBC000B9E633 /* ExtractBlockFromGlobalMatrix.hxx */,
135F217A1E7ADBC000B9E633 /* ExtractBlockFromGlobalVector.cpp */,
135F217B1E7ADBC000B9E633 /* ExtractBlockFromGlobalVector.hpp */,
135F217C1E7ADBC000B9E633 /* ExtractBlockFromGlobalVector.hxx */,
);
path = ExtractBlockFromLinearAlgebra;
sourceTree = "<group>";
};
135F21881E7ADBC000B9E633 /* CauchyAndInvariant */ = {
isa = PBXGroup;
children = (
......@@ -11555,7 +11532,6 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
BE01DAD41E854DDD00F3EAF7 /* ExtractBlockFromGlobalVector.hpp in Headers */,
BEE45C092357BA8100E0AB7C /* InvariantHolder.hxx in Headers */,
BE01DABA1E854DB300F3EAF7 /* Helper.hpp in Headers */,
BE4521F21DAFC69D00807035 /* StVenantKirchhoff.hxx in Headers */,
......@@ -11603,7 +11579,6 @@
BE01DAB81E854DB300F3EAF7 /* GlobalVariationalOperator.hpp in Headers */,
BE01DAE81E854DF700F3EAF7 /* LocalVariationalOperator.hpp in Headers */,
BE01DAFB1E854E1900F3EAF7 /* GlobalParameterOperator.hxx in Headers */,
BE01DAD11E854DDD00F3EAF7 /* ExtractBlockFromGlobalMatrix.hpp in Headers */,
BE01DAF31E854E0D00F3EAF7 /* ComputePatternHelper.hpp in Headers */,
BE01DAFF1E854E2500F3EAF7 /* FindCoordsOfGlobalVector.hpp in Headers */,
BE01DACC1E854DD600F3EAF7 /* GradientDisplacementMatrix.hpp in Headers */,
......@@ -11614,7 +11589,6 @@
BE01DAFD1E854E1F00F3EAF7 /* LocalParameterOperator.hxx in Headers */,
BE01DAF41E854E0D00F3EAF7 /* ComputePatternHelper.hxx in Headers */,
BE01DAF61E854E1200F3EAF7 /* LagrangianInterpolator.hxx in Headers */,
BE01DAD21E854DDD00F3EAF7 /* ExtractBlockFromGlobalMatrix.hxx in Headers */,
BE4521EC1DAFC69D00807035 /* CiarletGeymonat.hxx in Headers */,
BE01DAE61E854DF700F3EAF7 /* ElementaryDataImpl.hpp in Headers */,
BE01DABD1E854DB300F3EAF7 /* LocalVariationalOperatorIterator.hxx in Headers */,
......@@ -11626,7 +11600,6 @@
BE01DAD01E854DD600F3EAF7 /* InformationsAtQuadraturePoint.hxx in Headers */,
BE01DAF01E854E0700F3EAF7 /* LagrangianInterpolator.hpp in Headers */,
BE01DAFC1E854E1F00F3EAF7 /* LocalParameterOperator.hpp in Headers */,
BE01DAD51E854DDD00F3EAF7 /* ExtractBlockFromGlobalVector.hxx in Headers */,
BE01DB001E854E2500F3EAF7 /* FindCoordsOfGlobalVector.hxx in Headers */,
BE01DABE1E854DC600F3EAF7 /* BilinearLocalVariationalOperator.hpp in Headers */,
BE01DAEC1E854E0100F3EAF7 /* InterpolationData.hxx in Headers */,
......@@ -12820,7 +12793,6 @@
BE01DAC81E854DD600F3EAF7 /* ExtractGradientBasedBlock.cpp in Sources */,
BEE45C0A2357BAB400E0AB7C /* InvariantComputation.cpp in Sources */,
BE01DAEA1E854E0100F3EAF7 /* InterpolationData.cpp in Sources */,
BE01DAD31E854DDD00F3EAF7 /* ExtractBlockFromGlobalVector.cpp in Sources */,
BE01DAED1E854E0100F3EAF7 /* SourceOrTargetData.cpp in Sources */,
BE01DACE1E854DD600F3EAF7 /* InformationsAtQuadraturePoint.cpp in Sources */,
13B511031FCD96980080E6F6 /* DetermineExtendedUnknownList.cpp in Sources */,
......@@ -146,7 +146,7 @@ namespace MoReFEM
scalar_initial_condition_ptr scalar_initial_condition_z_;
//! Content of the parameter.
mutable XtensorVector content_;
mutable LocalVector content_;
};
......
......@@ -68,7 +68,7 @@ namespace MoReFEM
}
inline const XtensorVector& ThreeDimensionalInitialCondition::SupplGetValue(const SpatialPoint& coords) const
inline const LocalVector& ThreeDimensionalInitialCondition::SupplGetValue(const SpatialPoint& coords) const
{
content_(0) = GetScalarInitialConditionX().GetValue(coords);
content_(1) = GetScalarInitialConditionY().GetValue(coords);
......
......@@ -36,7 +36,7 @@ namespace MoReFEM
}
const XtensorMatrix& ComputeJacobian::Compute(const GeometricElt& geometric_elt,
const LocalMatrix& ComputeJacobian::Compute(const GeometricElt& geometric_elt,
const LocalCoords& local_coords)
{
const unsigned int Ncoords = geometric_elt.Ncoords();
......
......@@ -112,7 +112,7 @@ namespace MoReFEM
*
* \return Jacobian matrix.
*/
const XtensorMatrix& Compute(const GeometricElt& geom_elt,
const LocalMatrix& Compute(const GeometricElt& geom_elt,
const LocalCoords& local_coords);
private:
......@@ -121,7 +121,7 @@ namespace MoReFEM
* \brief Non constant accessor to the matrix that holds the result of the computation; it should not
* be accessible publicly.
*/
XtensorMatrix& GetNonCstJacobian() noexcept;
LocalMatrix& GetNonCstJacobian() noexcept;
/*!
* \brief Non constant accessor to the values of the first derivates of the shape function,
......@@ -137,7 +137,7 @@ namespace MoReFEM
private:
//! Matrix that holds the result of the computation; it should not be accessible publicly.
XtensorMatrix jacobian_;
LocalMatrix jacobian_;
/*!
* \brief Values of the first derivates of the shape function, updated along \a jacobian_.
......
......@@ -28,7 +28,7 @@ namespace MoReFEM
{
inline XtensorMatrix& ComputeJacobian::GetNonCstJacobian() noexcept
inline LocalMatrix& ComputeJacobian::GetNonCstJacobian() noexcept
{
return jacobian_;
}
......
......@@ -140,10 +140,10 @@ namespace MoReFEM
const std::vector<unsigned int>& GetVertexCoordsIndexList() const;
//! Constant accessor on the pseudo-normal.
const XtensorVector& GetPseudoNormal() const noexcept;
const LocalVector& GetPseudoNormal() const noexcept;
//! Constant accessor on the pointer of the pseudo-normal.
const std::unique_ptr<XtensorVector>& GetPseudoNormalPtr() const noexcept;
const std::unique_ptr<LocalVector>& GetPseudoNormalPtr() const noexcept;
protected:
......@@ -172,7 +172,7 @@ namespace MoReFEM
void SetVertexCoordsList(const Coords::vector_raw_ptr& coords_list);
//! Non constant accessor on the pseudo-normal.
XtensorVector& GetNonCstPseudoNormal() noexcept;
LocalVector& GetNonCstPseudoNormal() noexcept;
private:
......@@ -212,7 +212,7 @@ namespace MoReFEM
protected:
//! Pseudo-normal of the interface.
std::unique_ptr<XtensorVector> pseudo_normal_ = nullptr;
std::unique_ptr<LocalVector> pseudo_normal_ = nullptr;
};
......
......@@ -93,19 +93,19 @@ namespace MoReFEM
}
inline const XtensorVector& Interface::GetPseudoNormal() const noexcept
inline const LocalVector& Interface::GetPseudoNormal() const noexcept
{
assert(!(!pseudo_normal_));
return *pseudo_normal_;
}
inline XtensorVector& Interface::GetNonCstPseudoNormal() noexcept
inline LocalVector& Interface::GetNonCstPseudoNormal() noexcept
{
return const_cast<XtensorVector&>(GetPseudoNormal());
return const_cast<LocalVector&>(GetPseudoNormal());
}
inline const std::unique_ptr<XtensorVector>& Interface::GetPseudoNormalPtr() const noexcept
inline const std::unique_ptr<LocalVector>& Interface::GetPseudoNormalPtr() const noexcept
{
return pseudo_normal_;
}
......
......@@ -67,8 +67,8 @@ namespace MoReFEM
* \todo Improve the comment by writing its mathematical definition!
*/
class GradOnGradientBasedElasticityTensor final
: public BilinearLocalVariationalOperator<XtensorMatrix>,
public Crtp::LocalMatrixStorage<GradOnGradientBasedElasticityTensor, 4ul, XtensorMatrix>
: public BilinearLocalVariationalOperator<LocalMatrix>,
public Crtp::LocalMatrixStorage<GradOnGradientBasedElasticityTensor, 4ul, LocalMatrix>
{
public:
......@@ -83,7 +83,7 @@ namespace MoReFEM
static const std::string& ClassName();
//! Alias to parent.
using parent = BilinearLocalVariationalOperator<XtensorMatrix>;
using parent = BilinearLocalVariationalOperator<LocalMatrix>;
//! Unique ptr to type of scalar parameters (Young modulus, Poisson ratio, etc...).
using scalar_parameter = ScalarParameter<ParameterNS::TimeDependencyNS::None>;
......@@ -92,7 +92,7 @@ namespace MoReFEM
using matrix_parameter = Parameter<ParameterNS::Type::matrix, LocalCoords, ParameterNS::TimeDependencyNS::None>;
//! Alias to the parent that provides LocalMatrixStorage.
using matrix_parent = Crtp::LocalMatrixStorage<self, 4ul, XtensorMatrix>;
using matrix_parent = Crtp::LocalMatrixStorage<self, 4ul, LocalMatrix>;
public:
......
......@@ -36,7 +36,7 @@ namespace MoReFEM
/*!
* \brief Implementation of mass operator.
*/
class Mass final : public BilinearLocalVariationalOperator<XtensorMatrix>
class Mass final : public BilinearLocalVariationalOperator<LocalMatrix>
{
public:
......@@ -48,7 +48,7 @@ namespace MoReFEM
static const std::string& ClassName();
//! Alias to parent.
using parent = BilinearLocalVariationalOperator<XtensorMatrix>;
using parent = BilinearLocalVariationalOperator<LocalMatrix>;
public:
......
......@@ -48,7 +48,7 @@ namespace MoReFEM
ParameterNS::Type TypeT,
template<ParameterNS::Type> class TimeDependencyT
>
class TransientSource final : public LinearLocalVariationalOperator<XtensorVector>
class TransientSource final : public LinearLocalVariationalOperator<LocalVector>
{
public:
......@@ -63,7 +63,7 @@ namespace MoReFEM
using parameter_type = Parameter<TypeT, LocalCoords, TimeDependencyT>;
//! Alias to parent.
using parent = LinearLocalVariationalOperator<XtensorVector>;
using parent = LinearLocalVariationalOperator<LocalVector>;
//! Returns the name of the operator.
static const std::string& ClassName();
......
......@@ -51,7 +51,7 @@ namespace MoReFEM
/*!
* \brief Class that interprets in a more usable format the line of a Seldon matrix.
* \brief Class that interprets in a more usable format the line of a local matrix.
*/
class LocalRowContent
{
......
......@@ -248,7 +248,7 @@ namespace MoReFEM
local_felt_space.GetLocal2Global<MpiScale::program_wise>(test_unknown_list);
// \todo #1292 assert(static_cast<int>(local_2_global.size()) == local_vector.GetSize());
if constexpr(std::is_same<std::decay_t<decltype(local_vector)>, XtensorVector>())
if constexpr(std::is_same<std::decay_t<decltype(local_vector)>, LocalVector>())
global_vector.SetValues(local_2_global,
local_vector.data(),
ADD_VALUES,
......
/*!
//
// \file
//
//
// Created by Sebastien Gilles <sebastien.gilles@inria.fr> on the Thu, 15 Sep 2016 10:41:02 +0200
// Copyright (c) Inria. All rights reserved.
//
// \ingroup OperatorsGroup
// \addtogroup OperatorsGroup
// \{
*/
#ifndef MOREFEM_x_OPERATORS_x_LOCAL_VARIATIONAL_OPERATOR_x_ADVANCED_x_EXTRACT_BLOCK_FROM_LINEAR_ALGEBRA_x_EXTRACT_BLOCK_FROM_GLOBAL_MATRIX_HPP_
# define MOREFEM_x_OPERATORS_x_LOCAL_VARIATIONAL_OPERATOR_x_ADVANCED_x_EXTRACT_BLOCK_FROM_LINEAR_ALGEBRA_x_EXTRACT_BLOCK_FROM_GLOBAL_MATRIX_HPP_
# include "ThirdParty/Wrappers/Xtensor/Functions.hpp"
# include "Utilities/MatrixOrVector.hpp"
# include "FiniteElement/RefFiniteElement/Advanced/RefFEltInLocalOperator.hpp"
namespace MoReFEM
{
namespace Advanced
{
namespace LocalVariationalOperatorNS
{
# ifndef NDEBUG
// ============================
//! \cond IGNORE_BLOCK_IN_DOXYGEN
// ============================
/*!
* \brief Extract a block from a matrix; modifications in that block will be reported automatically in the bigger
* matrix.
*
* \attention Actually this should be used for debug purposes, at least for the read-only use; usually it
* is much more efficient to control tightly your indexes and navigate through the bigger matrix directly.
*
*
* The finite element matrix looks for instance like (for a 3D Stokes problem here):
*
* (vx1 vx2 ... vy1 vy2 ... vz1 vz2 ... p1 p2 ...)
* (vx1)
* (vx2)
* ...
* (vy1)
* (vy2)
* ...
* (vz1)
* (vz2)
* ...
* (p1)
* (p2)
* ...
*
* So it forms underlying blocks for each pair variable/component. The purpose of the current function
* is to return the index of the first component block (so here velocity would get 0 and pressure would
* get 3).
*
*
*/
template<class MatrixTypeT>
::Seldon::SubMatrix<MatrixTypeT> ExtractBlockFromLocalMatrix(const Advanced::RefFEltInLocalOperator& ref_felt1,
unsigned int component1,
const Advanced::RefFEltInLocalOperator& ref_felt2,
unsigned int component2,
MatrixTypeT& matrix);
template<class MatrixTypeT>
::Seldon::SubMatrix<MatrixTypeT> ExtractBlockFromLocalMatrix(const Advanced::RefFEltInLocalOperator& ref_felt1,
const Advanced::RefFEltInLocalOperator& ref_felt2,
MatrixTypeT& matrix);
template<class MatrixTypeT>
::Seldon::SubMatrix<MatrixTypeT> ExtractBlockFromLocalMatrix(const Advanced::RefFEltInLocalOperator& ref_felt,
unsigned int component,
MatrixTypeT& matrix);
// ============================
//! \endcond IGNORE_BLOCK_IN_DOXYGEN
// ============================
# endif // NDEBUG
} // namespace LocalVariationalOperatorNS
} // namespace Advanced
} // namespace Advanced
} // namespace MoReFEM
/// @} // addtogroup OperatorsGroup
# include "Operators/LocalVariationalOperator/Advanced/ExtractBlockFromLinearAlgebra/ExtractBlockFromGlobalMatrix.hxx"
#endif // MOREFEM_x_OPERATORS_x_LOCAL_VARIATIONAL_OPERATOR_x_ADVANCED_x_EXTRACT_BLOCK_FROM_LINEAR_ALGEBRA_x_EXTRACT_BLOCK_FROM_GLOBAL_MATRIX_HPP_
/*!
//
// \file
//
//
// Created by Sebastien Gilles <sebastien.gilles@inria.fr> on the Thu, 15 Sep 2016 10:41:02 +0200
// Copyright (c) Inria. All rights reserved.
//
// \ingroup OperatorsGroup
// \addtogroup OperatorsGroup
// \{
*/
#ifndef MOREFEM_x_OPERATORS_x_LOCAL_VARIATIONAL_OPERATOR_x_ADVANCED_x_EXTRACT_BLOCK_FROM_LINEAR_ALGEBRA_x_EXTRACT_BLOCK_FROM_GLOBAL_MATRIX_HXX_
# define MOREFEM_x_OPERATORS_x_LOCAL_VARIATIONAL_OPERATOR_x_ADVANCED_x_EXTRACT_BLOCK_FROM_LINEAR_ALGEBRA_x_EXTRACT_BLOCK_FROM_GLOBAL_MATRIX_HXX_
namespace MoReFEM
{
namespace Advanced
{
namespace LocalVariationalOperatorNS
{
# ifndef NDEBUG
template<class MatrixTypeT>
::Seldon::SubMatrix<MatrixTypeT>
ExtractBlockFromLocalMatrix(const Advanced::RefFEltInLocalOperator& ref_felt1, const unsigned int component1,
const Advanced::RefFEltInLocalOperator& ref_felt2, const unsigned int component2,
MatrixTypeT& matrix)
{
const auto& row_range = ref_felt1.GetLocalDofIndexList(component1);
const auto& col_range = ref_felt2.GetLocalDofIndexList(component2);
// \todo #1292 Wrappers::Xtensor::AssertBlockValidity(matrix, row_range, col_range);
::Seldon::SubMatrix<MatrixTypeT> ret(matrix, row_range, col_range);
return ret;
}
template<class MatrixTypeT>
::Seldon::SubMatrix<MatrixTypeT>
ExtractBlockFromLocalMatrix(const Advanced::RefFEltInLocalOperator& ref_felt1,
const Advanced::RefFEltInLocalOperator& ref_felt2,
MatrixTypeT& matrix)
{
const auto& row_range = ref_felt1.GetLocalDofIndexList();
const auto& col_range = ref_felt2.GetLocalDofIndexList();
// \todo #1292 Wrappers::Xtensor::AssertBlockValidity(matrix, row_range, col_range);
::Seldon::SubMatrix<MatrixTypeT> ret(matrix, row_range, col_range);
return ret;
}
template<class MatrixTypeT>
::Seldon::SubMatrix<MatrixTypeT>
ExtractBlockFromLocalMatrix(const Advanced::RefFEltInLocalOperator& ref_felt,
const unsigned int component,
MatrixTypeT& matrix)
{
const auto& row_and_col_range = ref_felt.GetLocalDofIndexList(component);
// \todo #1292 Wrappers::Xtensor::AssertBlockValidity(matrix, row_and_col_range, row_and_col_range);
::Seldon::SubMatrix<MatrixTypeT> ret(matrix, row_and_col_range, row_and_col_range);
return ret;
}
# endif // NDEBUG
} // namespace LocalVariationalOperatorNS
} // namespace Advanced
} // namespace Advanced
} // namespace MoReFEM
/// @} // addtogroup OperatorsGroup
#endif // MOREFEM_x_OPERATORS_x_LOCAL_VARIATIONAL_OPERATOR_x_ADVANCED_x_EXTRACT_BLOCK_FROM_LINEAR_ALGEBRA_x_EXTRACT_BLOCK_FROM_GLOBAL_MATRIX_HXX_
/*!
//
// \file
//
//
// Created by Sebastien Gilles <sebastien.gilles@inria.fr> on the Thu, 15 Sep 2016 10:41:02 +0200
// Copyright (c) Inria. All rights reserved.
//
// \ingroup OperatorsGroup
// \addtogroup OperatorsGroup
// \{
*/
#include "Operators/LocalVariationalOperator/Advanced/ExtractBlockFromLinearAlgebra/ExtractBlockFromGlobalVector.hpp"
namespace MoReFEM
{
namespace Advanced
{
namespace LocalVariationalOperatorNS
{
# ifndef NDEBUG
// ::Seldon::SubVector<LocalVector>
// ExtractBlockFromLocalVector(const Advanced::RefFEltInLocalOperator& ref_felt,
// const unsigned int component,
// LocalVector& vector)
// {
// const auto& row_range = ref_felt.GetLocalDofIndexList(component);
//
// // \todo #1292 Wrappers::Xtensor::AssertBlockValidity(vector, row_range);
// ::Seldon::SubVector<LocalVector> ret(vector, row_range);
//
// return ret;
// }
//
//
// ::Seldon::SubVector<LocalVector>
// ExtractBlockFromLocalVector(const Advanced::RefFEltInLocalOperator& ref_felt,
// LocalVector& vector)
// {
// const auto& row_range = ref_felt.GetLocalDofIndexList();
// // \todo #1292 Wrappers::Xtensor::AssertBlockValidity(vector, row_range);
// ::Seldon::SubVector<LocalVector> ret(vector, row_range);
//
// return ret;
// }
# endif // NDEBUG