Commit 09a52cb1 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#527 GlobalMatrix: add numbering subset attributes.

parent ece5dc60
......@@ -6,22 +6,34 @@
// Copyright (c) 2015 Inria. All rights reserved.
//
#include "Core/LinearAlgebra/GlobalMatrix.hpp"
#include "Core/NumberingSubset.hpp"
namespace HappyHeart
{
GlobalMatrix::GlobalMatrix(const NumberingSubset& row_numbering_subset,
const NumberingSubset& col_numbering_subset)
: row_numbering_subset_(row_numbering_subset),
col_numbering_subset_(col_numbering_subset)
{ }
GlobalMatrix::GlobalMatrix(const GlobalMatrix& rhs)
: Parent(rhs)
: Parent(rhs),
row_numbering_subset_(rhs.row_numbering_subset_),
col_numbering_subset_(rhs.col_numbering_subset_)
{ }
void Swap(GlobalMatrix& A, GlobalMatrix& B)
{
// \todo #527 Add assert about numbering subset!
assert(A.GetColNumberingSubset() == B.GetColNumberingSubset());
assert(A.GetRowNumberingSubset() == B.GetRowNumberingSubset());
using Parent = GlobalMatrix::Parent;
......
......@@ -57,7 +57,8 @@ namespace HappyHeart
///@{
//! Constructor.
explicit GlobalMatrix() = default;
explicit GlobalMatrix(const NumberingSubset& row_numbering_subset,
const NumberingSubset& col_numbering_subset);
//! Destructor.
~GlobalMatrix() = default;
......@@ -75,10 +76,21 @@ namespace HappyHeart
GlobalMatrix& operator=(GlobalMatrix&&) = default;
///@}
//! Numbering subset used to describe rows.
const NumberingSubset& GetRowNumberingSubset() const;
//! Numbering subset used to describe columns.
const NumberingSubset& GetColNumberingSubset() const;
private:
private:
//! Numbering subset used to describe rows.
const NumberingSubset& row_numbering_subset_;
//! Numbering subset used to describe columns.
const NumberingSubset& col_numbering_subset_;
};
......
......@@ -13,10 +13,19 @@
namespace HappyHeart
{
inline const NumberingSubset& GlobalMatrix::GetRowNumberingSubset() const
{
return row_numbering_subset_;
}
inline const NumberingSubset& GlobalMatrix::GetColNumberingSubset() const
{
return col_numbering_subset_;
}
} // namespace HappyHeart
......
......@@ -74,8 +74,10 @@ namespace HappyHeart
InterpolateToSubsetFeltSpace::InterpolateToSubsetFeltSpace(const FEltSpace& original,
const FEltSpace& subset)
: projection_matrix_(std::make_unique<GlobalMatrix>())
const FEltSpace& subset,
const NumberingSubset& row_numbering_subset,
const NumberingSubset& col_numbering_subset)
: projection_matrix_(std::make_unique<GlobalMatrix>(row_numbering_subset, col_numbering_subset))
{
auto god_of_dof_ptr = original.GetGodOfDofPtr(); // not a reference on purpose!
assert(!(!god_of_dof_ptr));
......
......@@ -21,8 +21,18 @@ namespace HappyHeart
{
// Forward declaration.
// ============================
// Forward declarations.
// ============================
class FEltSpace;
class NumberingSubset;
// ============================
// End of forward declarations.
// ============================
namespace InterpolationOperatorNS
......@@ -50,7 +60,9 @@ namespace HappyHeart
//! Constructor.
explicit InterpolateToSubsetFeltSpace(const FEltSpace& original,
const FEltSpace& subset);
const FEltSpace& subset,
const NumberingSubset& row_numbering_subset,
const NumberingSubset& col_numbering_subset);
//! Destructor.
~InterpolateToSubsetFeltSpace() = default;
......
......@@ -30,7 +30,7 @@ namespace HappyHeart
GlobalMatrixWithNumberingSubsetPair
::GlobalMatrixWithNumberingSubsetPair(const NumberingSubset& a_row_numbering_subset,
const NumberingSubset& a_col_numbering_subset)
: global_matrix(std::make_unique<GlobalMatrix>()),
: global_matrix(std::make_unique<GlobalMatrix>(a_row_numbering_subset, a_col_numbering_subset)),
row_numbering_subset(a_row_numbering_subset),
col_numbering_subset(a_col_numbering_subset)
{ }
......
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