Skip to content

1D field INI files

The 1D field INI files contain the spatial input data for 1D network initial conditions for a D-Flow FM model.

Generic parsing and serializing functionality comes from the generic hydrolib.core.dflowfm.ini modules.

The 1D field INI file is represented by the classes below.

Model

OneDFieldBranch (INIBasedModel) pydantic-model

A [Branch] block for use inside a 1D field file.

Each block can define value(s) on a particular branch.

check_list_length_chainage(values) classmethod

Validates that the length of the chainage field is as expected.

Source code in hydrolib/core/dflowfm/onedfield/models.py
@root_validator(allow_reuse=True)
def check_list_length_chainage(cls, values):
    """Validates that the length of the chainage field is as expected."""
    return validate_correct_length(
        values,
        "chainage",
        length_name="numlocations",
        list_required_with_length=True,
    )

check_list_length_values(values) classmethod

Validates that the length of the values field is as expected.

Source code in hydrolib/core/dflowfm/onedfield/models.py
@root_validator(allow_reuse=True)
def check_list_length_values(cls, values):
    """Validates that the length of the values field is as expected."""
    return validate_correct_length(
        values,
        "values",
        length_name="numlocations",
        list_required_with_length=True,
        min_length=1,
    )

OneDFieldGeneral (INIGeneral) pydantic-model

The 1D field file's [General] section with file meta data.

OneDFieldGlobal (INIBasedModel) pydantic-model

The [Global] block with a uniform value for use inside a 1D field file.

OneDFieldModel (INIModel) pydantic-model

The overall 1D field model that contains the contents of a 1D field file.

This model is typically used when a FMModel.geometry.inifieldfile[..].initial[..].datafiletype==DataFileType.onedfield.

Attributes:

Name Type Description
general OneDFieldGeneral

[General] block with file metadata.

global_ Optional[OneDFieldGlobal]

Optional [Global] block with uniform value.

branch List[OneDFieldBranch]

Definitions of [Branch] field values.

Back to top