WarpX
Public Member Functions | Public Attributes | List of all members
Checksum.checksum.Checksum Class Reference

Public Member Functions

def __init__ (self, test_name, output_file, output_format='plotfile', do_fields=True, do_particles=True)
 
def read_output_file (self, do_fields=True, do_particles=True)
 
def evaluate (self, rtol=1.e-9, atol=1.e-40)
 

Public Attributes

 test_name
 
 output_file
 
 output_format
 
 data
 

Detailed Description

Class for checksum comparison of one test.

Constructor & Destructor Documentation

◆ __init__()

def Checksum.checksum.Checksum.__init__ (   self,
  test_name,
  output_file,
  output_format = 'plotfile',
  do_fields = True,
  do_particles = True 
)
Checksum constructor.
Store test_name, output file name and format, compute checksum
from output file and store it in self.data.

Parameters
----------
test_name: string
    Name of test, as found between [] in .ini file.

output_file: string
    Output file from which the checksum is computed.

output_format: string
    Format of the output file (plotfile, openpmd).

do_fields: bool, default=True
    Whether to compare fields in the checksum.

do_particles: bool, default=True
    Whether to compare particles in the checksum.

Member Function Documentation

◆ evaluate()

def Checksum.checksum.Checksum.evaluate (   self,
  rtol = 1.e-9,
  atol = 1.e-40 
)
Compare output file checksum with benchmark.
Read checksum from output file, read benchmark
corresponding to test_name, and assert that they are equal.
Almost all the body of this functions is for
user-readable print statements.

Parameters
----------
rtol: float, default=1.e-9
    Relative tolerance on the benchmark

atol: float, default=1.e-40
    Absolute tolerance on the benchmark

◆ read_output_file()

def Checksum.checksum.Checksum.read_output_file (   self,
  do_fields = True,
  do_particles = True 
)
Get checksum from output file.
Read an AMReX plotfile with yt or an openPMD file with openPMD viewer,
compute 1 checksum per field and return all checksums in a dictionary.
The checksum of quantity Q is max(abs(Q)).

Parameters
----------
do_fields: bool, default=True
    Whether to read fields from the output file.

do_particles: bool, default=True
    Whether to read particles from the output file.

Member Data Documentation

◆ data

Checksum.checksum.Checksum.data

◆ output_file

Checksum.checksum.Checksum.output_file

◆ output_format

Checksum.checksum.Checksum.output_format

◆ test_name

Checksum.checksum.Checksum.test_name

The documentation for this class was generated from the following file: