Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ pip-log.txt
pip-delete-this-directory.txt

.tox

# macOS
.DS_Store
31 changes: 21 additions & 10 deletions docs/Nodes.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
# Nodes

This project builds a graph based on a precice-config.xml file. The nodes in the graph correspond to the specified XML
This project builds a graph based on a `precice-config.xml` file. The nodes in the graph correspond to the specified XML
elements and tags.<br>
The documentation for preCICE's config tags can be read
at [preCICE XML reference](https://precice.org/configuration-XML-reference.html)
The documentation for preCICE's config tags can be read at
the [preCICE XML reference](https://precice.org/configuration-XML-reference.html).

> [!NOTE]
> This graph is built for the [preCICE logic checker](https://github.com/precice-forschungsprojekt/config-checker). This
> means that there may be redundancies or “inconsistencies” in the building of the graph itself.
> This graph is built for both [preCICE config check](https://github.com/precice/config-check/)
> and [preCICE case-generate](https://github.com/precice/case-generate).
> This means that there may be redundancies or “inconsistencies” in the building of the graph itself.

Here you will find a list with brief explanations of each node and its parameters.

> [!NOTE]
> Please note that since version 1.1, each node additionally has a method `to_xml()`,
> to convert it back to a `precice-config.xml` element (string). <br>
> To allow this conversion to be as thorough as possible, additional, _optional_ attributes were added to many nodes,
> which are not listed here and _not_ required for using the graph. Their meaning can be inferred from their name or
> the [preCICE XML reference](https://precice.org/configuration-xml-reference.html).

## Participant

The participant is the center of the graph. It saves references to all connected meshes, written and read data,
Expand Down Expand Up @@ -63,8 +71,9 @@ A coupling-scheme node represents a coupling-scheme element of the XML file.
- `first_participant`: The participant of the coupling-scheme that gets referred to as `first=“”`.
- `second_participant`: The participant of the coupling-scheme that gets referred to as `second=“”`.
- `exchanges`: A list of exchanges between the participants. This links to `Exchange` nodes for further references.
- `accelerations`: A list of accelerations that are intended to accelerate data in exchanges.
- `convergence_measures`: A list of convergence-measure. Defines the convergence criterion of certain data of a mesh in a coupling-scheme.
- `accelerations`: The acceleration node that will contain references to all data-accelerations of the coupling-scheme.
- `convergence_measures`: A list of convergence-measure. Defines the convergence criterion of certain data of a mesh in
a coupling-scheme.
- `line`: The line number where the coupling-scheme is defined in the config.xml.

## MultiCouplingScheme
Expand All @@ -76,8 +85,9 @@ coupling-scheme to allow for more than two participants.
- `participants`: A list of all participants taking part in the multi-coupling-scheme.
This does _not_ include the control participant.
- `exchanges`: A list of all exchanges being used to exchange data in this multi-coupling-scheme.
- `accelerations`: A list of accelerations that are intended to accelerate data in exchanges.
- `convergence_measures`: A list of convergence-measure. Defines the convergence criterion of certain data of a mesh in a multi-coupling-scheme.
- `accelerations`: The acceleration node that will contain references to all data-accelerations of the coupling-scheme.
- `convergence_measures`: A list of convergence-measure. Defines the convergence criterion of certain data of a mesh in
a multi-coupling-scheme.
- `line`: The line number where the multi-coupling-scheme is defined in the config.xml.

## Data
Expand Down Expand Up @@ -206,7 +216,8 @@ Data is accelerated in a mesh in an exchange in the same coupling scheme.
Defines the convergence criterion of certain data of a mesh in a coupling-scheme.

- `coupling_scheme`: The coupling-scheme who the convergence-measure belongs to.
- `type`: The type of the convergence-measure node. Possible values are `absolute`, `absolute-or-relative`, `relative` and `residual-relative`.
- `type`: The type of the convergence-measure node. Possible values are `absolute`, `absolute-or-relative`, `relative`
and `residual-relative`.
- `data`: Which data should converge by type.
- `mesh`: In which mesh the data is to be converged according to the type.
- `line`: The line number where the convergence-measure is defined in the config.xml.
141 changes: 141 additions & 0 deletions precice_config_graph/enums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
"""
This graph is intended for the preCICE logical-checker https://github.com/precice-forschungsprojekt/config-checker.

You can find documentation under README.md, docs/Nodes.md and docs/Edges.md.

This graph was developed by Simon Wazynski, Alexander Hutter and Orlando Ackermann as part of https://github.com/precice-forschungsprojekt.
"""

from __future__ import annotations

from enum import Enum


class MappingMethod(Enum):
NEAREST_NEIGHBOR = "nearest-neighbor"
NEAREST_PROJECTION = "nearest-projection"
NEAREST_NEIGHBOR_GRADIENT = "nearest-neighbor-gradient"
LINEAR_CELL_INTERPOLATION = "linear-cell-interpolation"
RBF_GLOBAL_ITERATIVE = "rbf-global-iterative"
RBF_GLOBAL_DIRECT = "rbf-global-direct"
RBF_PUM_DIRECT = "rbf-pum-direct"
RBF = "rbf"
AXIAL_GEOMETRIC_MULTISCALE = "axial-geometric-multiscale"
RADIAL_GEOMETRIC_MULTISCALE = "radial-geometric-multiscale"


class MappingConstraint(Enum):
CONSERVATIVE = "conservative"
CONSISTENT = "consistent"
SCALED_CONSISTENT_SURFACE = "scaled-consistent-surface"
SCALED_CONSISTENT_VOLUME = "scaled-consistent-volume"


class M2NType(Enum):
SOCKETS = "sockets"
MPI = "mpi"
MPI_MULTIPLE_PORTS = "mpi-multiple-ports"


class Direction(Enum):
READ = "read"
WRITE = "write"


class DataType(Enum):
SCALAR = "scalar"
VECTOR = "vector"


class TimingType(Enum):
WRITE_MAPPING_POST = "write-mapping-post"
READ_MAPPING_POST = "read-mapping-post"


class CouplingSchemeType(Enum):
SERIAL_EXPLICIT = "serial-explicit"
PARALLEL_EXPLICIT = "parallel-explicit"
SERIAL_IMPLICIT = "serial-implicit"
PARALLEL_IMPLICIT = "parallel-implicit"
# This enum does not include coupling-scheme:multi, since it is modeled with a different node type


class ActionType(Enum):
MULTIPLY_BY_AREA = "multiply-by-area"
DIVIDE_BY_AREA = "divide-by-area"
SUMMATION = "summation"
PYTHON = "python"
RECORDER = "recorder"


class ExportFormat(Enum):
VTK = "vtk"
VTU = "vtu"
VTP = "vtp"
CSV = "csv"


class AccelerationType(Enum):
AITKEN = "aitken"
IQN_ILS = "IQN-ILS"
IQN_IMVJ = "IQN-IMVJ"
CONSTANT = "constant"


class ConvergenceMeasureType(Enum):
ABSOLUTE = "absolute"
ABSOLUTE_OR_RELATIVE = "absolute-or-relative"
RELATIVE = "relative"
RESIDUAL_RELATIVE = "residual-relative"


class MappingExecutorType(Enum):
CPU = "cpu"
CUDA = "cuda"
OPENMP = "openmp"
HIP = "hip"


class PreconditionerType(Enum):
CONSTANT = "constant"
VALUE = "value"
RESIDUAL = "residual"
RESIDUAL_SUM = "residual-sum"


class AccelerationFilterType(Enum):
QR1 = "QR1"
QR1ABSOLUTE = "QR1-absolute"
QR2 = "QR2"
QR3 = "QR3"


class MappingBasisFunctionType(Enum):
COMPACT_POLYNOMIAL_C0 = "compact-polynomial-c0"
COMPACT_POLYNOMIAL_C2 = "compact-polynomial-c2"
COMPACT_POLYNOMIAL_C4 = "compact-polynomial-c4"
COMPACT_POLYNOMIAL_C6 = "compact-polynomial-c6"
COMPACT_POLYNOMIAL_C8 = "compact-polynomial-c8"
COMPACT_TPS_C2 = "compact-tps-c2"
MULTIQUADRICS = "multiquadrics"
INVERSE_MULTIQUADRICS = "inverse-multiquadrics"
GAUSSIAN = "gaussian"
THIN_PLATE_SPLINE = "thin-plate-spline"
VOLUME_SPLINE = "volume-spline"


class MappingMultiscaleType(Enum):
SPREAD = "spread"
COLLECT = "collect"


class MappingMultiscaleAxis(Enum):
X = "x"
Y = "y"
Z = "z"


class MappingPolynomialType(Enum):
SEPARATE = "separate"
ON = "on"
OFF = "off"
Loading