19 offsets(GetBlockOffsets(fespaces)),
20 prolongColOffsets(GetProColBlockOffsets(fespaces)),
21 restrictRowOffsets(GetResRowBlockOffsets(fespaces)),
23 prolongation(offsets, prolongColOffsets),
24 restriction(restrictRowOffsets, offsets)
26 for (
size_t i = 0; i <fespaces.size(); i++)
30 auto prolongation_matrix = fespaces[i]->GetProlongationMatrix();
31 auto restriction_matrix = fespaces[i]->GetRestrictionOperator();
37int BlockFESpaceOperator::GetHeight(
const FESVector &fespaces)
40 for (
size_t i = 0; i < fespaces.size(); i++)
42 height += fespaces[i]->GetVSize();
47Array<int> BlockFESpaceOperator::GetBlockOffsets(
const FESVector &fespaces)
49 Array<int> offsets(fespaces.size()+1);
51 for (
size_t i = 1; i <=fespaces.size(); i++)
53 offsets[i] = fespaces[i-1]->GetVSize();
60Array<int> BlockFESpaceOperator::GetProColBlockOffsets(
const FESVector
63 Array<int> offsets(fespaces.size()+1);
65 for (
size_t i = 1; i <=fespaces.size(); i++)
67 const auto *prolong = fespaces[i-1]->GetProlongationMatrix();
70 offsets[i] = prolong->Width();
74 offsets[i] = fespaces[i-1]->GetVSize();
76 offsets[i] = fespaces[i-1]->GetTrueVSize();
83Array<int> BlockFESpaceOperator::GetResRowBlockOffsets(
const FESVector
86 Array<int> offsets(fespaces.size()+1);
87 std::cout <<
"fespaces.size() = " << fespaces.size() << std::endl;
89 for (
size_t i = 1; i <=fespaces.size(); i++)
91 const auto *restriction = fespaces[i-1]->GetRestrictionOperator();
94 offsets[i] = restriction->
Height();
98 offsets[i] = fespaces[i-1]->GetVSize();
100 offsets[i] = fespaces[i-1]->GetTrueVSize();
109 return &prolongation;
void PartialSum()
Fill the entries of the array with the cumulative sum of the entries.
void Print(std::ostream &out=mfem::out, int width=4) const
Prints array to stream with width elements per row.
const Operator * GetProlongation() const override
Prolongation operator from linear algebra (linear system) vectors, to input vectors for the operator....
BlockFESpaceOperator(const FESVector &fespaces)
Constructor for BlockFESpaceOperator.
const Operator * GetRestriction() const override
Restriction operator from input vectors for the operator to linear algebra (linear system) vectors....
void SetDiagonalBlock(int iblock, Operator *op, real_t c=1.0)
Add block op in the block-entry (iblock, iblock).
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
int height
Dimension of the output / number of rows in the matrix.