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

Be explicit about templates

parent 799fd55f
Branches
No related tags found
No related merge requests found
......@@ -123,8 +123,9 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
localb = <b - Au, v>
*/
MyDirectionalConvexFunction<Dune::GlobalNonlinearity<block_size>> const psi(
localA, localb, problem.phi, u, v);
MyDirectionalConvexFunction<
Dune::GlobalNonlinearity<block_size, VectorType, MatrixType>> const
psi(localA, localb, problem.phi, u, v);
Interval<double> D;
psi.subDiff(0, D);
......@@ -197,7 +198,8 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
linearization.A.mv(direction, tmp); // Av
double const localb = tmp * direction; // <Av,v>
MyDirectionalConvexFunction<Dune::GlobalNonlinearity<block_size>> const
MyDirectionalConvexFunction<
Dune::GlobalNonlinearity<block_size, VectorType, MatrixType>> const
psi(localA, localb, problem.phi, u, direction);
Interval<double> D;
......
......@@ -21,13 +21,14 @@ class MyConvexProblem {
\param f The linear functional
\param u The solution vector
*/
MyConvexProblem(MatrixType const &A,
Dune::GlobalNonlinearity<block_size> const &phi,
VectorType const &f)
MyConvexProblem(
MatrixType const &A,
Dune::GlobalNonlinearity<block_size, VectorType, MatrixType> const &phi,
VectorType const &f)
: A(A), phi(phi), f(f) {};
MatrixType const &A;
Dune::GlobalNonlinearity<block_size> const &phi;
Dune::GlobalNonlinearity<block_size, VectorType, MatrixType> const &phi;
VectorType const &f;
};
......
......@@ -136,9 +136,11 @@ void assemble_frictional(
true); // whether to resize the output vector and zero all of its entries
}
template <class VectorType, class MatrixType>
void assemble_nonlinearity(
int size, Dune::ParameterTree const &parset,
Dune::shared_ptr<Dune::GlobalNonlinearity<dim> const> &myGlobalNonlinearity,
Dune::shared_ptr<Dune::GlobalNonlinearity<
dim, VectorType, MatrixType> const> &myGlobalNonlinearity,
Dune::shared_ptr<Dune::BlockVector<Dune::FieldVector<double, 1>>>
nodalIntegrals) {
typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType;
......@@ -159,13 +161,14 @@ void assemble_nonlinearity(
auto eta = Dune::make_shared<SingletonVectorType>(size);
*eta = parset.get<double>("boundary.friction.eta");
myGlobalNonlinearity =
Dune::make_shared<Dune::GlobalRuinaNonlinearity<dim> const>(
nodalIntegrals, a, mu, eta, normalStress);
myGlobalNonlinearity = Dune::make_shared<
Dune::GlobalRuinaNonlinearity<dim, VectorType, MatrixType> const>(
nodalIntegrals, a, mu, eta, normalStress);
} else if (friction_model == std::string("Laursen")) {
myGlobalNonlinearity = Dune::make_shared<
Dune::GlobalLaursenNonlinearity<dim, Dune::LinearFunction> const>(
mu, normalStress, nodalIntegrals);
Dune::GlobalLaursenNonlinearity<dim, Dune::LinearFunction, VectorType,
MatrixType> const>(mu, normalStress,
nodalIntegrals);
} else {
assert(false);
}
......@@ -266,9 +269,11 @@ int main(int argc, char *argv[]) {
assemble_frictional<GridType, GridView, SmallVector, P1Basis>(
leafView, p1Basis, frictionalNodes, *nodalIntegrals);
Dune::shared_ptr<Dune::GlobalNonlinearity<dim> const> myGlobalNonlinearity;
assemble_nonlinearity(grid.size(grid.maxLevel(), dim), parset,
myGlobalNonlinearity, nodalIntegrals);
Dune::shared_ptr<Dune::GlobalNonlinearity<
dim, VectorType, OperatorType> const> myGlobalNonlinearity;
assemble_nonlinearity<VectorType, OperatorType>(
grid.size(grid.maxLevel(), dim), parset, myGlobalNonlinearity,
nodalIntegrals);
// {{{ Set up TNNMG solver
// linear iteration step components
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment