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

This test checks that the CG solver converges to u_random for the RHS set as b_c = A_CG * u_random with some vector u_random. 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 converges to u_random for the RHS set as b_c = A_CG * u_random with some vector u_random.

It shows that the solution u of the problem A * u = A * u_random approximates u_random. 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.
  5. Check |u - u_random| < tol.

Variable Documentation

◆ action

test3.action

Definition at line 37 of file test3.py.

◆ args

test3.args = parser.parse_args()

Definition at line 43 of file test3.py.

◆ build_mode

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

Definition at line 88 of file test3.py.

◆ choices

test3.choices

Definition at line 42 of file test3.py.

◆ cube_size

float test3.cube_size = 1.0

Definition at line 96 of file test3.py.

◆ default

test3.default

Definition at line 36 of file test3.py.

◆ dest

test3.dest

Definition at line 36 of file test3.py.

◆ dimensions

test3.dimensions

Definition at line 98 of file test3.py.

◆ domain_size

test3.domain_size

Definition at line 100 of file test3.py.

◆ False

test3.False

Definition at line 37 of file test3.py.

◆ help

test3.help

Definition at line 36 of file test3.py.

◆ int

test3.int

Definition at line 36 of file test3.py.

◆ mass_matrix

test3.mass_matrix

Definition at line 62 of file test3.py.

◆ mass_matrix_scaling

test3.mass_matrix_scaling

Definition at line 62 of file test3.py.

◆ max_iterations

test3.max_iterations

Definition at line 102 of file test3.py.

◆ offset

test3.offset

Definition at line 99 of file test3.py.

◆ parser

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

Definition at line 35 of file test3.py.

◆ peano4_project

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

Definition at line 108 of file test3.py.

◆ plot_after_each_mesh_sweep

test3.plot_after_each_mesh_sweep

Definition at line 101 of file test3.py.

◆ poisson_equation_matrices

test3.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 55 of file test3.py.

◆ project

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

Definition at line 45 of file test3.py.

◆ required

test3.required

Definition at line 42 of file test3.py.

◆ solver

test3.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-9,
11 custom_init_actionset=InitDofsCollocatedRandomRhs,
12 custom_plot_actionset=[("rand","getRand")]
13 )

Definition at line 65 of file test3.py.

◆ system_matrix

test3.system_matrix

Definition at line 61 of file test3.py.

◆ system_matrix_scaling

test3.system_matrix_scaling

Definition at line 61 of file test3.py.

◆ True

test3.True

Definition at line 42 of file test3.py.

◆ type

test3.type

Definition at line 36 of file test3.py.