public:
void initialize(NamedData<VECTOR*>& results);
/**
- * Initialize the constraints.
+ * Initialize the constraints.
*/
void initialize(const ConstraintMatrix& constraints);
/**
*/
template <class DOFINFO>
void initialize_info(DOFINFO& info, bool face) const;
-
+
/**
* Assemble the local residuals
* into the global residuals.
*/
template <class DOFINFO>
void assemble(const DOFINFO& info);
-
+
/**
* Assemble both local residuals
* into the global residuals.
*/
SmartPointer<const ConstraintMatrix,ResidualSimple<VECTOR> > constraints;
};
-
+
/**
* Assemble local matrices into a single global matrix without using
* block structure.
* the matrix.
*/
MatrixSimple(double threshold = 1.e-12);
-
+
/**
* Store the result matrix
* for later assembling.
*/
void initialize(MATRIX& m);
/**
- * Initialize the constraints.
+ * Initialize the constraints.
*/
void initialize(const ConstraintMatrix& constraints);
/**
*/
template <class DOFINFO>
void initialize_info(DOFINFO& info, bool face) const;
-
+
/**
* Assemble the matrix
* DoFInfo::M1[0]
*/
template<class DOFINFO>
void assemble(const DOFINFO& info);
-
+
/**
* Assemble both local
* matrices in the info
void assemble(const FullMatrix<double>& M,
const std::vector<unsigned int>& i1,
const std::vector<unsigned int>& i2);
-
+
/**
* The global matrix being
* assembled.
* A pointer to the object containing constraints.
*/
SmartPointer<const ConstraintMatrix,MatrixSimple<MATRIX> > constraints;
-
+
/**
* The smallest positive
* number that will be
* not be assembled.
*/
const double threshold;
-
+
};
-
-
+
+
/**
* Assemble local matrices into level matrices without using
* block structure.
* the matrix.
*/
MGMatrixSimple(double threshold = 1.e-12);
-
+
/**
* Store the result matrix
* for later assembling.
/**
* Initialize the multilevel
- * constraints.
+ * constraints.
*/
void initialize(const MGConstrainedDoFs& mg_constrained_dofs);
*/
void initialize_fluxes(MGLevelObject<MATRIX>& flux_up,
MGLevelObject<MATRIX>& flux_down);
-
+
/**
* Initialize the matrices
* #interface_in and #interface_out
*/
template <class DOFINFO>
void initialize_info(DOFINFO& info, bool face) const;
-
+
/**
* Assemble the matrix
* DoFInfo::M1[0]
*/
template<class DOFINFO>
void assemble(const DOFINFO& info);
-
+
/**
* Assemble both local
* matrices in the info
const std::vector<unsigned int>& i1,
const std::vector<unsigned int>& i2,
const unsigned int level);
-
+
/**
* Assemble a single matrix
* into a global matrix.
const FullMatrix<double>& M,
const std::vector<unsigned int>& i1,
const std::vector<unsigned int>& i2,
- const unsigned int level = -1);
+ const unsigned int level = numbers::invalid_unsigned_int);
/**
* Assemble a single matrix
* into a global matrix.
const FullMatrix<double>& M,
const std::vector<unsigned int>& i1,
const std::vector<unsigned int>& i2,
- const unsigned int level = -1);
+ const unsigned int level = numbers::invalid_unsigned_int);
/**
* Assemble a single matrix
const FullMatrix<double>& M,
const std::vector<unsigned int>& i1,
const std::vector<unsigned int>& i2,
- const unsigned int level = -1);
+ const unsigned int level = numbers::invalid_unsigned_int);
/**
* Assemble a single matrix
const FullMatrix<double>& M,
const std::vector<unsigned int>& i1,
const std::vector<unsigned int>& i2,
- const unsigned int level = -1);
-
+ const unsigned int level = numbers::invalid_unsigned_int);
+
/**
* The global matrix being
* assembled.
*/
SmartPointer<MGLevelObject<MATRIX>,MGMatrixSimple<MATRIX> > matrix;
-
+
/**
* The matrix used for face
* flux terms across the
* coarse to fine.
*/
SmartPointer<MGLevelObject<MATRIX>,MGMatrixSimple<MATRIX> > flux_up;
-
+
/**
* The matrix used for face
* flux terms across the
* coarse to fine.
*/
SmartPointer<MGLevelObject<MATRIX>,MGMatrixSimple<MATRIX> > interface_in;
-
+
/**
* The matrix used for face
* contributions for continuous
* A pointer to the object containing constraints.
*/
SmartPointer<const MGConstrainedDoFs,MGMatrixSimple<MATRIX> > mg_constrained_dofs;
-
+
/**
* The smallest positive
* number that will be
* not be assembled.
*/
const double threshold;
-
+
};
-
-
+
+
/**
* Assemble a simple matrix and a simple right hand side at once. We
* use a combination of MatrixSimple and ResidualSimple to achieve
* is assembled into.
*/
void initialize(MATRIX& m, VECTOR& rhs);
-
+
/**
* Initialize the local data
* in the
*/
template <class DOFINFO>
void initialize_info(DOFINFO& info, bool face) const;
-
+
/**
* Assemble the matrix
* DoFInfo::M1[0]
*/
template<class DOFINFO>
void assemble(const DOFINFO& info);
-
+
/**
* Assemble both local
* matrices in the info
const DOFINFO& info2);
};
-
+
//----------------------------------------------------------------------//
template <class VECTOR>
constraints = &c;
}
-
+
template <class VECTOR>
template <class DOFINFO>
inline void
info.initialize_vectors(residuals.size());
}
-
+
template <class VECTOR>
template <class DOFINFO>
inline void
}
}
-
+
template <class VECTOR>
template <class DOFINFO>
inline void
}
}
-
+
//----------------------------------------------------------------------//
template <class MATRIX>
:
threshold(threshold)
{}
-
-
+
+
template <class MATRIX>
inline void
MatrixSimple<MATRIX>::initialize(MATRIX& m)
{
constraints = &c;
}
-
+
template <class MATRIX >
template <class DOFINFO>
{
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
-
+
if(constraints == 0)
- {
+ {
for (unsigned int j=0; j<i1.size(); ++j)
for (unsigned int k=0; k<i2.size(); ++k)
if (std::fabs(M(j,k)) >= threshold)
constraints->distribute_local_to_global(
M, i1, i2, *matrix);
}
-
-
+
+
template <class MATRIX>
template <class DOFINFO>
inline void
{
assemble(info.matrix(0,false).matrix, info.indices, info.indices);
}
-
+
template <class MATRIX>
template <class DOFINFO>
assemble(info2.matrix(0,false).matrix, info2.indices, info2.indices);
assemble(info2.matrix(0,true).matrix, info2.indices, info1.indices);
}
-
-
+
+
//----------------------------------------------------------------------//
template <class MATRIX>
:
threshold(threshold)
{}
-
-
+
+
template <class MATRIX>
inline void
MGMatrixSimple<MATRIX>::initialize(MGLevelObject<MATRIX>& m)
{
matrix = &m;
}
-
+
template <class MATRIX>
inline void
MGMatrixSimple<MATRIX>::initialize(const MGConstrainedDoFs& c)
flux_up = &up;
flux_down = &down;
}
-
+
template <class MATRIX>
inline void
{
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
-
+
if(mg_constrained_dofs == 0)
{
for (unsigned int j=0; j<i1.size(); ++j)
{
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
-
+
if(mg_constrained_dofs == 0)
{
for (unsigned int j=0; j<i1.size(); ++j)
}
}
}
-
-
+
+
template <class MATRIX>
inline void
MGMatrixSimple<MATRIX>::assemble_up(
{
AssertDimension(M.n(), i1.size());
AssertDimension(M.m(), i2.size());
-
+
if(mg_constrained_dofs == 0)
{
for (unsigned int j=0; j<i1.size(); ++j)
{
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
-
+
if(mg_constrained_dofs == 0)
{
for (unsigned int j=0; j<i1.size(); ++j)
{
AssertDimension(M.m(), i1.size());
AssertDimension(M.n(), i2.size());
-
+
if(mg_constrained_dofs == 0)
{
for (unsigned int j=0; j<i1.size(); ++j)
}
}
}
-
+
template <class MATRIX>
inline void
MGMatrixSimple<MATRIX>::assemble_out(
{
AssertDimension(M.n(), i1.size());
AssertDimension(M.m(), i2.size());
-
+
if(mg_constrained_dofs == 0)
{
for (unsigned int j=0; j<i1.size(); ++j)
if (mg_constrained_dofs->set_boundary_values())
{
if((!mg_constrained_dofs->at_refinement_edge_boundary(level, i1[j]) &&
- !mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k]))
+ !mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k]))
||
(mg_constrained_dofs->at_refinement_edge_boundary(level, i1[j]) &&
mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k]) &&
}
}
}
-
-
+
+
template <class MATRIX>
template <class DOFINFO>
inline void
assemble_out((*interface_out)[level],info.matrix(0,false).matrix, info.indices, info.indices, level);
}
}
-
+
template <class MATRIX>
template <class DOFINFO>
{
const unsigned int level1 = info1.cell->level();
const unsigned int level2 = info2.cell->level();
-
+
if (level1 == level2)
{
if(mg_constrained_dofs == 0)
NamedData<VECTOR*> data;
VECTOR* p = &rhs;
data.add(p, "right hand side");
-
+
MatrixSimple<MATRIX>::initialize(m);
ResidualSimple<VECTOR>::initialize(data);
}
-
+
template <class MATRIX, class VECTOR>
template <class DOFINFO>
inline void
{
MatrixSimple<MATRIX>::assemble(info1, info2);
ResidualSimple<VECTOR>::assemble(info1, info2);
- }
+ }
}
}