preCICE v3.1.1
Loading...
Searching...
No Matches
preciceC.h
Go to the documentation of this file.
1#pragma once
2
3#include <precice/Version.h>
4#include <precice/export.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
21
33 const char *participantName,
34 const char *configFileName,
35 int solverProcessIndex,
36 int solverProcessSize,
37 void * communicator);
38
54PRECICE_API void precicec_createParticipant(
55 const char *participantName,
56 const char *configFileName,
57 int solverProcessIndex,
58 int solverProcessSize);
59
61
64
68PRECICE_API void precicec_initialize();
69
75PRECICE_API void precicec_advance(double computedTimeStepSize);
76
80PRECICE_API void precicec_finalize();
81
83
86
89
92
94
97
99PRECICE_API int precicec_getMeshDimensions(const char *meshName);
100
102PRECICE_API int precicec_getDataDimensions(const char *meshName, const char *dataName);
103
107PRECICE_API int precicec_isCouplingOngoing();
108
112PRECICE_API int precicec_isTimeWindowComplete();
113
117PRECICE_API double precicec_getMaxTimeStepSize();
118
120
124
126PRECICE_API int precicec_requiresMeshConnectivityFor(const char *meshName);
127
135PRECICE_API int precicec_setMeshVertex(
136 const char * meshName,
137 const double *coordinates);
138
145PRECICE_API int precicec_getMeshVertexSize(const char *meshName);
146
158PRECICE_API void precicec_setMeshVertices(
159 const char * meshName,
160 int size,
161 const double *coordinates,
162 int * ids);
163
173PRECICE_API void precicec_setMeshEdge(
174 const char *meshName,
175 int firstVertexID,
176 int secondVertexID);
177
187PRECICE_API void precicec_setMeshEdges(
188 const char *meshName,
189 int size,
190 const int * ids);
191
195PRECICE_API void precicec_setMeshTriangle(
196 const char *meshName,
197 int firstVertexID,
198 int secondVertexID,
199 int thirdVertexID);
200
210PRECICE_API void precicec_setMeshTriangles(
211 const char *meshName,
212 int size,
213 const int * ids);
214
224PRECICE_API void precicec_setMeshQuad(
225 const char *meshName,
226 int firstVertexID,
227 int secondVertexID,
228 int thirdVertexID,
229 int fourthVertexID);
230
240PRECICE_API void precicec_setMeshQuads(
241 const char *meshName,
242 int size,
243 const int * ids);
244
254PRECICE_API void precicec_setMeshTetrahedron(
255 const char *meshName,
256 int firstVertexID,
257 int secondVertexID,
258 int thirdVertexID,
259 int fourthVertexID);
260
270PRECICE_API void precicec_setMeshTetrahedra(
271 const char *meshName,
272 int size,
273 const int * ids);
274
276
279
281PRECICE_API int precicec_requiresInitialData();
282
297PRECICE_API void precicec_writeData(
298 const char * meshName,
299 const char * dataName,
300 int size,
301 const int * valueIndices,
302 const double *values);
303
320PRECICE_API void precicec_readData(
321 const char *meshName,
322 const char *dataName,
323 int size,
324 const int * valueIndices,
325 double relativeReadTime,
326 double * values);
327
329
332
336PRECICE_API void precicec_setMeshAccessRegion(
337 const char * meshName,
338 const double *boundingBox);
339
344 const char *meshName,
345 const int size,
346 int * ids,
347 double * coordinates);
348
350
355
357PRECICE_API int precicec_requiresGradientDataFor(const char *meshName,
358 const char *dataName);
359
361PRECICE_API void precicec_writeGradientData(
362 const char * meshName,
363 const char * dataName,
364 int size,
365 const int * valueIndices,
366 const double *gradients);
367
369
379PRECICE_API const char *precicec_getVersionInformation();
380
381#ifdef __cplusplus
382}
383#endif
PRECICE_API int precicec_getMeshVertexSize(const char *meshName)
Returns the number of vertices of a mesh.
Definition preciceC.cpp:158
PRECICE_API void precicec_writeData(const char *meshName, const char *dataName, int size, const int *valueIndices, const double *values)
Writes vector data values given as block.
Definition preciceC.cpp:246
PRECICE_API int precicec_isTimeWindowComplete()
Returns true (->1), if the coupling time window is completed.
Definition preciceC.cpp:96
PRECICE_API double precicec_getMaxTimeStepSize()
Returns maximum allowed time step size.
Definition preciceC.cpp:105
PRECICE_API int precicec_getDataDimensions(const char *meshName, const char *dataName)
Returns the spatial dimensionality of the given data on the given mesh.
Definition preciceC.cpp:81
PRECICE_API void precicec_setMeshTetrahedron(const char *meshName, int firstVertexID, int secondVertexID, int thirdVertexID, int fourthVertexID)
Sets mesh tetrahedron from vertex IDs.
Definition preciceC.cpp:225
PRECICE_API void precicec_initialize()
Initiates the coupling to the coupling supervisor and initializes coupling data.
Definition preciceC.cpp:56
PRECICE_API void precicec_setMeshAccessRegion(const char *meshName, const double *boundingBox)
See precice::Participant::setMeshAccessRegion().
Definition preciceC.cpp:299
PRECICE_API int precicec_requiresGradientDataFor(const char *meshName, const char *dataName)
Checks if the given data set requires gradient data. We check if the data object has been initialized...
Definition preciceC.cpp:271
PRECICE_API const char * precicec_getVersionInformation()
Returns information on the version of preCICE.
Definition preciceC.cpp:294
PRECICE_API int precicec_getMeshDimensions(const char *meshName)
Returns the spatial dimensionality of the given mesh.
Definition preciceC.cpp:75
PRECICE_API void precicec_getMeshVertexIDsAndCoordinates(const char *meshName, const int size, int *ids, double *coordinates)
See precice::Participant::getMeshVertexIDsAndCoordinates().
Definition preciceC.cpp:307
PRECICE_API void precicec_createParticipant(const char *participantName, const char *configFileName, int solverProcessIndex, int solverProcessSize)
Creates the coupling interface and configures it.
Definition preciceC.cpp:43
PRECICE_API void precicec_advance(double computedTimeStepSize)
Exchanges data between solver and coupling supervisor.
Definition preciceC.cpp:62
PRECICE_API void precicec_setMeshVertices(const char *meshName, int size, const double *coordinates, int *ids)
Creates multiple mesh vertices.
Definition preciceC.cpp:146
PRECICE_API void precicec_setMeshEdge(const char *meshName, int firstVertexID, int secondVertexID)
Sets mesh edge from vertex IDs.
Definition preciceC.cpp:165
PRECICE_API void precicec_readData(const char *meshName, const char *dataName, int size, const int *valueIndices, double relativeReadTime, double *values)
Reads vector data values given as block.
Definition preciceC.cpp:258
PRECICE_API int precicec_requiresMeshConnectivityFor(const char *meshName)
Checks if the given mesh requires connectivity.
Definition preciceC.cpp:128
PRECICE_API void precicec_finalize()
Finalizes the coupling to the coupling supervisor.
Definition preciceC.cpp:68
PRECICE_API void precicec_createParticipant_withCommunicator(const char *participantName, const char *configFileName, int solverProcessIndex, int solverProcessSize, void *communicator)
Definition preciceC.cpp:28
PRECICE_API void precicec_setMeshQuad(const char *meshName, int firstVertexID, int secondVertexID, int thirdVertexID, int fourthVertexID)
Sets surface mesh quadrangle from vertex IDs.
Definition preciceC.cpp:204
PRECICE_API int precicec_requiresInitialData()
Definition preciceC.cpp:110
PRECICE_API void precicec_setMeshTriangle(const char *meshName, int firstVertexID, int secondVertexID, int thirdVertexID)
Sets a triangle from vertex IDs. Creates missing edges.
Definition preciceC.cpp:184
PRECICE_API void precicec_setMeshTetrahedra(const char *meshName, int size, const int *ids)
Sets multiple mesh tetrahedra from vertex IDs.
Definition preciceC.cpp:236
PRECICE_API int precicec_isCouplingOngoing()
Returns true (->1), if the coupled simulation is ongoing.
Definition preciceC.cpp:87
PRECICE_API int precicec_requiresReadingCheckpoint()
Definition preciceC.cpp:122
PRECICE_API void precicec_setMeshQuads(const char *meshName, int size, const int *ids)
Sets multiple mesh quads from vertex IDs.
Definition preciceC.cpp:215
PRECICE_API void precicec_setMeshTriangles(const char *meshName, int size, const int *ids)
Sets multiple mesh triangles from vertex IDs.
Definition preciceC.cpp:194
PRECICE_API int precicec_setMeshVertex(const char *meshName, const double *coordinates)
Creates a mesh vertex.
Definition preciceC.cpp:137
PRECICE_API int precicec_requiresWritingCheckpoint()
Definition preciceC.cpp:116
PRECICE_API void precicec_setMeshEdges(const char *meshName, int size, const int *ids)
Sets multiple mesh edge from vertex IDs.
Definition preciceC.cpp:174
PRECICE_API void precicec_writeGradientData(const char *meshName, const char *dataName, int size, const int *valueIndices, const double *gradients)
Writes vector gradient data to a mesh.
Definition preciceC.cpp:281