Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure that Structure::MultigridPreconditioner is updated #654

Merged
merged 3 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions applications/structure/bar/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ class Application : public ApplicationBase<dim, Number>
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.");
Expand All @@ -271,7 +277,7 @@ class Application : public ApplicationBase<dim, Number>
{
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;

Expand All @@ -284,11 +290,11 @@ class Application : public ApplicationBase<dim, Number>

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;
Expand All @@ -305,13 +311,17 @@ class Application : public ApplicationBase<dim, Number>
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;
Expand Down Expand Up @@ -481,9 +491,13 @@ class Application : public ApplicationBase<dim, Number>

bool const unsteady = (this->param.problem_type == ProblemType::Unsteady);
this->boundary_descriptor->dirichlet_bc.insert(
pair(2, new DisplacementDBC<dim>(displacement, quasistatic_solver, unsteady, end_time)));
pair(2,
new DisplacementDBC<dim>(
displacement, quasistatic_solver, unsteady, 200.0 /* end_time */)));
this->boundary_descriptor->dirichlet_bc_initial_acceleration.insert(
pair(2, new AccelerationDBC<dim>(displacement, quasistatic_solver, unsteady, end_time)));
pair(2,
new AccelerationDBC<dim>(
displacement, quasistatic_solver, unsteady, 200.0 /* end_time */)));

this->boundary_descriptor->dirichlet_bc_component_mask.insert(pair_mask(2, mask_right));
}
Expand Down Expand Up @@ -614,7 +628,8 @@ class Application : public ApplicationBase<dim, Number>

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;
Expand All @@ -631,6 +646,8 @@ class Application : public ApplicationBase<dim, Number>

double weak_damping_coefficient = 0.0;

Preconditioner preconditioner = Preconditioner::Multigrid;

double displacement = 1.0; // "Dirichlet"
double area_force = 1.0; // "Neumann"

Expand All @@ -640,7 +657,7 @@ class Application : public ApplicationBase<dim, Number>
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;
};
Expand Down
2 changes: 2 additions & 0 deletions applications/structure/bar/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"Height": "10.0",
"Width": "10.0",
"ProblemType": "QuasiStatic",
"LargeDeformation": "true",
"Preconditioner": "Multigrid",
"WeakDamping": "0.0",
"UseVolumeForce": "false",
"VolumeForce": "1.0",
Expand Down
36 changes: 36 additions & 0 deletions applications/structure/bar/tests/quasistatic_large_strain_amg.json
Original file line number Diff line number Diff line change
@@ -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": "AMG",
"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"
}
}
101 changes: 101 additions & 0 deletions applications/structure/bar/tests/quasistatic_large_strain_amg.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@



________________________________________________________________________________

//////// /////// ////////
/// /// /// ///
////// /// /// /////// /// /// /// ////
/// //// // // /// /// /// ///
//////// /// /// ///////// /////// ////////

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
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: AMG

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
Original file line number Diff line number Diff line change
@@ -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"
}
}
Loading
Loading