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