carputils
Doxygen code documentation for the python framework controlling openCARP
|
Classes | |
class | MaxNPAction |
Class to check that the maximum number of processes is not exceeded. More... | |
class | PrintAction |
Class to print a unformatted message like '–help' and exit. More... | |
Functions | |
def | basic_parser (showdefault=True, overwrite_behaviour=OVERWRITE_BEHAVIOUR[0], formatter_cls=None) |
def | standard_parser (showdefault=True) |
Generate a standard argument parser for collection of common options. More... | |
def | basic_job_id (args) |
Generate default job ID. More... | |
def | basicexample (parser=basic_parser, job_id=basic_job_id, summary=True, temp=False) |
Generate a decorator for openCARP example run function. More... | |
def | carp_job_id (args) |
Generate default job ID. More... | |
def | carpexample (parser=standard_parser, job_id=carp_job_id, meshdir=None, clean_pattern='^(\d{4}-\d{2}-\d{2})|(mesh)', simple=False, summary=True, temp=False, mkdir=True) |
Generate a decorator for openCARP example run function. More... | |
def | carp_cmd (parfile=None, mech_symmetric=False) |
Construct the basic openCARP command line. More... | |
def | list_to_string (pl) |
def | gen_physics_opts (ExtraTags=None, IntraTags=None, EikonalTags=None, MechTags=None, FluidTags=None) |
def | simfile_path (path, mesh=False) |
This function should encapsulate the paths of the external files required for the experiment. More... | |
def | resolve_simfilepath (path, mesh) |
Generates the string representing the parameter that has to be given to the simfile_path function in the protocol script contained in the bundle, to replace 'path'. More... | |
Variables | |
OVERWRITE_BEHAVIOUR = tuple(clean.OVERWRITE_MODES.keys()) | |
maxnp = None | |
def carputils.tools.basic_job_id | ( | args | ) |
Generate default job ID.
def carputils.tools.basic_parser | ( | showdefault = True , |
|
overwrite_behaviour = OVERWRITE_BEHAVIOUR[0] , |
|||
formatter_cls = None |
|||
) |
def carputils.tools.basicexample | ( | parser = basic_parser , |
|
job_id = basic_job_id , |
|||
summary = True , |
|||
temp = False |
|||
) |
Generate a decorator for openCARP example run function.
The decorator sets up sensible defaults for argv and sequence for an openCARP example's run function, and executes the command sequence on exit, where required.
def carputils.tools.carp_cmd | ( | parfile = None , |
|
mech_symmetric = False |
|||
) |
Construct the basic openCARP command line.
Constructs a list of command line arguments. This will automatically include the loading of the correct options for the specified solvers.
parfile | str, optional The openCARP parameter file to be used, if any. |
def carputils.tools.carp_job_id | ( | args | ) |
Generate default job ID.
def carputils.tools.carpexample | ( | parser = standard_parser , |
|
job_id = carp_job_id , |
|||
meshdir = None , |
|||
clean_pattern = '^(\d{4}-\d{2}-\d{2})|(mesh)' , |
|||
simple = False , |
|||
summary = True , |
|||
temp = False , |
|||
mkdir = True |
|||
) |
Generate a decorator for openCARP example run function.
The decorator sets up sensible defaults for argv and sequence for a openCARP example's run function, and executes the command sequence on exit, where required.
def carputils.tools.gen_physics_opts | ( | ExtraTags = None , |
|
IntraTags = None , |
|||
EikonalTags = None , |
|||
MechTags = None , |
|||
FluidTags = None |
|||
) |
def carputils.tools.list_to_string | ( | pl | ) |
def carputils.tools.resolve_simfilepath | ( | path, | |
mesh | |||
) |
Generates the string representing the parameter that has to be given to the simfile_path function in the protocol script contained in the bundle, to replace 'path'.
If the path is an existing file path, this file is copied in the bundle. Note that the filename can be given without its extension.
path | path to a file |
mesh | set to true if the path is leading to a mesh file |
def carputils.tools.simfile_path | ( | path, | |
mesh = False |
|||
) |
This function should encapsulate the paths of the external files required for the experiment.
The function is passive if –bundle command line option is not set: it simply returns the 'path' parameter. Otherwise it changes the path into a relative path in the self-contained bundle, and consequently modifies the protocol script that will be written in the bundle. It also copies the file targeted by path in the bundle folder if it exists. The mesh option tells if the file given by the path is a mesh file or not.
path | Path to a file |
mesh | if True, the file is considered as a mesh file |
def carputils.tools.standard_parser | ( | showdefault = True | ) |
Generate a standard argument parser for collection of common options.
Returns ArgumentParser The parser object from the python standard library argparse module. See the online documentation <https://docs.python.org/2.7/library/argparse.html>
_ for information on adding additional options to this parser in a run script. To actually parse the command line, use the parse_args
method of the returned parser object.
carputils.tools.maxnp = None |
carputils.tools.OVERWRITE_BEHAVIOUR = tuple(clean.OVERWRITE_MODES.keys()) |