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

Make assemble_nonlinearity a factory method

parent 63444a39
No related branches found
No related tags found
No related merge requests found
...@@ -140,10 +140,9 @@ void assemble_frictional( ...@@ -140,10 +140,9 @@ void assemble_frictional(
} }
template <class VectorType, class MatrixType> template <class VectorType, class MatrixType>
void assemble_nonlinearity( Dune::shared_ptr<Dune::GlobalNonlinearity<VectorType, MatrixType> const>
assemble_nonlinearity(
int size, Dune::ParameterTree const &parset, int size, Dune::ParameterTree const &parset,
Dune::shared_ptr<Dune::GlobalNonlinearity<VectorType, MatrixType> const> &
myGlobalNonlinearity,
Dune::shared_ptr<Dune::BlockVector<Dune::FieldVector<double, 1>>> Dune::shared_ptr<Dune::BlockVector<Dune::FieldVector<double, 1>>>
nodalIntegrals) { nodalIntegrals) {
typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType; typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType;
...@@ -164,11 +163,11 @@ void assemble_nonlinearity( ...@@ -164,11 +163,11 @@ void assemble_nonlinearity(
auto eta = Dune::make_shared<SingletonVectorType>(size); auto eta = Dune::make_shared<SingletonVectorType>(size);
*eta = parset.get<double>("boundary.friction.eta"); *eta = parset.get<double>("boundary.friction.eta");
myGlobalNonlinearity = Dune::make_shared< return Dune::make_shared<
Dune::GlobalRuinaNonlinearity<VectorType, MatrixType> const>( Dune::GlobalRuinaNonlinearity<VectorType, MatrixType> const>(
nodalIntegrals, a, mu, eta, normalStress); nodalIntegrals, a, mu, eta, normalStress);
} else if (friction_model == std::string("Laursen")) { } else if (friction_model == std::string("Laursen")) {
myGlobalNonlinearity = Dune::make_shared<Dune::GlobalLaursenNonlinearity< return Dune::make_shared<Dune::GlobalLaursenNonlinearity<
Dune::LinearFunction, VectorType, MatrixType> const>(mu, normalStress, Dune::LinearFunction, VectorType, MatrixType> const>(mu, normalStress,
nodalIntegrals); nodalIntegrals);
} else { } else {
...@@ -272,11 +271,8 @@ int main(int argc, char *argv[]) { ...@@ -272,11 +271,8 @@ int main(int argc, char *argv[]) {
assemble_frictional<GridType, GridView, SmallVector, P1Basis>( assemble_frictional<GridType, GridView, SmallVector, P1Basis>(
leafView, p1Basis, frictionalNodes, *nodalIntegrals); leafView, p1Basis, frictionalNodes, *nodalIntegrals);
Dune::shared_ptr<Dune::GlobalNonlinearity<VectorType, OperatorType> const> auto myGlobalNonlinearity = assemble_nonlinearity<VectorType, OperatorType>(
myGlobalNonlinearity; grid->size(grid->maxLevel(), dim), parset, nodalIntegrals);
assemble_nonlinearity<VectorType, OperatorType>(
grid->size(grid->maxLevel(), dim), parset, myGlobalNonlinearity,
nodalIntegrals);
// {{{ Set up TNNMG solver // {{{ Set up TNNMG solver
// linear iteration step components // 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