Skip to content

Commit 029b809

Browse files
Merge pull request #1 from precice/node-extensions
elcome to config graph version 1.1, the best version of config graph we've ever built! This new version features several life-changing new features: Did you ever want to create a precice-config.xml from our graph? Well now you can! Did you ever wonder where other config element-tags where? They have just arrived, fresh from the drawing board Do not worry, none of these parameters are needed for creating a graph to validate an existing precice-config.xml The usage of [Multi]CouplingSchemeNodes got even better! Their previous list-attribute accelerations has been changed to allow only a single AccelerationNode Additionally, to improve readability, we moved all the enums for creating nodes to the new "enums.py" file. Will you validate precise-config.xml's more fiercely than ever before? Or are you going to build the greatest config ever? The choice is now yours! Stay tuned for what's to come next!
2 parents c196a23 + ae5c8a2 commit 029b809

File tree

8 files changed

+785
-392
lines changed

8 files changed

+785
-392
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ pip-log.txt
3838
pip-delete-this-directory.txt
3939

4040
.tox
41+
42+
# macOS
43+
.DS_Store

docs/Nodes.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
# Nodes
22

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

88
> [!NOTE]
9-
> This graph is built for the [preCICE logic checker](https://github.com/precice-forschungsprojekt/config-checker). This
10-
> means that there may be redundancies or “inconsistencies” in the building of the graph itself.
9+
> This graph is built for both [preCICE config check](https://github.com/precice/config-check/)
10+
> and [preCICE case-generate](https://github.com/precice/case-generate).
11+
> This means that there may be redundancies or “inconsistencies” in the building of the graph itself.
1112
1213
Here you will find a list with brief explanations of each node and its parameters.
1314

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

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

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

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

208218
- `coupling_scheme`: The coupling-scheme who the convergence-measure belongs to.
209-
- `type`: The type of the convergence-measure node. Possible values are `absolute`, `absolute-or-relative`, `relative` and `residual-relative`.
219+
- `type`: The type of the convergence-measure node. Possible values are `absolute`, `absolute-or-relative`, `relative`
220+
and `residual-relative`.
210221
- `data`: Which data should converge by type.
211222
- `mesh`: In which mesh the data is to be converged according to the type.
212223
- `line`: The line number where the convergence-measure is defined in the config.xml.

precice_config_graph/enums.py

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
"""
2+
This graph is intended for the preCICE logical-checker https://github.com/precice-forschungsprojekt/config-checker.
3+
4+
You can find documentation under README.md, docs/Nodes.md and docs/Edges.md.
5+
6+
This graph was developed by Simon Wazynski, Alexander Hutter and Orlando Ackermann as part of https://github.com/precice-forschungsprojekt.
7+
"""
8+
9+
from __future__ import annotations
10+
11+
from enum import Enum
12+
13+
14+
class MappingMethod(Enum):
15+
NEAREST_NEIGHBOR = "nearest-neighbor"
16+
NEAREST_PROJECTION = "nearest-projection"
17+
NEAREST_NEIGHBOR_GRADIENT = "nearest-neighbor-gradient"
18+
LINEAR_CELL_INTERPOLATION = "linear-cell-interpolation"
19+
RBF_GLOBAL_ITERATIVE = "rbf-global-iterative"
20+
RBF_GLOBAL_DIRECT = "rbf-global-direct"
21+
RBF_PUM_DIRECT = "rbf-pum-direct"
22+
RBF = "rbf"
23+
AXIAL_GEOMETRIC_MULTISCALE = "axial-geometric-multiscale"
24+
RADIAL_GEOMETRIC_MULTISCALE = "radial-geometric-multiscale"
25+
26+
27+
class MappingConstraint(Enum):
28+
CONSERVATIVE = "conservative"
29+
CONSISTENT = "consistent"
30+
SCALED_CONSISTENT_SURFACE = "scaled-consistent-surface"
31+
SCALED_CONSISTENT_VOLUME = "scaled-consistent-volume"
32+
33+
34+
class M2NType(Enum):
35+
SOCKETS = "sockets"
36+
MPI = "mpi"
37+
MPI_MULTIPLE_PORTS = "mpi-multiple-ports"
38+
39+
40+
class Direction(Enum):
41+
READ = "read"
42+
WRITE = "write"
43+
44+
45+
class DataType(Enum):
46+
SCALAR = "scalar"
47+
VECTOR = "vector"
48+
49+
50+
class TimingType(Enum):
51+
WRITE_MAPPING_POST = "write-mapping-post"
52+
READ_MAPPING_POST = "read-mapping-post"
53+
54+
55+
class CouplingSchemeType(Enum):
56+
SERIAL_EXPLICIT = "serial-explicit"
57+
PARALLEL_EXPLICIT = "parallel-explicit"
58+
SERIAL_IMPLICIT = "serial-implicit"
59+
PARALLEL_IMPLICIT = "parallel-implicit"
60+
# This enum does not include coupling-scheme:multi, since it is modeled with a different node type
61+
62+
63+
class ActionType(Enum):
64+
MULTIPLY_BY_AREA = "multiply-by-area"
65+
DIVIDE_BY_AREA = "divide-by-area"
66+
SUMMATION = "summation"
67+
PYTHON = "python"
68+
RECORDER = "recorder"
69+
70+
71+
class ExportFormat(Enum):
72+
VTK = "vtk"
73+
VTU = "vtu"
74+
VTP = "vtp"
75+
CSV = "csv"
76+
77+
78+
class AccelerationType(Enum):
79+
AITKEN = "aitken"
80+
IQN_ILS = "IQN-ILS"
81+
IQN_IMVJ = "IQN-IMVJ"
82+
CONSTANT = "constant"
83+
84+
85+
class ConvergenceMeasureType(Enum):
86+
ABSOLUTE = "absolute"
87+
ABSOLUTE_OR_RELATIVE = "absolute-or-relative"
88+
RELATIVE = "relative"
89+
RESIDUAL_RELATIVE = "residual-relative"
90+
91+
92+
class MappingExecutorType(Enum):
93+
CPU = "cpu"
94+
CUDA = "cuda"
95+
OPENMP = "openmp"
96+
HIP = "hip"
97+
98+
99+
class PreconditionerType(Enum):
100+
CONSTANT = "constant"
101+
VALUE = "value"
102+
RESIDUAL = "residual"
103+
RESIDUAL_SUM = "residual-sum"
104+
105+
106+
class AccelerationFilterType(Enum):
107+
QR1 = "QR1"
108+
QR1ABSOLUTE = "QR1-absolute"
109+
QR2 = "QR2"
110+
QR3 = "QR3"
111+
112+
113+
class MappingBasisFunctionType(Enum):
114+
COMPACT_POLYNOMIAL_C0 = "compact-polynomial-c0"
115+
COMPACT_POLYNOMIAL_C2 = "compact-polynomial-c2"
116+
COMPACT_POLYNOMIAL_C4 = "compact-polynomial-c4"
117+
COMPACT_POLYNOMIAL_C6 = "compact-polynomial-c6"
118+
COMPACT_POLYNOMIAL_C8 = "compact-polynomial-c8"
119+
COMPACT_TPS_C2 = "compact-tps-c2"
120+
MULTIQUADRICS = "multiquadrics"
121+
INVERSE_MULTIQUADRICS = "inverse-multiquadrics"
122+
GAUSSIAN = "gaussian"
123+
THIN_PLATE_SPLINE = "thin-plate-spline"
124+
VOLUME_SPLINE = "volume-spline"
125+
126+
127+
class MappingMultiscaleType(Enum):
128+
SPREAD = "spread"
129+
COLLECT = "collect"
130+
131+
132+
class MappingMultiscaleAxis(Enum):
133+
X = "x"
134+
Y = "y"
135+
Z = "z"
136+
137+
138+
class MappingPolynomialType(Enum):
139+
SEPARATE = "separate"
140+
ON = "on"
141+
OFF = "off"

0 commit comments

Comments
 (0)