From 8a7eb756c3ea1ca05a792f803395071689d03f81 Mon Sep 17 00:00:00 2001 From: "clara.bayley" Date: Wed, 1 May 2024 00:59:35 +0200 Subject: [PATCH] fix: gbx area and volumes are not all the same, as determined by creation of gbxmaps --- libs/cartesiandomain/cartesianmaps.hpp | 20 +------------------- libs/cartesiandomain/createcartesianmaps.cpp | 12 ++++++++---- libs/runcleo/creategbxs.hpp | 2 +- 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/libs/cartesiandomain/cartesianmaps.hpp b/libs/cartesiandomain/cartesianmaps.hpp index 22c3264dd..cfe98caae 100644 --- a/libs/cartesiandomain/cartesianmaps.hpp +++ b/libs/cartesiandomain/cartesianmaps.hpp @@ -1,24 +1,6 @@ /* * Copyright (c) 2024 MPI-M, Clara Bayley * - * - * ----- CLEO ----- - * File: cartesianmaps.hpp - * Project: cartesiandomain - * Created Date: Wednesday 1st May 2024 - * Author: Clara Bayley (CB) - * Additional Contributors: - * ----- - * Last Modified: Wednesday 1st May 2024 - * Modified By: CB - * ----- - * License: BSD 3-Clause "New" or "Revised" License - * https://opensource.org/licenses/BSD-3-Clause - * ----- - * File Description: - */ - -/* Copyright (c) 2023 MPI-M, Clara Bayley * * ----- CLEO ----- * File: cartesianmaps.hpp @@ -27,7 +9,7 @@ * Author: Clara Bayley (CB) * Additional Contributors: * ----- - * Last Modified: Thursday 9th November 2023 + * Last Modified: Wednesday 1st May 2024 * Modified By: CB * ----- * License: BSD 3-Clause "New" or "Revised" License diff --git a/libs/cartesiandomain/createcartesianmaps.cpp b/libs/cartesiandomain/createcartesianmaps.cpp index 2f1b8b881..de4cb2e77 100644 --- a/libs/cartesiandomain/createcartesianmaps.cpp +++ b/libs/cartesiandomain/createcartesianmaps.cpp @@ -9,7 +9,7 @@ * Author: Clara Bayley (CB) * Additional Contributors: * ----- - * Last Modified: Friday 19th April 2024 + * Last Modified: Wednesday 1st May 2024 * Modified By: CB * ----- * License: BSD 3-Clause "New" or "Revised" License @@ -135,9 +135,10 @@ void set_maps_ndims(const std::vector &i_ndims, CartesianMaps &gbxmaps) /* sets (finite) dimensionless horizontal area and volume using area and volume from gfb for gbxidx=0 */ void set_model_areas_vols(const GbxBoundsFromBinary &gfb, CartesianMaps &gbxmaps) { - const auto idx = (unsigned int)0; - gbxmaps.insert_gbxarea(idx, gfb.gbxarea(idx)); - gbxmaps.insert_gbxvolume(idx, gfb.gbxvol(idx)); + for (auto idx : gfb.gbxidxs) { + gbxmaps.insert_gbxarea(idx, gfb.gbxarea(idx)); + gbxmaps.insert_gbxvolume(idx, gfb.gbxvol(idx)); + } } /* sets value for coordinate bounds for case @@ -151,6 +152,9 @@ void set_outofbounds(CartesianMaps &gbxmaps) { gbxmaps.insert_coord3nghbrs(idx, nullnghbrs(idx)); gbxmaps.insert_coord1nghbrs(idx, nullnghbrs(idx)); gbxmaps.insert_coord2nghbrs(idx, nullnghbrs(idx)); + + gbxmaps.insert_gbxarea(idx, 0.0); + gbxmaps.insert_gbxvolume(idx, 0.0); } /* gives all coord[X]bounds maps to 1 key with null diff --git a/libs/runcleo/creategbxs.hpp b/libs/runcleo/creategbxs.hpp index 3288d5218..e153ddfef 100644 --- a/libs/runcleo/creategbxs.hpp +++ b/libs/runcleo/creategbxs.hpp @@ -8,7 +8,7 @@ * Author: Clara Bayley (CB) * Additional Contributors: * ----- - * Last Modified: Friday 19th April 2024 + * Last Modified: Wednesday 1st May 2024 * Modified By: CB * ----- * License: BSD 3-Clause "New" or "Revised" License