From cffb7d88bb30c061f7602c75c93c875e706bed78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Wed, 17 Jan 2024 10:41:06 +0100 Subject: [PATCH] Port dimension lookup --- adapter/PreciceInterface.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/adapter/PreciceInterface.c b/adapter/PreciceInterface.c index 874fdb7..9164864 100644 --- a/adapter/PreciceInterface.c +++ b/adapter/PreciceInterface.c @@ -437,7 +437,16 @@ void Precice_FreeData(SimulationData *sim) void PreciceInterface_Create(PreciceInterface *interface, SimulationData *sim, InterfaceConfig const *config) { - interface->dim = precicec_getDimensions(); + if (config->nodesMeshName) { + interface->dim = precicec_getMeshDimensions(config->nodesMeshName); + } else { + if (config->facesMeshName) { + interface->dim = precicec_getMeshDimensions(config->facesMeshName); + } else { + printf("ERROR: You need to define either a face or a nodes mesh. Check the adapter configuration file.\n"); + exit(EXIT_FAILURE); + } + } // Initialize pointers as NULL interface->elementIDs = NULL;