Skip to content
Snippets Groups Projects
Commit 263c24da authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Cleanup

parent 76bd98ae
No related branches found
No related tags found
No related merge requests found
......@@ -11,39 +11,31 @@
\tparam MatrixTypeTEMPLATE The type used for the matrix of the quadratic
part
*/
template <class NonlinearityTypeTEMPLATE, class MatrixTypeTEMPLATE>
template <class NonlinearityTypeTEMPLATE, class MatrixTypeTEMPLATE,
class VectorTypeTEMPLATE>
class MyConvexProblem {
public:
typedef NonlinearityTypeTEMPLATE NonlinearityType;
typedef typename NonlinearityType::VectorType VectorType;
typedef VectorTypeTEMPLATE VectorType;
typedef MatrixTypeTEMPLATE MatrixType;
typedef typename NonlinearityType::LocalVectorType LocalVectorType;
typedef typename VectorType::block_type LocalVectorType;
typedef typename MatrixType::block_type LocalMatrixType;
static const int block_size = NonlinearityType::block_size;
/** \brief Constructor with the problem components
\param a A scalar factor in front of the quadratic part (the quadratic
part includes a factor of 1/2 already)
\param A The matrix of the quadratic part
\param am A scalar factor in front of the optional rank-one matrix
\param Am A rank-one matrix given by a single vector. The matrix is
AmAm^T
\param phi The nonlinearity
\param f The linear functional
\param u The solution vector
*/
MyConvexProblem(double a, const MatrixType& A, double am,
const VectorType& Am, NonlinearityType& phi,
MyConvexProblem(const MatrixType& A, NonlinearityType& phi,
const VectorType& f, VectorType& u)
: a(a), A(A), am(am), Am(Am), phi(phi), f(f), u(u) {};
: A(A), phi(phi), f(f), u(u) {};
double a;
const MatrixType& A;
double am;
const VectorType& Am;
NonlinearityType& phi;
const VectorType& f;
......
......@@ -142,12 +142,10 @@ int main() {
typedef ZeroNonlinearity<SmallVector, SmallMatrix> NonlinearityType;
NonlinearityType phi;
typedef MyConvexProblem<NonlinearityType, OperatorType>
typedef MyConvexProblem<NonlinearityType, OperatorType, VectorType>
MyConvexProblemType;
VectorType unused_vector(grid.size(grid.maxLevel(), dim), 0);
MyConvexProblemType myConvexProblem(1, stiffnessMatrix, 0, unused_vector,
phi, f, u1);
MyConvexProblemType myConvexProblem(stiffnessMatrix, phi, f, u1);
typedef MyBlockProblem<MyConvexProblemType> MyBlockProblemType;
MyBlockProblemType myBlockProblem(myConvexProblem);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment