pytuflow.FVC

Contents

pytuflow.FVC#

class FVC(*args, **kwargs)#

Bases: ControlFileLoadMixin, FVCControlFileBuildState

Initialises the FVC class in a build state. This is the main entry point for reading/writing a TUFLOW FV model.

If the class is initialised with the fpath parameter set to None, an empty class will be initialised.

Parameters:
  • fpath (PathLike, optional) – The path to the control file (str or Path). If set to None, the FVC will be initialised as an empty control file.

  • **kwargs (optional parameters) –

    • configFVCConfig, optional

      This object stores useful information such as variable mappings, the event database, water qualiaty model directory etc. If set to None, a new FVCConfig object will be created. For FVC, the settings object should be left as None.

    • parentControlFile, optional

      Will set the parent of the control file to another control file e.g. for a FVWQ, the parent should be set to the FVC. For FVCs, the parent should be set to None.

    • scopeScopeList, optional

      A list of scope objects that will be inherited by the control file itself. Not currently used but reserved in case this is useful information in the future.

    • log_levelstr, optional

      The logging level to use for the control file. Options are ‘DEBUG’, ‘INFO’, ‘WARNING’, ‘ERROR’, ‘CRITICAL’. Default is ‘WARNING’.

    • log_to_filePathLike, optional

      If set, will log the control file to the given file path. Default is None.

Examples

point to FV example

__init__(*args, **kwargs)#

Methods

append_input

Appends a new input to the end of the control file.

bc_dbase

Generates a virtual boundary database file from the BC blocks.

bc_default_update_dt

Returns the default BC Update dt interval.

comment_out

Comments out a given input.

context

Create a RunState version of this object.

event_database

Returns the EventDatabase object.

find_input

Find a particular input(s) using a search filter.

fvptm

fvsed

fvwq

include_salinity

Returns whether salinity is turned on.

include_sediment

Returns whether sediment is turned on.

include_temperature

Returns whether temperature is turned on.

input

Returns the input with the given UUID.

insert_input

Inserts an input before, or after, another reference input.

is_3d

Returns whether the model is has 3D hydrodynamics enabled.

mat_file

preview

Preview the control file in stdout.

remove_input

Removes the input from the control file.

reset

Resets all recorded changes made to the control file since the last call to write().

sediment_fraction_count

Returns the number of sediment groups.

sediment_fractions

Returns a unique list of the sediment fraction names.

tef

tracer_count

Returns the number of tracers in the model.

uncomment

Uncomment a given input.

undo

Undo the last recorded change.

water_quality_model

Returns the name of the water quality model being used.

wq_constituent_count

Returns the number of water quality constituents used in the model.

wq_constituents

Returns a unique list of the water quality constituents in the model.

write

Write the object to file.

Attributes

TUFLOW_TYPE

A string identifying the PyTUFLOW object type.

dirty

Whether the object has been changed since it was last written to file.

fpath

The path to the control file.

fvc

root_cf

Allows overriding by FVC to be the fvc rather than the tcf.

scope

List of scopes associated with the object.

parser

The parser iterable that is used to load the control file.

config

The configuration settings for the model.

inputs

The list of inputs and comments in the control file

parent

The parent control file

altered_inputs

The list of all changes made to the control file since the last time write() was called.

loaded

Whether the control file has been loaded from disk or not.