cashocs.io.managers#
Output managers for cashocs.
Functions
|
Cast a value to a type. |
|
Generates the string which can be written to console and file. |
|
Generates a string for the summary of the optimization. |
Classes
|
Management of the console output. |
|
Class for managing the human-readable output of cashocs. |
|
Abstract base class for input / output management. |
|
Manages the output of meshes. |
|
Class for managing the output of the optimization history. |
|
Class for managing temporary files. |
|
Class for managing visualization .xdmf files. |
- class cashocs.io.managers.ConsoleManager(db, result_dir, verbose=False)[source]#
Bases:
IOManager
Management of the console output.
Initializes self.
- Parameters:
db (database.Database) – The database of the problem.
result_dir (str) – The directory, where the results are written to.
verbose (bool) – Boolean which indicates whether the logging setup (False) or the old setup with print (True) should be used. Default is False.
- post_process()#
The output operation which is performed as part of the postprocessing.
- Parameters:
solver – The optimization algorithm.
- Return type:
None
- class cashocs.io.managers.FileManager(db, result_dir)[source]#
Bases:
IOManager
Class for managing the human-readable output of cashocs.
Initializes self.
- Parameters:
db (database.Database) – The database of the problem.
result_dir (str) – The directory, where the results are written to.
- post_process()#
The output operation which is performed as part of the postprocessing.
- Parameters:
solver – The optimization algorithm.
- Return type:
None
- class cashocs.io.managers.IOManager(db, result_dir)[source]#
Bases:
ABC
Abstract base class for input / output management.
Initializes self.
- Parameters:
db (database.Database) – The database of the problem.
result_dir (str) – Path to the directory, where the results are saved.
- output()[source]#
The output operation, which is performed after every iteration.
- Parameters:
solver – The optimization algorithm.
- Return type:
None
- class cashocs.io.managers.MeshManager(db, result_dir)[source]#
Bases:
IOManager
Manages the output of meshes.
Initializes self.
- Parameters:
db (database.Database) – The database of the problem.
result_dir (str) – Path to the directory, where the results are saved.
- output_summary()#
The output operation, which is performed after convergence.
- Parameters:
solver – The optimization algorithm.
- Return type:
None
- class cashocs.io.managers.ResultManager(db, result_dir)[source]#
Bases:
IOManager
Class for managing the output of the optimization history.
Initializes self.
- Parameters:
db (database.Database) – The database of the problem.
result_dir (str) – Path to the directory, where the results are saved.
- output_summary()#
The output operation, which is performed after convergence.
- Parameters:
solver – The optimization algorithm.
- Return type:
None
- class cashocs.io.managers.TempFileManager(db, result_dir)[source]#
Bases:
IOManager
Class for managing temporary files.
Initializes self.
- Parameters:
db (database.Database) – The database of the problem.
result_dir (str) – Path to the directory, where the results are saved.
- output()#
The output operation, which is performed after every iteration.
- Parameters:
solver – The optimization algorithm.
- Return type:
None
- output_summary()#
The output operation, which is performed after convergence.
- Parameters:
solver – The optimization algorithm.
- Return type:
None
- class cashocs.io.managers.XDMFFileManager(db, result_dir)[source]#
Bases:
IOManager
Class for managing visualization .xdmf files.
Initializes self.
- Parameters:
db (database.Database) – The database of the problem.
result_dir (str) – Path to the directory, where the output files are saved in.
- output_summary()#
The output operation, which is performed after convergence.
- Parameters:
solver – The optimization algorithm.
- Return type:
None
- post_process()#
The output operation which is performed as part of the postprocessing.
- Parameters:
solver – The optimization algorithm.
- Return type:
None
- cashocs.io.managers.generate_output_str(db, precision)[source]#
Generates the string which can be written to console and file.
- Parameters:
db (database.Database) – The database of the problem.
precision (int) – The precision used for displaying the numbers.
- Returns:
The output string, which is used later.
- Return type:
str