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

OperatorType -> MatrixType

parent de889a67
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
// {{{ 2D
typedef Dune::FieldVector<double, 2> SmallVector2;
typedef Dune::FieldMatrix<double, 2, 2> SmallMatrix2;
typedef Dune::BCRSMatrix<SmallMatrix2> OperatorType2;
typedef Dune::BCRSMatrix<SmallMatrix2> MatrixType2;
typedef Dune::BlockVector<SmallVector2> VectorType2;
typedef Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming> GridType2;
......@@ -28,8 +28,8 @@ assemble_frictional<GridType2, GridView2, SmallVector2, P1Basis2>(
Dune::BitSetVector<1> const &frictionalNodes);
template Dune::shared_ptr<
Dune::GlobalNonlinearity<VectorType2, OperatorType2> const>
assemble_nonlinearity<VectorType2, OperatorType2>(
Dune::GlobalNonlinearity<VectorType2, MatrixType2> const>
assemble_nonlinearity<VectorType2, MatrixType2>(
Dune::ParameterTree const &parset,
Dune::shared_ptr<Dune::BlockVector<Dune::FieldVector<double, 1>>>
nodalIntegrals,
......@@ -40,7 +40,7 @@ assemble_nonlinearity<VectorType2, OperatorType2>(
// {{{ 3D
typedef Dune::FieldVector<double, 3> SmallVector3;
typedef Dune::FieldMatrix<double, 3, 3> SmallMatrix3;
typedef Dune::BCRSMatrix<SmallMatrix3> OperatorType3;
typedef Dune::BCRSMatrix<SmallMatrix3> MatrixType3;
typedef Dune::BlockVector<SmallVector3> VectorType3;
typedef Dune::ALUGrid<3, 3, Dune::simplex, Dune::nonconforming> GridType3;
......@@ -59,8 +59,8 @@ assemble_frictional<GridType3, GridView3, SmallVector3, P1Basis3>(
Dune::BitSetVector<1> const &frictionalNodes);
template Dune::shared_ptr<
Dune::GlobalNonlinearity<VectorType3, OperatorType3> const>
assemble_nonlinearity<VectorType3, OperatorType3>(
Dune::GlobalNonlinearity<VectorType3, MatrixType3> const>
assemble_nonlinearity<VectorType3, MatrixType3>(
Dune::ParameterTree const &parset,
Dune::shared_ptr<Dune::BlockVector<Dune::FieldVector<double, 1>>>
nodalIntegrals,
......
......@@ -10,9 +10,9 @@
#include "mysolver.hh"
template <int dim, class VectorType, class OperatorType, class GridType,
template <int dim, class VectorType, class MatrixType, class GridType,
class BlockProblemType>
MySolver<dim, VectorType, OperatorType, GridType, BlockProblemType>::MySolver(
MySolver<dim, VectorType, MatrixType, GridType, BlockProblemType>::MySolver(
Dune::ParameterTree parset, int refinements, double solver_tolerance,
GridType const &grid, Dune::BitSetVector<dim> const &ignoreNodes)
: baseEnergyNorm(linearBaseSolverStep),
......@@ -43,22 +43,20 @@ MySolver<dim, VectorType, OperatorType, GridType, BlockProblemType>::MySolver(
multigridStep->ignoreNodes_ = &ignoreNodes;
}
template <int dim, class VectorType, class OperatorType, class GridType,
template <int dim, class VectorType, class MatrixType, class GridType,
class BlockProblemType>
MySolver<dim, VectorType, OperatorType, GridType,
BlockProblemType>::~MySolver() {
MySolver<dim, VectorType, MatrixType, GridType, BlockProblemType>::~MySolver() {
for (auto &x : transferOperators)
delete x;
delete multigridStep;
}
template <int dim, class VectorType, class OperatorType, class GridType,
template <int dim, class VectorType, class MatrixType, class GridType,
class BlockProblemType>
typename MySolver<dim, VectorType, OperatorType, GridType,
typename MySolver<dim, VectorType, MatrixType, GridType,
BlockProblemType>::SolverType *
MySolver<dim, VectorType, OperatorType, GridType,
BlockProblemType>::getSolver() {
MySolver<dim, VectorType, MatrixType, GridType, BlockProblemType>::getSolver() {
return multigridStep;
}
......
......@@ -13,7 +13,7 @@
#include <dune/fufem/assemblers/transferoperatorassembler.hh>
#include <dune/tnnmg/iterationsteps/tnnmgstep.hh>
template <int dim, class VectorType, class OperatorType, class GridType,
template <int dim, class VectorType, class MatrixType, class GridType,
class BlockProblemType>
class MySolver {
private:
......@@ -30,12 +30,12 @@ class MySolver {
SolverType *getSolver();
private:
TruncatedBlockGSStep<OperatorType, VectorType> linearBaseSolverStep;
EnergyNorm<OperatorType, VectorType> baseEnergyNorm;
TruncatedBlockGSStep<MatrixType, VectorType> linearBaseSolverStep;
EnergyNorm<MatrixType, VectorType> baseEnergyNorm;
LoopSolver<VectorType> linearBaseSolver;
TruncatedBlockGSStep<OperatorType, VectorType> linearPresmoother;
TruncatedBlockGSStep<OperatorType, VectorType> linearPostsmoother;
MultigridStep<OperatorType, VectorType> linearIterationStep;
TruncatedBlockGSStep<MatrixType, VectorType> linearPresmoother;
TruncatedBlockGSStep<MatrixType, VectorType> linearPostsmoother;
MultigridStep<MatrixType, VectorType> linearIterationStep;
std::vector<CompressedMultigridTransfer<VectorType> *> transferOperators;
NonlinearSmootherType nonlinearSmoother;
SolverType *multigridStep;
......
......@@ -12,15 +12,15 @@
typedef Dune::FieldVector<double, 2> SmallVector2;
typedef Dune::FieldMatrix<double, 2, 2> SmallMatrix2;
typedef Dune::BlockVector<SmallVector2> VectorType2;
typedef Dune::BCRSMatrix<SmallMatrix2> OperatorType2;
typedef Dune::BCRSMatrix<SmallMatrix2> MatrixType2;
typedef MyConvexProblem<OperatorType2, VectorType2> MyConvexProblemType2;
typedef MyConvexProblem<MatrixType2, VectorType2> MyConvexProblemType2;
typedef MyBlockProblem<MyConvexProblemType2> MyBlockProblemType2;
typedef Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming> GridType2;
// typedef Dune::YaspGrid<2> GridType2;
template class MySolver<2, VectorType2, OperatorType2, GridType2,
template class MySolver<2, VectorType2, MatrixType2, GridType2,
MyBlockProblemType2>;
// }}}
......@@ -28,14 +28,14 @@ template class MySolver<2, VectorType2, OperatorType2, GridType2,
typedef Dune::FieldVector<double, 3> SmallVector3;
typedef Dune::FieldMatrix<double, 3, 3> SmallMatrix3;
typedef Dune::BlockVector<SmallVector3> VectorType3;
typedef Dune::BCRSMatrix<SmallMatrix3> OperatorType3;
typedef Dune::BCRSMatrix<SmallMatrix3> MatrixType3;
typedef MyConvexProblem<OperatorType3, VectorType3> MyConvexProblemType3;
typedef MyConvexProblem<MatrixType3, VectorType3> MyConvexProblemType3;
typedef MyBlockProblem<MyConvexProblemType3> MyBlockProblemType3;
typedef Dune::ALUGrid<3, 3, Dune::simplex, Dune::nonconforming> GridType3;
// typedef Dune::YaspGrid<3> GridType3;
template class MySolver<3, VectorType3, OperatorType3, GridType3,
template class MySolver<3, VectorType3, MatrixType3, GridType3,
MyBlockProblemType3>;
// }}}
......@@ -131,7 +131,7 @@ int main(int argc, char *argv[]) {
typedef Dune::FieldVector<double, dim> SmallVector;
typedef Dune::FieldMatrix<double, dim, dim> SmallMatrix;
typedef Dune::BCRSMatrix<SmallMatrix> OperatorType;
typedef Dune::BCRSMatrix<SmallMatrix> MatrixType;
typedef Dune::BlockVector<SmallVector> VectorType;
typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType;
......@@ -174,7 +174,7 @@ int main(int argc, char *argv[]) {
StVenantKirchhoffAssembler<GridType, P1Basis::LocalFiniteElement,
P1Basis::LocalFiniteElement> const
localStiffness(E, nu);
OperatorType stiffnessMatrix;
MatrixType stiffnessMatrix;
{
timer.reset();
OperatorAssembler<P1Basis, P1Basis>(p1Basis, p1Basis)
......@@ -182,7 +182,7 @@ int main(int argc, char *argv[]) {
std::cout << "Assembled stiffness matrix in " << timer.elapsed() << "s"
<< std::endl;
}
EnergyNorm<OperatorType, VectorType> energyNorm(stiffnessMatrix);
EnergyNorm<MatrixType, VectorType> energyNorm(stiffnessMatrix);
// Set up the boundary
Dune::BitSetVector<dim> ignoreNodes(finestSize, false);
......@@ -211,11 +211,11 @@ int main(int argc, char *argv[]) {
VectorType b4;
// }}}
typedef MyConvexProblem<OperatorType, VectorType> MyConvexProblemType;
typedef MyConvexProblem<MatrixType, VectorType> MyConvexProblemType;
typedef MyBlockProblem<MyConvexProblemType> MyBlockProblemType;
// Set up TNNMG solver
MySolver<dim, VectorType, OperatorType, GridType, MyBlockProblemType>
MySolver<dim, VectorType, MatrixType, GridType, MyBlockProblemType>
mySolver(parset.sub("solver.tnnmg"), refinements, solver_tolerance, *grid,
ignoreNodes);
......@@ -275,7 +275,7 @@ int main(int argc, char *argv[]) {
for (size_t state_fpi = 0; state_fpi < fixed_point_iterations;
++state_fpi) {
auto myGlobalNonlinearity =
assemble_nonlinearity<VectorType, OperatorType>(
assemble_nonlinearity<VectorType, MatrixType>(
parset.sub("boundary.friction"), nodalIntegrals, s4_new, h);
MyConvexProblemType const myConvexProblem(stiffnessMatrix,
*myGlobalNonlinearity, b4);
......
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