MGParameters#

class emg3d.solver.MGParameters(verb: int, sslsolver: str | bool, semicoarsening: int | bool, linerelaxation: int | bool, shape_cells: tuple, cycle: str | None = 'F', tol: float = 1e-06, maxit: int = 50, nu_init: int = 0, nu_pre: int = 2, nu_coarse: int = 1, nu_post: int = 2, clevel: int = -1, return_info: bool = False, log: int = 0)[source]#

Bases: object

Multigrid solver settings.

This dataclass is used by the main solver routine to keep track of settings, errors, which level we currently are in, runtime, log, and so on.

This class is instantiated by emg3d.solver.solve. Consult that function for a description of the mandatory and optional input parameters and more information .

Attributes Summary

Methods Summary

cprint(info, verbosity, **kwargs)

Prints and logs info if self.verb > verbosity.

Attributes Documentation

clevel: int = -1#
cycle: str | None = 'F'#
log: int = 0#
maxit: int = 50#
nu_coarse: int = 1#
nu_init: int = 0#
nu_post: int = 2#
nu_pre: int = 2#
return_info: bool = False#
tol: float = 1e-06#

Methods Documentation

cprint(info, verbosity, **kwargs)[source]#

Prints and logs info if self.verb > verbosity.

Parameters:
infostr

String to be printed.

verbosityint

Verbosity of info.

kwargsoptional

Arguments passed to print(), e.g., end='\r'.