Peano
Loading...
Searching...
No Matches
test2 Namespace Reference

This test checks that the CG solver leaves the input invariant if the RHS is constructed as b_c = A_CG * u_random with some vector u_random, when the same u_random is used as the initial guess for the algorithm. More...

Variables

 parser = argparse.ArgumentParser(description='Multigrid - Poisson solver')
 
 dest
 
 type
 
 int
 
 default
 
 help
 
 action
 
 False
 
 choices
 
 required
 
 True
 
 args = parser.parse_args()
 
 project
 
 poisson_equation_matrices
 
 system_matrix
 
 system_matrix_scaling
 
 mass_matrix
 
 mass_matrix_scaling
 
 solver
 
 build_mode = peano4.api.output.CompileMode.RELEASE
 
float cube_size = 1.0
 
 dimensions
 
 offset
 
 domain_size
 
 plot_after_each_mesh_sweep
 
 max_iterations
 
 peano4_project = project.generate_Peano4_project(args.verbose)
 

Detailed Description

This test checks that the CG solver leaves the input invariant if the RHS is constructed as b_c = A_CG * u_random with some vector u_random, when the same u_random is used as the initial guess for the algorithm.

It shows that the solution of the problem A * u = A * u_random converges to u_random in one iteration. u_random has to satisfy the boundary conditions but can be random at the interior vertices.

Algorithm:

  1. Generate u_random by assigning a value from [0,1] to each vertex.
  2. Set u_random to 0 at the boundary vertices to satisfy the boundary conditions.
  3. Compute b_c = A_CG * u_random, where A_CG is the system matrix for CG.
  4. Solve A_CG * u = b_c with CollocatedSolver with u_random as the initial guess.
  5. Check |u - u_random| < tol after the first iteration of the solver.

Variable Documentation

◆ action

test2.action

Definition at line 40 of file test2.py.

◆ args

test2.args = parser.parse_args()

Definition at line 46 of file test2.py.

◆ build_mode

test2.build_mode = peano4.api.output.CompileMode.RELEASE

Definition at line 86 of file test2.py.

◆ choices

test2.choices

Definition at line 45 of file test2.py.

◆ cube_size

float test2.cube_size = 1.0

Definition at line 94 of file test2.py.

◆ default

test2.default

Definition at line 39 of file test2.py.

◆ dest

test2.dest

Definition at line 39 of file test2.py.

◆ dimensions

test2.dimensions

Definition at line 96 of file test2.py.

◆ domain_size

test2.domain_size

Definition at line 98 of file test2.py.

◆ False

test2.False

Definition at line 40 of file test2.py.

◆ help

test2.help

Definition at line 39 of file test2.py.

◆ int

test2.int

Definition at line 39 of file test2.py.

◆ mass_matrix

test2.mass_matrix

Definition at line 60 of file test2.py.

◆ mass_matrix_scaling

test2.mass_matrix_scaling

Definition at line 60 of file test2.py.

◆ max_iterations

test2.max_iterations

Definition at line 100 of file test2.py.

◆ offset

test2.offset

Definition at line 97 of file test2.py.

◆ parser

test2.parser = argparse.ArgumentParser(description='Multigrid - Poisson solver')

Definition at line 38 of file test2.py.

◆ peano4_project

test2.peano4_project = project.generate_Peano4_project(args.verbose)

Definition at line 106 of file test2.py.

◆ plot_after_each_mesh_sweep

test2.plot_after_each_mesh_sweep

Definition at line 99 of file test2.py.

◆ poisson_equation_matrices

test2.poisson_equation_matrices
Initial value:
2 dimensions = args.dimensions,
3 poly_degree = 1,
4 unknowns_per_node = 1
5)
Using normalised identity matrix instead of the mass matrix.

Definition at line 53 of file test2.py.

◆ project

test2.project
Initial value:
1= mghype.matrixfree.api.Project( project_name = "CollocatedFEM",
2 namespace = [ "tests", "multigrid", "matrixfree", "verifyRandom" ]
3 )

Definition at line 48 of file test2.py.

◆ required

test2.required

Definition at line 45 of file test2.py.

◆ solver

test2.solver
Initial value:
1= mghype.matrixfree.solvers.api.CollocatedDLinearDiscretisationWithPointJacobi("CollocatedPoisson",
2 1, # unknowns
3 args.dimensions,
4 args.meshsize,
5 args.meshsize,
6 local_assembly_matrix = system_matrix,
7 local_assembly_matrix_scaling=system_matrix_scaling,
8 mass_matrix = mass_matrix,
9 mass_matrix_scaling = mass_matrix_scaling,
10 solver_tolerance=1e-6,
11 custom_init_actionset=InitDofsCollocatedRandomTest2,
12 custom_plot_actionset=[("rand","getRand")]
13 )

Definition at line 63 of file test2.py.

◆ system_matrix

test2.system_matrix

Definition at line 59 of file test2.py.

◆ system_matrix_scaling

test2.system_matrix_scaling

Definition at line 59 of file test2.py.

◆ True

test2.True

Definition at line 45 of file test2.py.

◆ type

test2.type

Definition at line 39 of file test2.py.