diff --git a/applications/structure/bar/application.h b/applications/structure/bar/application.h index 7b78587b0..603072a6f 100644 --- a/applications/structure/bar/application.h +++ b/applications/structure/bar/application.h @@ -252,6 +252,12 @@ class Application : public ApplicationBase prm.add_parameter("ProblemType", problem_type, "Problem type considered, QuasiStatic vs Unsteady vs. Steady"); + prm.add_parameter("LargeDeformation", + large_deformation, + "Consider finite strains or linear elasticity."); + prm.add_parameter("Preconditioner", + preconditioner, + "None, PointJacobi, AMG, AdditiveSchwarz or Multigrid"); prm.add_parameter("WeakDamping", weak_damping_coefficient, "Weak damping coefficient for unsteady problems."); @@ -271,7 +277,7 @@ class Application : public ApplicationBase { this->param.problem_type = problem_type; this->param.body_force = use_volume_force; - this->param.large_deformation = true; + this->param.large_deformation = large_deformation; this->param.pull_back_body_force = false; this->param.pull_back_traction = false; @@ -284,11 +290,11 @@ class Application : public ApplicationBase this->param.start_time = start_time; this->param.end_time = end_time; - this->param.time_step_size = end_time / 200.; + this->param.time_step_size = end_time / 2.; this->param.gen_alpha_type = GenAlphaType::BossakAlpha; this->param.spectral_radius = 0.8; this->param.solver_info_data.interval_time_steps = - problem_type == ProblemType::Unsteady ? 200 : 2; + problem_type == ProblemType::Unsteady ? 20 : 2; this->param.mapping_degree = 1; this->param.mapping_degree_coarse_grids = this->param.mapping_degree; @@ -305,13 +311,17 @@ class Application : public ApplicationBase this->param.grid.create_coarse_triangulations = false; // can also be set to true if desired } - this->param.load_increment = 0.1; + this->param.load_increment = 0.5; + + this->param.newton_solver_data = Newton::SolverData(1e2, 1.e-9, 1.e-9); + this->param.solver = Solver::FGMRES; + this->param.solver_data = SolverData(1e3, 1.e-12, 1.e-8, 100); + this->param.preconditioner = preconditioner; + this->param.multigrid_data.type = MultigridType::phMG; + + this->param.multigrid_data.smoother_data.smoother = MultigridSmoother::Chebyshev; + this->param.multigrid_data.smoother_data.preconditioner = PreconditionerSmoother::PointJacobi; - this->param.newton_solver_data = Newton::SolverData(1e2, 1.e-9, 1.e-9); - this->param.solver = Solver::FGMRES; - this->param.solver_data = SolverData(1e3, 1.e-12, 1.e-8, 100); - this->param.preconditioner = Preconditioner::Multigrid; - this->param.multigrid_data.type = MultigridType::phMG; this->param.multigrid_data.coarse_problem.solver = MultigridCoarseGridSolver::CG; this->param.multigrid_data.coarse_problem.preconditioner = MultigridCoarseGridPreconditioner::AMG; @@ -481,9 +491,13 @@ class Application : public ApplicationBase bool const unsteady = (this->param.problem_type == ProblemType::Unsteady); this->boundary_descriptor->dirichlet_bc.insert( - pair(2, new DisplacementDBC(displacement, quasistatic_solver, unsteady, end_time))); + pair(2, + new DisplacementDBC( + displacement, quasistatic_solver, unsteady, 200.0 /* end_time */))); this->boundary_descriptor->dirichlet_bc_initial_acceleration.insert( - pair(2, new AccelerationDBC(displacement, quasistatic_solver, unsteady, end_time))); + pair(2, + new AccelerationDBC( + displacement, quasistatic_solver, unsteady, 200.0 /* end_time */))); this->boundary_descriptor->dirichlet_bc_component_mask.insert(pair_mask(2, mask_right)); } @@ -614,7 +628,8 @@ class Application : public ApplicationBase double length = 1.0, height = 1.0, width = 1.0; - bool use_volume_force = true; + bool use_volume_force = true; + bool large_deformation = true; bool const clamp_at_right_boundary = false; bool const clamp_at_left_boundary = false; @@ -631,6 +646,8 @@ class Application : public ApplicationBase double weak_damping_coefficient = 0.0; + Preconditioner preconditioner = Preconditioner::Multigrid; + double displacement = 1.0; // "Dirichlet" double area_force = 1.0; // "Neumann" @@ -640,7 +657,7 @@ class Application : public ApplicationBase double const E_modul = 200.0; double const start_time = 0.0; - double const end_time = 100.0; + double const end_time = 1.0; double const density = 0.001; }; diff --git a/applications/structure/bar/input.json b/applications/structure/bar/input.json index b91885bfd..94f1cc4b4 100644 --- a/applications/structure/bar/input.json +++ b/applications/structure/bar/input.json @@ -19,6 +19,8 @@ "Height": "10.0", "Width": "10.0", "ProblemType": "QuasiStatic", + "LargeDeformation": "true", + "Preconditioner": "Multigrid", "WeakDamping": "0.0", "UseVolumeForce": "false", "VolumeForce": "1.0", diff --git a/applications/structure/bar/tests/quasistatic_large_strain_multigrid.json b/applications/structure/bar/tests/quasistatic_large_strain_multigrid.json new file mode 100644 index 000000000..53b987a56 --- /dev/null +++ b/applications/structure/bar/tests/quasistatic_large_strain_multigrid.json @@ -0,0 +1,36 @@ +{ + "General": { + "Precision": "double", + "Dim": "3", + "IsTest": "true" + }, + "SpatialResolution": { + "DegreeMin": "4", + "DegreeMax": "4", + "RefineSpaceMin": "1", + "RefineSpaceMax": "1" + }, + "TemporalResolution": { + "RefineTimeMin": "0", + "RefineTimeMax": "0" + }, + "Application": { + "Length": "100.0", + "Height": "10.0", + "Width": "10.0", + "ProblemType": "QuasiStatic", + "LargeDeformation": "true", + "Preconditioner": "Multigrid", + "WeakDamping": "0.0", + "UseVolumeForce": "false", + "VolumeForce": "1.0", + "BoundaryType": "Dirichlet", + "Displacement": "2.0e-1", + "Traction": "0.0" + }, + "Output": { + "OutputDirectory": "output/bar/", + "OutputName": "test", + "WriteOutput": "false" + } +} diff --git a/applications/structure/bar/tests/quasistatic_large_strain_multigrid.output b/applications/structure/bar/tests/quasistatic_large_strain_multigrid.output new file mode 100644 index 000000000..2bea84e8b --- /dev/null +++ b/applications/structure/bar/tests/quasistatic_large_strain_multigrid.output @@ -0,0 +1,119 @@ + + + +________________________________________________________________________________ + + //////// /////// //////// + /// /// /// /// + ////// /// /// /////// /// /// /// //// + /// //// // // /// /// /// /// + //////// /// /// ///////// /////// //////// + + High-Order Discontinuous Galerkin for the Exa-Scale +________________________________________________________________________________ + + +MPI info: + + Number of processes: 1 + +Setting up elasticity solver: + +List of parameters: + +Mathematical model: + Problem type: QuasiStatic + Body force: false + Large deformation: true + Pull back body force: false + Pull back traction: false + +Physical quantities: + +Temporal discretization: + load_increment: 5.0000e-01 + +Spatial Discretization: + Triangulation type: Distributed + Element type: Hypercube + Number of global refinements: 1 + Create coarse triangulations: false + Mapping degree: 1 + Mapping degree coarse grids: 1 + Polynomial degree: 4 + +Solver: + +Newton: + Maximum number of iterations: 100 + Absolute solver tolerance: 1.0000e-09 + Relative solver tolerance: 1.0000e-09 + +Linear solver: + Solver: FGMRES + Maximum number of iterations: 1000 + Absolute solver tolerance: 1.0000e-12 + Relative solver tolerance: 1.0000e-08 + Maximum size of Krylov space: 100 + Preconditioner: Multigrid + Multigrid type: phMG + p-sequence: Bisect + Smoother: Chebyshev + Preconditioner smoother: PointJacobi + Iterations smoother: 5 + Smoothing range: 2.0000e+01 + Iterations eigenvalue estimation: 20 + Coarse grid solver: CG + Coarse grid preconditioner: AMG + Maximum number of iterations: 10000 + Absolute solver tolerance: 1.0000e-12 + Relative solver tolerance: 1.0000e-03 + Maximum size of Krylov space: 30 + AMG type: ML + Smoother sweeps: 1 + Number of cycles: 1 + Smoother type: ILU + +Generating grid for 3-dimensional problem: + + Max. number of refinements: 1 + Number of cells: 32 + +Construct elasticity operator ... + +Continuous Galerkin finite element discretization: + + degree of 1D polynomials: 4 + number of dofs per cell: 375 + number of dofs (total): 8019 + +... done! + +Setup elasticity operator ... + +... done! + +Calculate error for all fields for initial data: + Relative error (L2-norm): 1.00000e+00 + +Solving quasi-static problem ... + +________________________________________________________________________________ + + Solve non-linear problem for load factor = 5.0000e-03 +________________________________________________________________________________ + +________________________________________________________________________________ + + Solve non-linear problem for load factor = 5.0000e-01 +________________________________________________________________________________ + +________________________________________________________________________________ + + Solve non-linear problem for load factor = 1.0000e+00 +________________________________________________________________________________ + +... done! + +Calculate error for all fields for solution data: + Relative error (L2-norm): 4.24816e-02 diff --git a/applications/structure/bar/tests/steady_large_strain_multigrid.json b/applications/structure/bar/tests/steady_large_strain_multigrid.json new file mode 100644 index 000000000..3157d8752 --- /dev/null +++ b/applications/structure/bar/tests/steady_large_strain_multigrid.json @@ -0,0 +1,36 @@ +{ + "General": { + "Precision": "double", + "Dim": "3", + "IsTest": "true" + }, + "SpatialResolution": { + "DegreeMin": "4", + "DegreeMax": "4", + "RefineSpaceMin": "1", + "RefineSpaceMax": "1" + }, + "TemporalResolution": { + "RefineTimeMin": "0", + "RefineTimeMax": "0" + }, + "Application": { + "Length": "100.0", + "Height": "10.0", + "Width": "10.0", + "ProblemType": "Steady", + "LargeDeformation": "true", + "Preconditioner": "Multigrid", + "WeakDamping": "0.0", + "UseVolumeForce": "false", + "VolumeForce": "1.0", + "BoundaryType": "Dirichlet", + "Displacement": "20.0e-3", + "Traction": "0.0" + }, + "Output": { + "OutputDirectory": "output/bar/", + "OutputName": "test", + "WriteOutput": "false" + } +} diff --git a/applications/structure/bar/tests/steady_large_strain_multigrid.output b/applications/structure/bar/tests/steady_large_strain_multigrid.output new file mode 100644 index 000000000..669b12daf --- /dev/null +++ b/applications/structure/bar/tests/steady_large_strain_multigrid.output @@ -0,0 +1,103 @@ + + + +________________________________________________________________________________ + + //////// /////// //////// + /// /// /// /// + ////// /// /// /////// /// /// /// //// + /// //// // // /// /// /// /// + //////// /// /// ///////// /////// //////// + + High-Order Discontinuous Galerkin for the Exa-Scale +________________________________________________________________________________ + + +MPI info: + + Number of processes: 1 + +Setting up elasticity solver: + +List of parameters: + +Mathematical model: + Problem type: Steady + Body force: false + Large deformation: true + Pull back body force: false + Pull back traction: false + +Physical quantities: + +Temporal discretization: + +Spatial Discretization: + Triangulation type: Distributed + Element type: Hypercube + Number of global refinements: 1 + Create coarse triangulations: false + Mapping degree: 1 + Mapping degree coarse grids: 1 + Polynomial degree: 4 + +Solver: + +Newton: + Maximum number of iterations: 100 + Absolute solver tolerance: 1.0000e-09 + Relative solver tolerance: 1.0000e-09 + +Linear solver: + Solver: FGMRES + Maximum number of iterations: 1000 + Absolute solver tolerance: 1.0000e-12 + Relative solver tolerance: 1.0000e-08 + Maximum size of Krylov space: 100 + Preconditioner: Multigrid + Multigrid type: phMG + p-sequence: Bisect + Smoother: Chebyshev + Preconditioner smoother: PointJacobi + Iterations smoother: 5 + Smoothing range: 2.0000e+01 + Iterations eigenvalue estimation: 20 + Coarse grid solver: CG + Coarse grid preconditioner: AMG + Maximum number of iterations: 10000 + Absolute solver tolerance: 1.0000e-12 + Relative solver tolerance: 1.0000e-03 + Maximum size of Krylov space: 30 + AMG type: ML + Smoother sweeps: 1 + Number of cycles: 1 + Smoother type: ILU + +Generating grid for 3-dimensional problem: + + Max. number of refinements: 1 + Number of cells: 32 + +Construct elasticity operator ... + +Continuous Galerkin finite element discretization: + + degree of 1D polynomials: 4 + number of dofs per cell: 375 + number of dofs (total): 8019 + +... done! + +Setup elasticity operator ... + +... done! + +Calculate error for all fields for initial data: + Relative error (L2-norm): 1.00000e+00 + +Solving steady state problem ... + +... done! + +Calculate error for all fields for solution data: + Relative error (L2-norm): 4.24319e-02 diff --git a/applications/structure/bar/tests/steady_small_strain_multigrid.json b/applications/structure/bar/tests/steady_small_strain_multigrid.json new file mode 100644 index 000000000..1cf1f3d03 --- /dev/null +++ b/applications/structure/bar/tests/steady_small_strain_multigrid.json @@ -0,0 +1,36 @@ +{ + "General": { + "Precision": "double", + "Dim": "3", + "IsTest": "true" + }, + "SpatialResolution": { + "DegreeMin": "4", + "DegreeMax": "4", + "RefineSpaceMin": "1", + "RefineSpaceMax": "1" + }, + "TemporalResolution": { + "RefineTimeMin": "0", + "RefineTimeMax": "0" + }, + "Application": { + "Length": "100.0", + "Height": "10.0", + "Width": "10.0", + "ProblemType": "Steady", + "LargeDeformation": "false", + "Preconditioner": "Multigrid", + "WeakDamping": "0.0", + "UseVolumeForce": "false", + "VolumeForce": "1.0", + "BoundaryType": "Dirichlet", + "Displacement": "20.0e-3", + "Traction": "0.0" + }, + "Output": { + "OutputDirectory": "output/bar/", + "OutputName": "test", + "WriteOutput": "false" + } +} diff --git a/applications/structure/bar/tests/steady_small_strain_multigrid.output b/applications/structure/bar/tests/steady_small_strain_multigrid.output new file mode 100644 index 000000000..38a8fc5ed --- /dev/null +++ b/applications/structure/bar/tests/steady_small_strain_multigrid.output @@ -0,0 +1,96 @@ + + + +________________________________________________________________________________ + + //////// /////// //////// + /// /// /// /// + ////// /// /// /////// /// /// /// //// + /// //// // // /// /// /// /// + //////// /// /// ///////// /////// //////// + + High-Order Discontinuous Galerkin for the Exa-Scale +________________________________________________________________________________ + + +MPI info: + + Number of processes: 1 + +Setting up elasticity solver: + +List of parameters: + +Mathematical model: + Problem type: Steady + Body force: false + Large deformation: false + +Physical quantities: + +Temporal discretization: + +Spatial Discretization: + Triangulation type: Distributed + Element type: Hypercube + Number of global refinements: 1 + Create coarse triangulations: false + Mapping degree: 1 + Mapping degree coarse grids: 1 + Polynomial degree: 4 + +Solver: + +Linear solver: + Solver: FGMRES + Maximum number of iterations: 1000 + Absolute solver tolerance: 1.0000e-12 + Relative solver tolerance: 1.0000e-08 + Maximum size of Krylov space: 100 + Preconditioner: Multigrid + Multigrid type: phMG + p-sequence: Bisect + Smoother: Chebyshev + Preconditioner smoother: PointJacobi + Iterations smoother: 5 + Smoothing range: 2.0000e+01 + Iterations eigenvalue estimation: 20 + Coarse grid solver: CG + Coarse grid preconditioner: AMG + Maximum number of iterations: 10000 + Absolute solver tolerance: 1.0000e-12 + Relative solver tolerance: 1.0000e-03 + Maximum size of Krylov space: 30 + AMG type: ML + Smoother sweeps: 1 + Number of cycles: 1 + Smoother type: ILU + +Generating grid for 3-dimensional problem: + + Max. number of refinements: 1 + Number of cells: 32 + +Construct elasticity operator ... + +Continuous Galerkin finite element discretization: + + degree of 1D polynomials: 4 + number of dofs per cell: 375 + number of dofs (total): 8019 + +... done! + +Setup elasticity operator ... + +... done! + +Calculate error for all fields for initial data: + Relative error (L2-norm): 1.00000e+00 + +Solving steady state problem ... + +... done! + +Calculate error for all fields for solution data: + Relative error (L2-norm): 4.24264e-02 diff --git a/applications/structure/bar/tests/unsteady_small_strain_multigrid.json b/applications/structure/bar/tests/unsteady_small_strain_multigrid.json new file mode 100644 index 000000000..435efbc24 --- /dev/null +++ b/applications/structure/bar/tests/unsteady_small_strain_multigrid.json @@ -0,0 +1,36 @@ +{ + "General": { + "Precision": "double", + "Dim": "3", + "IsTest": "true" + }, + "SpatialResolution": { + "DegreeMin": "4", + "DegreeMax": "4", + "RefineSpaceMin": "1", + "RefineSpaceMax": "1" + }, + "TemporalResolution": { + "RefineTimeMin": "0", + "RefineTimeMax": "0" + }, + "Application": { + "Length": "100.0", + "Height": "10.0", + "Width": "10.0", + "ProblemType": "Unsteady", + "LargeDeformation": "false", + "Preconditioner": "Multigrid", + "WeakDamping": "0.0", + "UseVolumeForce": "false", + "VolumeForce": "1.0", + "BoundaryType": "Dirichlet", + "Displacement": "0.2", + "Traction": "0.0" + }, + "Output": { + "OutputDirectory": "output/bar/", + "OutputName": "test", + "WriteOutput": "false" + } +} diff --git a/applications/structure/bar/tests/unsteady_small_strain_multigrid.output b/applications/structure/bar/tests/unsteady_small_strain_multigrid.output new file mode 100644 index 000000000..f270d2c59 --- /dev/null +++ b/applications/structure/bar/tests/unsteady_small_strain_multigrid.output @@ -0,0 +1,114 @@ + + + +________________________________________________________________________________ + + //////// /////// //////// + /// /// /// /// + ////// /// /// /////// /// /// /// //// + /// //// // // /// /// /// /// + //////// /// /// ///////// /////// //////// + + High-Order Discontinuous Galerkin for the Exa-Scale +________________________________________________________________________________ + + +MPI info: + + Number of processes: 1 + +Setting up elasticity solver: + +List of parameters: + +Mathematical model: + Problem type: Unsteady + Body force: false + Large deformation: false + +Physical quantities: + Density: 1.0000e-03 + +Temporal discretization: + Start time: 0.0000e+00 + End time: 1.0000e+00 + Max. number of time steps: 4294967295 + Temporal refinements: 0 + Time integration type: BossakAlpha + Spectral radius: 8.0000e-01 + Solver information: + Interval physical time: 1.7977e+308 + Interval wall time: 1.7977e+308 + Interval time steps: 20 + +Spatial Discretization: + Triangulation type: Distributed + Element type: Hypercube + Number of global refinements: 1 + Create coarse triangulations: false + Mapping degree: 1 + Mapping degree coarse grids: 1 + Polynomial degree: 4 + +Solver: + +Linear solver: + Solver: FGMRES + Maximum number of iterations: 1000 + Absolute solver tolerance: 1.0000e-12 + Relative solver tolerance: 1.0000e-08 + Maximum size of Krylov space: 100 + Preconditioner: Multigrid + Multigrid type: phMG + p-sequence: Bisect + Smoother: Chebyshev + Preconditioner smoother: PointJacobi + Iterations smoother: 5 + Smoothing range: 2.0000e+01 + Iterations eigenvalue estimation: 20 + Coarse grid solver: CG + Coarse grid preconditioner: AMG + Maximum number of iterations: 10000 + Absolute solver tolerance: 1.0000e-12 + Relative solver tolerance: 1.0000e-03 + Maximum size of Krylov space: 30 + AMG type: ML + Smoother sweeps: 1 + Number of cycles: 1 + Smoother type: ILU + +Generating grid for 3-dimensional problem: + + Max. number of refinements: 1 + Number of cells: 32 + +Construct elasticity operator ... + +Continuous Galerkin finite element discretization: + + degree of 1D polynomials: 4 + number of dofs per cell: 375 + number of dofs (total): 8019 + +... done! + +Setup elasticity operator ... + +... done! + +Setup elasticity time integrator ... + +... done! + +Starting time loop ... + +Calculate error for all fields at time t = 0.0000e+00: + Relative error (L2-norm): 1.00000e+00 + +________________________________________________________________________________ + + Time step number = 1 t = 0.00000e+00 -> t + dt = 5.00000e-01 +________________________________________________________________________________ + +Calculate error for all fields at time t = 1.0000e+00: + Relative error (L2-norm): 9.99019e-01 diff --git a/applications/structure/bar/tests/weak_damping.json b/applications/structure/bar/tests/weak_damping.json index f5c244987..821e214a4 100644 --- a/applications/structure/bar/tests/weak_damping.json +++ b/applications/structure/bar/tests/weak_damping.json @@ -19,6 +19,8 @@ "Height": "10.0", "Width": "10.0", "ProblemType": "Unsteady", + "LargeDeformation": "true", + "Preconditioner": "Multigrid", "WeakDamping": "10000.0", "UseVolumeForce": "false", "VolumeForce": "1.0", diff --git a/applications/structure/bar/tests/weak_damping.output b/applications/structure/bar/tests/weak_damping.output index d55e167b5..7f9a69e64 100644 --- a/applications/structure/bar/tests/weak_damping.output +++ b/applications/structure/bar/tests/weak_damping.output @@ -34,7 +34,7 @@ Physical quantities: Temporal discretization: Start time: 0.0000e+00 - End time: 1.0000e+02 + End time: 1.0000e+00 Max. number of time steps: 4294967295 Temporal refinements: 0 Time integration type: BossakAlpha @@ -42,7 +42,7 @@ Temporal discretization: Solver information: Interval physical time: 1.7977e+308 Interval wall time: 1.7977e+308 - Interval time steps: 200 + Interval time steps: 20 Spatial Discretization: Triangulation type: Distributed @@ -118,10 +118,5 @@ ________________________________________________________________________________ Time step number = 1 t = 0.00000e+00 -> t + dt = 5.00000e-01 ________________________________________________________________________________ -________________________________________________________________________________ - - Time step number = 200 t = 9.95000e+01 -> t + dt = 1.00000e+02 -________________________________________________________________________________ - -Calculate error for all fields at time t = 1.0000e+02: - Relative error (L2-norm): 6.27902e-01 +Calculate error for all fields at time t = 1.0000e+00: + Relative error (L2-norm): 1.02068e+00 diff --git a/include/exadg/structure/preconditioners/multigrid_preconditioner.cpp b/include/exadg/structure/preconditioners/multigrid_preconditioner.cpp index 7a5458b12..746d6c715 100644 --- a/include/exadg/structure/preconditioners/multigrid_preconditioner.cpp +++ b/include/exadg/structure/preconditioners/multigrid_preconditioner.cpp @@ -120,13 +120,10 @@ MultigridPreconditioner::update() }); } - // In case that the operators have been updated, we also need to update the smoothers and the - // coarse grid solver. This is generic functionality implemented in the base class. - if(nonlinear or data.unsteady) - { - this->update_smoothers(); - this->update_coarse_solver(); - } + // Update the smoothers and the coarse grid solver. This is generic functionality implemented in + // the base class. + this->update_smoothers(); + this->update_coarse_solver(); this->update_needed = false; }