Open uekerman opened 2 months ago
A schema could look like this (very first draft):
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"participant_name": {
"type": "string",
"description": "Name of the participant."
},
"config_file_name": {
"type": "string",
"description": "Path to the configuration file."
},
"interfaces": {
"type": "array",
"items": {
"type": "object",
"properties": {
"mesh_name": {
"type": "string",
"description": "Name of the mesh associated with this interface."
},
"write_data_names": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of data fields to be written on this mesh."
},
"read_data_names": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of data fields to be read on this mesh."
}
},
"oneOf": [
{
"required": ["write_data_names"]
},
{
"required": ["read_data_names"]
}
],
"required": ["mesh_name"]
}
}
},
"required": ["participant_name", "config_file_name", "interfaces"]
}
This now enables tooling, for example to get a GUI via the MetaConfigurator.
If we want to use something less verbose and significantly easier to read than JSON, we should strongly consider TOML.
Possible dealbreaker is that TOML doesn't feature a validation schema yet.
FEniCS adapter: precice-adapter-config.json
participant_name = "Solid"
config_file_name = "../precice-config.xml"
[interface]
coupling_mesh_name = "Solid-Mesh"
write_data_name = "Heat-Flux"
read_data_name = "Temperature"
interpolation_type = "rbf"
FMI runner: precice-settings.json
[coupling_params]
participant_name = "Mass-Left"
config_file_name = "../precice-config.xml"
mesh_name = "Mass-Left-Mesh"
write_data_name = "Force-Left"
read_data_name = "Force-Right"
ASTE replay:
participant = "Fluid"
startdt = 1
precice-config = "../precice-config.xml"
[[meshes]]
mesh = "Fluid-Mesh"
meshfileprefix = "./exported-meshes/Fluid-Mesh-Fluid"
[meshes.read-data]
vector = [ "Displacement" ]
[meshes.write-data]
vector = [ "Force" ]
Just a side comment:
deal.II adapter prm solver-specific
while that's true, json format is also supported and available in deal.II.
@Logende This is the schema I just talked about. Could be an additional showcase for your thesis.
An initial step may be to unify the syntax of all configuration files.
There are tools that allow checking various formats against json schema files: https://www.npmjs.com/package/pajv
There are also some format-specific toolkits that offer json schema validation: https://taplo.tamasfe.dev/
Some solver-specific solutions are quite meaningful. Other solutions reinvent the wheel. We have no standard and no schema yet. The latter could also enable quite some tooling support.
An initial step may be to unify the syntax of all configuration files.
I think we first need to agree on whether we want to enforce every adapter to use the same configuration file format, even in the case the solver-specific solution makes sense.
History:
std::string
ABI (pre- and post-C++11). This specific reason should not hold today, but we anyway wanted to reduce dependencies.In the proposal, we also don't really specify the enforcement:
Finally, we want to take advantage of the standardization process of work package WP2 to also generate standard adapter configurations for all coupled participants, in case a standard is not already in place (e.g., for the OpenFOAM adapter, see WP2).
I think that:
Going one step further, I still think that many (not all) of the options we currently provide via adapter configurations could be sourced from the preCICE configuration file, see the older issue https://github.com/precice/precice/issues/474.
I think we first need to agree on whether we want to enforce every adapter to use the same configuration file format, even in the case the solver-specific solution makes sense.
To my understanding, @uekerman proposed to use a solver-native solution if available and use a uniform format as the default fallback.
Even if we continue to also allow solver-native solutions (we have indeed learned in the past that this is very helpful), we could still make them use the same (language-independent) schema. Currently, OpenFOAM, for example, already follows a very similar schema, only in a different language.
preciceConfig "precice-config.xml";
participant Fluid;
modules (CHT);
interfaces
{
Interface1
{
mesh Fluid-Mesh;
patches (interface);
locations faceCenters;
readData
(
Heat-Flux
);
writeData
(
Temperature
);
};
};
We currently have a zoo of configuration options:
Some solver-specific solutions are quite meaningful. Other solutions reinvent the wheel. We have no standard and no schema yet. The latter could also enable quite some tooling support.
Example:
FEniCS adapter:
precice-adapter-config.json
FMI runner:
precice-settings.json
ASTE replay: