 |
preCICE v3.2.0
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
18#define PRECICE_VALIDATE_MESH_NAME_IMPL(name) \
19 PRECICE_CHECK(_accessor->hasMesh(name), \
20 "The mesh named \"{}\" is unknown to preCICE.{}", \
21 name, _accessor->hintForMesh(name));
27#define PRECICE_REQUIRE_MESH_USE_IMPL(name) \
28 PRECICE_VALIDATE_MESH_NAME_IMPL(name) \
29 PRECICE_CHECK(_accessor->isMeshUsed(name), \
30 "This participant does not use the mesh \"{0}\", but attempted to access it. " \
31 "Please define a <provide-mesh name=\"{0}\" /> or <receive-mesh name=\"{0}\" from=\"...\" /> " \
32 "tag in the configuration of participant \" {1}.", \
39#define PRECICE_REQUIRE_MESH_PROVIDE_IMPL(name) \
40 PRECICE_REQUIRE_MESH_USE_IMPL(name) \
41 PRECICE_CHECK(_accessor->isMeshProvided(name), \
42 "This participant does not provide Mesh \"{0}\", but attempted to modify it. " \
43 "Please add a provide-mesh tag as follows <provide-mesh name=\"{0}\" />.", \
50#define PRECICE_REQUIRE_MESH_MODIFY_IMPL(name) \
51 PRECICE_REQUIRE_MESH_PROVIDE_IMPL(name) \
52 PRECICE_CHECK(!_meshLock.check(name), \
53 "This participant attempted to modify the Mesh \"{}\" while locked. " \
54 "Mesh modification is only allowed before calling initialize().", \
61#define PRECICE_VALIDATE_MESH_DATA_ACCESS_IMPL(name) \
62 PRECICE_VALIDATE_MESH_NAME_IMPL(name) \
63 PRECICE_CHECK(_accessor->isMeshProvided(name) || _accessor->isDirectAccessAllowed(name), \
64 "This participant does not provide Mesh \"{0}\" nor does it enable direct access to it. " \
65 "To provide the mesh add a provide-mesh tag as follows <provide-mesh name=\"{0}\" />. " \
66 "To enable direct access to the mesh please add a receive-mesh tag as follows " \
67 "<receive-mesh name=\"{0}\" from=\"...\" api-access=\"true\" />, or modify an existing one. ", \
73#define PRECICE_VALIDATE_MESH_NAME(name) \
75 PRECICE_VALIDATE_MESH_NAME_IMPL(name) \
81#define PRECICE_REQUIRE_MESH_USE(name) \
83 PRECICE_REQUIRE_MESH_USE_IMPL(name) \
89#define PRECICE_REQUIRE_MESH_PROVIDE(name) \
91 PRECICE_REQUIRE_MESH_PROVIDE_IMPL(name) \
97#define PRECICE_REQUIRE_MESH_MODIFY(name) \
99 PRECICE_REQUIRE_MESH_MODIFY_IMPL(name) \
110#define PRECICE_VALIDATE_DATA_NAME_IMPL(mesh, data) \
111 PRECICE_CHECK(_accessor->hasData(mesh, data), \
112 "The given data \"{}\" is unknown to preCICE mesh \"{}\".{}", data, mesh, _accessor->hintForMeshData(mesh, data));
118#define PRECICE_REQUIRE_DATA_READ_IMPL(mesh, data) \
119 PRECICE_VALIDATE_DATA_NAME_IMPL(mesh, data) \
120 PRECICE_CHECK((_accessor->isDataRead(mesh, data)), \
121 "This participant does not use data \"{0}\" via mesh \"{2}\", but attempted to read it. " \
122 "Please extend the configuration of participant \"{1}\" by defining <read-data mesh=\"{2}\" name=\"{0}\" /> " \
123 "or check if the data is defined on this mesh.", \
124 data, _accessorName, mesh);
130#define PRECICE_REQUIRE_DATA_WRITE_IMPL(mesh, data) \
131 PRECICE_VALIDATE_DATA_NAME_IMPL(mesh, data) \
132 PRECICE_CHECK((_accessor->isDataWrite(mesh, data)), \
133 "This participant does not use data \"{0}\" via mesh \"{2}\", but attempted to write it. " \
134 "Please extend the configuration of participant \"{1}\" by defining <write-data mesh=\"{2}\" name=\"{0}\" /> " \
135 "or check if the data is defined on this mesh.", \
136 data, _accessorName, mesh);
141#define PRECICE_VALIDATE_DATA_NAME(mesh, data) \
143 PRECICE_VALIDATE_DATA_NAME_IMPL(mesh, data) \
149#define PRECICE_REQUIRE_DATA_READ(mesh, data) \
151 PRECICE_VALIDATE_MESH_DATA_ACCESS_IMPL(mesh) \
152 PRECICE_REQUIRE_DATA_READ_IMPL(mesh, data) \
158#define PRECICE_REQUIRE_DATA_WRITE(mesh, data) \
160 PRECICE_VALIDATE_MESH_DATA_ACCESS_IMPL(mesh) \
161 PRECICE_REQUIRE_DATA_WRITE_IMPL(mesh, data) \
169#define PRECICE_VALIDATE_DATA(data, size) \
174#define PRECICE_VALIDATE_DATA(data, size) \
175 PRECICE_CHECK(std::all_of(data, data + size, [](double val) { return std::isfinite(val); }), "One of the given data values is either plus or minus infinity or NaN.");
179#define PRECICE_EXPERIMENTAL_API() \
180 PRECICE_CHECK(_allowsExperimental, "You called the API function \"{}\", which is part of the experimental API. " \
181 "You may unlock the full API by specifying <precice-configuration experimental=\"true\" ... > in the configuration. " \
182 "Please be aware that experimental features may change in any future version (even minor or bugfix).", \