From 64b1273dca2e88391f321e23e55ea01de391afa6 Mon Sep 17 00:00:00 2001 From: David Salac Date: Fri, 11 Oct 2024 10:39:44 -0400 Subject: [PATCH 1/9] Localize coordinates --- src/domain/boxMesh.cpp | 2 +- src/domain/boxMeshBoundaryCells.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/domain/boxMesh.cpp b/src/domain/boxMesh.cpp index 67d06549d..ca59e17c7 100644 --- a/src/domain/boxMesh.cpp +++ b/src/domain/boxMesh.cpp @@ -36,7 +36,7 @@ DM ablate::domain::BoxMesh::CreateBoxDM(const std::string& name, std::vector facesPetsc(faces.begin(), faces.end()); DM dm; - DMPlexCreateBoxMesh(PETSC_COMM_WORLD, (PetscInt)dimensions, simplex ? PETSC_TRUE : PETSC_FALSE, &facesPetsc[0], &lower[0], &upper[0], &boundaryTypes[0], PETSC_TRUE, &dm) >> + DMPlexCreateBoxMesh(PETSC_COMM_WORLD, (PetscInt)dimensions, simplex ? PETSC_TRUE : PETSC_FALSE, &facesPetsc[0], &lower[0], &upper[0], &boundaryTypes[0], PETSC_TRUE, dimensions, PETSC_TRUE, &dm) >> utilities::PetscUtilities::checkError; PetscObjectSetName((PetscObject)dm, name.c_str()) >> utilities::PetscUtilities::checkError; return dm; diff --git a/src/domain/boxMeshBoundaryCells.cpp b/src/domain/boxMeshBoundaryCells.cpp index 484c6cd72..331fe681d 100644 --- a/src/domain/boxMeshBoundaryCells.cpp +++ b/src/domain/boxMeshBoundaryCells.cpp @@ -66,7 +66,7 @@ DM ablate::domain::BoxMeshBoundaryCells::CreateBoxDM(const std::string& name, st // Make copy with PetscInt std::vector facesPetsc(faces.begin(), faces.end()); DM dm; - DMPlexCreateBoxMesh(PETSC_COMM_WORLD, (PetscInt)dimensions, simplex ? PETSC_TRUE : PETSC_FALSE, &facesPetsc[0], &lower[0], &upper[0], nullptr, PETSC_TRUE, &dm) >> + DMPlexCreateBoxMesh(PETSC_COMM_WORLD, (PetscInt)dimensions, simplex ? PETSC_TRUE : PETSC_FALSE, &facesPetsc[0], &lower[0], &upper[0], nullptr, PETSC_TRUE, dimensions, PETSC_TRUE, &dm) >> utilities::PetscUtilities::checkError; PetscObjectSetName((PetscObject)dm, name.c_str()) >> utilities::PetscUtilities::checkError; return dm; @@ -164,4 +164,4 @@ REGISTER(ablate::domain::Domain, ablate::domain::BoxMeshBoundaryCells, OPT(std::vector, "postModifiers", "a list of domain modifiers to apply after ghost labeling"), ARG(std::vector, "faces", "the number of faces in each direction"), ARG(std::vector, "lower", "the lower bound of the mesh"), ARG(std::vector, "upper", "the upper bound of the mesh"), - OPT(ablate::parameters::Parameters, "options", "PETSc options specific to this dm. Default value allows the dm to access global options.")); \ No newline at end of file + OPT(ablate::parameters::Parameters, "options", "PETSc options specific to this dm. Default value allows the dm to access global options.")); From 5e6fb72f1e24d9312ede3521672f1d4037260f1d Mon Sep 17 00:00:00 2001 From: klbudzin Date: Mon, 23 Sep 2024 14:37:03 -0400 Subject: [PATCH 2/9] The HDF5 data storage formatting in petsc was changed recently to ignore redundant fields such as cell-fields which hold our field seperated values. Until I can see how these different outputting versions can be used in ablate (i.e. smaller restart files only using aux/solution vectors) we will just default to the legacy version --- src/io/hdf5MultiFileSerializer.cpp | 8 ++++++++ src/io/hdf5Serializer.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/io/hdf5MultiFileSerializer.cpp b/src/io/hdf5MultiFileSerializer.cpp index c13f340ce..13a3163bf 100644 --- a/src/io/hdf5MultiFileSerializer.cpp +++ b/src/io/hdf5MultiFileSerializer.cpp @@ -9,6 +9,14 @@ ablate::io::Hdf5MultiFileSerializer::Hdf5MultiFileSerializer(std::shared_ptr interval, const std::shared_ptr& options) : interval(std::move(interval)), rootOutputDirectory(environment::RunEnvironment::Get().GetOutputDirectory()) { + // New petsc HDF5 Data Storage as of 09/23/24, for now we will default to the legacy version until I understand more of the different + // outputting version available and how they mesh with ablate + { + PetscBool hdf5VersionFound; + PetscOptionsHasName(nullptr, nullptr, "-dm_plex_view_hdf5_storage_version", &hdf5VersionFound); + if (!hdf5VersionFound) PetscOptionsSetValue(nullptr, "-dm_plex_view_hdf5_storage_version", "1.1.0"); + } + // Load the metadata from the file is available, otherwise set to 0 auto restartFilePath = rootOutputDirectory / "restart.rst"; diff --git a/src/io/hdf5Serializer.cpp b/src/io/hdf5Serializer.cpp index b35d3aa15..634a88064 100644 --- a/src/io/hdf5Serializer.cpp +++ b/src/io/hdf5Serializer.cpp @@ -11,6 +11,14 @@ #include "utilities/petscUtilities.hpp" ablate::io::Hdf5Serializer::Hdf5Serializer(std::shared_ptr interval) : interval(std::move(interval)) { + // New petsc HDF5 Data Storage as of 09/23/24, for now we will default to the legacy version until I understand more of the different + // outputting version available and how they mesh with ablate + { + PetscBool hdf5VersionFound; + PetscOptionsHasName(nullptr, nullptr, "-dm_plex_view_hdf5_storage_version", &hdf5VersionFound); + if (!hdf5VersionFound) PetscOptionsSetValue(nullptr, "-dm_plex_view_hdf5_storage_version", "1.1.0"); + } + // Load the metadata from the file is available, otherwise set to 0 auto restartFilePath = environment::RunEnvironment::Get().GetOutputDirectory() / "restart.rst"; From d238c6b8e883b199e054c39f44c49a451b4d8823 Mon Sep 17 00:00:00 2001 From: David Salac Date: Fri, 11 Oct 2024 10:43:34 -0400 Subject: [PATCH 3/9] Petsc API changes to DMPlexCreateBoxMesh and change in typo from dim->dof in dmViewFromOptions in petsc --- .../inputs/domain/dmViewFromOptions.txt | 18 ++--- .../inputs/domain/extrudeBoundaryTest.txt | 68 +++++++++---------- .../inputs/domain/meshMappingTest.txt | 68 +++++++++---------- .../domain/meshMappingTestCoordinateSpace.txt | 50 +++++++------- .../compressibleFlowEulerDiffusionTests.cpp | 2 +- .../compressibleFlowMmsSourceTests.cpp | 2 +- .../compressibleShockTubeTests.cpp | 2 +- 7 files changed, 105 insertions(+), 105 deletions(-) diff --git a/tests/integrationTests/inputs/domain/dmViewFromOptions.txt b/tests/integrationTests/inputs/domain/dmViewFromOptions.txt index c71240ec6..9d2d4cde3 100644 --- a/tests/integrationTests/inputs/domain/dmViewFromOptions.txt +++ b/tests/integrationTests/inputs/domain/dmViewFromOptions.txt @@ -88,15 +88,15 @@ Cones: coordinates with 1 fields field 0 with 2 components Process 0: - ( 4) dim 2 offset 0 0. 0. - ( 5) dim 2 offset 2 0.5 0. - ( 6) dim 2 offset 4 1. 0. - ( 7) dim 2 offset 6 0. 0.5 - ( 8) dim 2 offset 8 0.5 0.5 - ( 9) dim 2 offset 10 1. 0.5 - ( 10) dim 2 offset 12 0. 1. - ( 11) dim 2 offset 14 0.5 1. - ( 12) dim 2 offset 16 1. 1. + ( 4) dof 2 offset 0 0. 0. + ( 5) dof 2 offset 2 0.5 0. + ( 6) dof 2 offset 4 1. 0. + ( 7) dof 2 offset 6 0. 0.5 + ( 8) dof 2 offset 8 0.5 0.5 + ( 9) dof 2 offset 10 1. 0.5 + ( 10) dof 2 offset 12 0. 1. + ( 11) dof 2 offset 14 0.5 1. + ( 12) dof 2 offset 16 1. 1. Labels: Label 'marker': [0]: 4 (4) diff --git a/tests/integrationTests/inputs/domain/extrudeBoundaryTest.txt b/tests/integrationTests/inputs/domain/extrudeBoundaryTest.txt index 9a2a14b20..5ee536638 100644 --- a/tests/integrationTests/inputs/domain/extrudeBoundaryTest.txt +++ b/tests/integrationTests/inputs/domain/extrudeBoundaryTest.txt @@ -468,40 +468,40 @@ Cones: coordinates with 1 fields field 0 with 2 components Process 0: - ( 24) dim 2 offset 0 0. 0. - ( 25) dim 2 offset 2 -0.176777 -0.176777 - ( 26) dim 2 offset 4 0.25 0. - ( 27) dim 2 offset 6 0.25 -0.25 - ( 28) dim 2 offset 8 0.5 0. - ( 29) dim 2 offset 10 0.5 -0.25 - ( 30) dim 2 offset 12 0.75 0. - ( 31) dim 2 offset 14 0.75 -0.25 - ( 32) dim 2 offset 16 1. 0. - ( 33) dim 2 offset 18 1.17678 -0.176777 - ( 34) dim 2 offset 20 0. 0.25 - ( 35) dim 2 offset 22 -0.25 0.25 - ( 36) dim 2 offset 24 0. 0.5 - ( 37) dim 2 offset 26 -0.25 0.5 - ( 38) dim 2 offset 28 0. 0.75 - ( 39) dim 2 offset 30 -0.25 0.75 - ( 40) dim 2 offset 32 0. 1. - ( 41) dim 2 offset 34 -0.176777 1.17678 - ( 42) dim 2 offset 36 0.25 0.25 - ( 43) dim 2 offset 38 0.5 0.25 - ( 44) dim 2 offset 40 0.75 0.25 - ( 45) dim 2 offset 42 1. 0.25 - ( 46) dim 2 offset 44 0.25 0.5 - ( 47) dim 2 offset 46 0.5 0.5 - ( 48) dim 2 offset 48 0.75 0.5 - ( 49) dim 2 offset 50 1. 0.5 - ( 50) dim 2 offset 52 0.25 0.75 - ( 51) dim 2 offset 54 0.5 0.75 - ( 52) dim 2 offset 56 0.75 0.75 - ( 53) dim 2 offset 58 1. 0.75 - ( 54) dim 2 offset 60 0.25 1. - ( 55) dim 2 offset 62 0.5 1. - ( 56) dim 2 offset 64 0.75 1. - ( 57) dim 2 offset 66 1. 1. + ( 24) dof 2 offset 0 0. 0. + ( 25) dof 2 offset 2 -0.176777 -0.176777 + ( 26) dof 2 offset 4 0.25 0. + ( 27) dof 2 offset 6 0.25 -0.25 + ( 28) dof 2 offset 8 0.5 0. + ( 29) dof 2 offset 10 0.5 -0.25 + ( 30) dof 2 offset 12 0.75 0. + ( 31) dof 2 offset 14 0.75 -0.25 + ( 32) dof 2 offset 16 1. 0. + ( 33) dof 2 offset 18 1.17678 -0.176777 + ( 34) dof 2 offset 20 0. 0.25 + ( 35) dof 2 offset 22 -0.25 0.25 + ( 36) dof 2 offset 24 0. 0.5 + ( 37) dof 2 offset 26 -0.25 0.5 + ( 38) dof 2 offset 28 0. 0.75 + ( 39) dof 2 offset 30 -0.25 0.75 + ( 40) dof 2 offset 32 0. 1. + ( 41) dof 2 offset 34 -0.176777 1.17678 + ( 42) dof 2 offset 36 0.25 0.25 + ( 43) dof 2 offset 38 0.5 0.25 + ( 44) dof 2 offset 40 0.75 0.25 + ( 45) dof 2 offset 42 1. 0.25 + ( 46) dof 2 offset 44 0.25 0.5 + ( 47) dof 2 offset 46 0.5 0.5 + ( 48) dof 2 offset 48 0.75 0.5 + ( 49) dof 2 offset 50 1. 0.5 + ( 50) dof 2 offset 52 0.25 0.75 + ( 51) dof 2 offset 54 0.5 0.75 + ( 52) dof 2 offset 56 0.75 0.75 + ( 53) dof 2 offset 58 1. 0.75 + ( 54) dof 2 offset 60 0.25 1. + ( 55) dof 2 offset 62 0.5 1. + ( 56) dof 2 offset 64 0.75 1. + ( 57) dof 2 offset 66 1. 1. Labels: Label 'celltype': [0]: 0 (4) diff --git a/tests/integrationTests/inputs/domain/meshMappingTest.txt b/tests/integrationTests/inputs/domain/meshMappingTest.txt index e795d40d4..d195b74ad 100644 --- a/tests/integrationTests/inputs/domain/meshMappingTest.txt +++ b/tests/integrationTests/inputs/domain/meshMappingTest.txt @@ -428,40 +428,40 @@ Cones: coordinates with 1 fields field 0 with 2 components Process 0: - ( 24) dim 2 offset 0 1. 2. - ( 25) dim 2 offset 2 0.823223 1.82322 - ( 26) dim 2 offset 4 1.25 2. - ( 27) dim 2 offset 6 1.25 1.75 - ( 28) dim 2 offset 8 1.5 2. - ( 29) dim 2 offset 10 1.5 1.75 - ( 30) dim 2 offset 12 1.75 2. - ( 31) dim 2 offset 14 1.75 1.75 - ( 32) dim 2 offset 16 2. 2. - ( 33) dim 2 offset 18 2.17678 1.82322 - ( 34) dim 2 offset 20 1. 2.25 - ( 35) dim 2 offset 22 0.75 2.25 - ( 36) dim 2 offset 24 1. 2.5 - ( 37) dim 2 offset 26 0.75 2.5 - ( 38) dim 2 offset 28 1. 2.75 - ( 39) dim 2 offset 30 0.75 2.75 - ( 40) dim 2 offset 32 1. 3. - ( 41) dim 2 offset 34 0.823223 3.17678 - ( 42) dim 2 offset 36 1.25 2.25 - ( 43) dim 2 offset 38 1.5 2.25 - ( 44) dim 2 offset 40 1.75 2.25 - ( 45) dim 2 offset 42 2. 2.25 - ( 46) dim 2 offset 44 1.25 2.5 - ( 47) dim 2 offset 46 1.5 2.5 - ( 48) dim 2 offset 48 1.75 2.5 - ( 49) dim 2 offset 50 2. 2.5 - ( 50) dim 2 offset 52 1.25 2.75 - ( 51) dim 2 offset 54 1.5 2.75 - ( 52) dim 2 offset 56 1.75 2.75 - ( 53) dim 2 offset 58 2. 2.75 - ( 54) dim 2 offset 60 1.25 3. - ( 55) dim 2 offset 62 1.5 3. - ( 56) dim 2 offset 64 1.75 3. - ( 57) dim 2 offset 66 2. 3. + ( 24) dof 2 offset 0 1. 2. + ( 25) dof 2 offset 2 0.823223 1.82322 + ( 26) dof 2 offset 4 1.25 2. + ( 27) dof 2 offset 6 1.25 1.75 + ( 28) dof 2 offset 8 1.5 2. + ( 29) dof 2 offset 10 1.5 1.75 + ( 30) dof 2 offset 12 1.75 2. + ( 31) dof 2 offset 14 1.75 1.75 + ( 32) dof 2 offset 16 2. 2. + ( 33) dof 2 offset 18 2.17678 1.82322 + ( 34) dof 2 offset 20 1. 2.25 + ( 35) dof 2 offset 22 0.75 2.25 + ( 36) dof 2 offset 24 1. 2.5 + ( 37) dof 2 offset 26 0.75 2.5 + ( 38) dof 2 offset 28 1. 2.75 + ( 39) dof 2 offset 30 0.75 2.75 + ( 40) dof 2 offset 32 1. 3. + ( 41) dof 2 offset 34 0.823223 3.17678 + ( 42) dof 2 offset 36 1.25 2.25 + ( 43) dof 2 offset 38 1.5 2.25 + ( 44) dof 2 offset 40 1.75 2.25 + ( 45) dof 2 offset 42 2. 2.25 + ( 46) dof 2 offset 44 1.25 2.5 + ( 47) dof 2 offset 46 1.5 2.5 + ( 48) dof 2 offset 48 1.75 2.5 + ( 49) dof 2 offset 50 2. 2.5 + ( 50) dof 2 offset 52 1.25 2.75 + ( 51) dof 2 offset 54 1.5 2.75 + ( 52) dof 2 offset 56 1.75 2.75 + ( 53) dof 2 offset 58 2. 2.75 + ( 54) dof 2 offset 60 1.25 3. + ( 55) dof 2 offset 62 1.5 3. + ( 56) dof 2 offset 64 1.75 3. + ( 57) dof 2 offset 66 2. 3. Labels: Label 'celltype': [0]: 0 (4) diff --git a/tests/integrationTests/inputs/domain/meshMappingTestCoordinateSpace.txt b/tests/integrationTests/inputs/domain/meshMappingTestCoordinateSpace.txt index dee05707d..2830ceac4 100644 --- a/tests/integrationTests/inputs/domain/meshMappingTestCoordinateSpace.txt +++ b/tests/integrationTests/inputs/domain/meshMappingTestCoordinateSpace.txt @@ -296,31 +296,31 @@ Cones: coordinates with 1 fields field 0 with 2 components Process 0: - ( 16) dim 2 offset 0 0. 0. - ( 17) dim 2 offset 2 0.5 0. - ( 18) dim 2 offset 4 1. 0. - ( 19) dim 2 offset 6 1.5 0. - ( 20) dim 2 offset 8 2. 0. - ( 21) dim 2 offset 10 0. 0.75 - ( 22) dim 2 offset 12 0.5 0.75 - ( 23) dim 2 offset 14 1. 0.75 - ( 24) dim 2 offset 16 1.5 0.75 - ( 25) dim 2 offset 18 2. 0.75 - ( 26) dim 2 offset 20 0. 1.5 - ( 27) dim 2 offset 22 0.5 1.5 - ( 28) dim 2 offset 24 1. 1.5 - ( 29) dim 2 offset 26 1.5 1.5 - ( 30) dim 2 offset 28 2. 1.5 - ( 31) dim 2 offset 30 0. 2.25 - ( 32) dim 2 offset 32 0.5 2.25 - ( 33) dim 2 offset 34 1. 2.25 - ( 34) dim 2 offset 36 1.5 2.25 - ( 35) dim 2 offset 38 2. 2.25 - ( 36) dim 2 offset 40 0. 3. - ( 37) dim 2 offset 42 0.5 3. - ( 38) dim 2 offset 44 1. 3. - ( 39) dim 2 offset 46 1.5 3. - ( 40) dim 2 offset 48 2. 3. + ( 16) dof 2 offset 0 0. 0. + ( 17) dof 2 offset 2 0.5 0. + ( 18) dof 2 offset 4 1. 0. + ( 19) dof 2 offset 6 1.5 0. + ( 20) dof 2 offset 8 2. 0. + ( 21) dof 2 offset 10 0. 0.75 + ( 22) dof 2 offset 12 0.5 0.75 + ( 23) dof 2 offset 14 1. 0.75 + ( 24) dof 2 offset 16 1.5 0.75 + ( 25) dof 2 offset 18 2. 0.75 + ( 26) dof 2 offset 20 0. 1.5 + ( 27) dof 2 offset 22 0.5 1.5 + ( 28) dof 2 offset 24 1. 1.5 + ( 29) dof 2 offset 26 1.5 1.5 + ( 30) dof 2 offset 28 2. 1.5 + ( 31) dof 2 offset 30 0. 2.25 + ( 32) dof 2 offset 32 0.5 2.25 + ( 33) dof 2 offset 34 1. 2.25 + ( 34) dof 2 offset 36 1.5 2.25 + ( 35) dof 2 offset 38 2. 2.25 + ( 36) dof 2 offset 40 0. 3. + ( 37) dof 2 offset 42 0.5 3. + ( 38) dof 2 offset 44 1. 3. + ( 39) dof 2 offset 46 1.5 3. + ( 40) dof 2 offset 48 2. 3. Labels: Label 'marker': [0]: 16 (4) diff --git a/tests/unitTests/finiteVolume/compressibleFlowEulerDiffusionTests.cpp b/tests/unitTests/finiteVolume/compressibleFlowEulerDiffusionTests.cpp index d032d1a91..7a944a9f2 100644 --- a/tests/unitTests/finiteVolume/compressibleFlowEulerDiffusionTests.cpp +++ b/tests/unitTests/finiteVolume/compressibleFlowEulerDiffusionTests.cpp @@ -179,7 +179,7 @@ TEST_P(CompressibleFlowEulerDiffusionTestFixture, ShouldConvergeToExactSolution) PetscInt nx1D = initialNx * PetscPowRealInt(2, l); PetscInt nx[] = {nx1D}; DMBoundaryType bcType[] = {DM_BOUNDARY_NONE}; - DMPlexCreateBoxMesh(PETSC_COMM_WORLD, parameters.dim, PETSC_FALSE, nx, start, end, bcType, PETSC_TRUE, &dmCreate) >> testErrorChecker; + DMPlexCreateBoxMesh(PETSC_COMM_WORLD, parameters.dim, PETSC_FALSE, nx, start, end, bcType, PETSC_TRUE, 0, PETSC_TRUE, &dmCreate) >> testErrorChecker; // define the fields based upon a compressible flow auto eos = std::make_shared( diff --git a/tests/unitTests/finiteVolume/compressibleFlowMmsSourceTests.cpp b/tests/unitTests/finiteVolume/compressibleFlowMmsSourceTests.cpp index 00e04b4c5..94ec5f61f 100644 --- a/tests/unitTests/finiteVolume/compressibleFlowMmsSourceTests.cpp +++ b/tests/unitTests/finiteVolume/compressibleFlowMmsSourceTests.cpp @@ -559,7 +559,7 @@ TEST_P(CompressibleFlowMmsTestFixture, ShouldComputeCorrectFlux) { PetscInt nx1D = initialNx * PetscPowRealInt(2, l); PetscInt nx[] = {nx1D, nx1D, nx1D}; DMBoundaryType bcType[] = {DM_BOUNDARY_NONE, DM_BOUNDARY_NONE, DM_BOUNDARY_NONE}; - DMPlexCreateBoxMesh(PETSC_COMM_WORLD, constants.dim, PETSC_FALSE, nx, start, end, bcType, PETSC_TRUE, &dmCreate) >> testErrorChecker; + DMPlexCreateBoxMesh(PETSC_COMM_WORLD, constants.dim, PETSC_FALSE, nx, start, end, bcType, PETSC_TRUE, 0, PETSC_TRUE, &dmCreate) >> testErrorChecker; // Setup the flow data auto eos = std::make_shared( diff --git a/tests/unitTests/finiteVolume/compressibleShockTubeTests.cpp b/tests/unitTests/finiteVolume/compressibleShockTubeTests.cpp index 3bcbbb1e8..316e78d72 100644 --- a/tests/unitTests/finiteVolume/compressibleShockTubeTests.cpp +++ b/tests/unitTests/finiteVolume/compressibleShockTubeTests.cpp @@ -146,7 +146,7 @@ TEST_P(CompressibleShockTubeTestFixture, ShouldReproduceExpectedResult) { PetscReal end[] = {testingParam.initialConditions.length}; PetscInt nx[] = {testingParam.nx}; DMBoundaryType bcType[] = {DM_BOUNDARY_NONE}; - DMPlexCreateBoxMesh(PETSC_COMM_WORLD, 1, PETSC_FALSE, nx, start, end, bcType, PETSC_TRUE, &dmCreate) >> testErrorChecker; + DMPlexCreateBoxMesh(PETSC_COMM_WORLD, 1, PETSC_FALSE, nx, start, end, bcType, PETSC_TRUE, 0, PETSC_TRUE, &dmCreate) >> testErrorChecker; auto eos = std::make_shared( std::make_shared(std::map{{"gamma", std::to_string(testingParam.initialConditions.gamma)}})); From ddd19bcb17f81bb75606dbdbdaaf94c03fcfa1a7 Mon Sep 17 00:00:00 2001 From: David Salac Date: Fri, 11 Oct 2024 17:01:32 -0400 Subject: [PATCH 4/9] Added no-ghost cell call --- src/solver/solver.cpp | 67 +++++++++++++++++++++++++++++++++++++++++-- src/solver/solver.hpp | 12 ++++++++ 2 files changed, 77 insertions(+), 2 deletions(-) diff --git a/src/solver/solver.cpp b/src/solver/solver.cpp index 6660559a1..fd6200fab 100644 --- a/src/solver/solver.cpp +++ b/src/solver/solver.cpp @@ -4,12 +4,13 @@ #include "utilities/petscUtilities.hpp" ablate::solver::Solver::Solver(std::string solverId, std::shared_ptr region, std::shared_ptr options) - : solverId(std::move(solverId)), region(std::move(region)), petscOptions(nullptr) { + : solverId(std::move(solverId)), region(std::move(region)), regionMinusGhost(std::make_shared(solverId + "_minusGhost")), petscOptions(nullptr) { // Set the options if (options) { PetscOptionsCreate(&petscOptions) >> utilities::PetscUtilities::checkError; options->Fill(petscOptions); } + } ablate::solver::Solver::~Solver() { @@ -18,7 +19,51 @@ ablate::solver::Solver::~Solver() { } } -void ablate::solver::Solver::Register(std::shared_ptr subDomainIn) { subDomain = std::move(subDomainIn); } +void ablate::solver::Solver::Register(std::shared_ptr subDomainIn) { + subDomain = std::move(subDomainIn); + + + // get the cell is for the solver minus ghost cell + // Get the original range + ablate::domain::Range cellRange; + GetCellRange(cellRange); + + // create a new label + auto dm = subDomain->GetDM(); + DMCreateLabel(dm, regionMinusGhost->GetName().c_str()) >> utilities::PetscUtilities::checkError; + DMLabel regionMinusGhostLabel; + PetscInt regionMinusGhostValue; + domain::Region::GetLabel(regionMinusGhost, dm, regionMinusGhostLabel, regionMinusGhostValue); + + // Get the ghost cell label + DMLabel ghostLabel; + DMGetLabel(dm, "ghost", &ghostLabel) >> utilities::PetscUtilities::checkError; + + // check if it is an exterior boundary cell ghost + PetscInt boundaryCellStart; + DMPlexGetCellTypeStratum(dm, DM_POLYTOPE_FV_GHOST, &boundaryCellStart, nullptr) >> utilities::PetscUtilities::checkError; + + // march over every cell + for (PetscInt c = cellRange.start; c < cellRange.end; ++c) { + PetscInt cell = cellRange.points ? cellRange.points[c] : c; + + // check if it is boundary ghost + PetscInt isGhost = -1; + if (ghostLabel) { + DMLabelGetValue(ghostLabel, cell, &isGhost) >> utilities::PetscUtilities::checkError; + } + + PetscInt owned; + DMPlexGetPointGlobal(dm, cell, &owned, nullptr) >> utilities::PetscUtilities::checkError; + if (owned >= 0 && isGhost < 0 && (boundaryCellStart < 0 || cell < boundaryCellStart)) { + DMLabelSetValue(regionMinusGhostLabel, cell, regionMinusGhostValue); + } + } + RestoreRange(cellRange); + + + +} void ablate::solver::Solver::PreStage(TS ts, PetscReal stagetime) { for (auto &function : preStageFunctions) { @@ -47,6 +92,24 @@ static PetscErrorCode zero(PetscInt dim, PetscReal time, const PetscReal x[], Pe return 0; } +void ablate::solver::Solver::GetCellRangeWithoutGhost(ablate::domain::Range& cellRange) const { + // Get the point range + DMLabel regionMinusGhostLabel; + PetscInt regionMinusGhostValue; + domain::Region::GetLabel(regionMinusGhost, GetSubDomain().GetDM(), regionMinusGhostLabel, regionMinusGhostValue); + + DMLabelGetStratumIS(regionMinusGhostLabel, regionMinusGhostValue, &cellRange.is) >> utilities::PetscUtilities::checkError; + if (cellRange.is == nullptr) { + // There are no points in this region, so skip + cellRange.start = 0; + cellRange.end = 0; + cellRange.points = nullptr; + } else { + // Get the range + ISGetPointRange(cellRange.is, &cellRange.start, &cellRange.end, &cellRange.points) >> utilities::PetscUtilities::checkError; + } +} + PetscErrorCode ablate::solver::Solver::DMPlexInsertBoundaryValues_Plex(DM dm, PetscDS prob, PetscBool insertEssential, Vec locX, PetscReal time, Vec faceGeomFVM, Vec cellGeomFVM, Vec gradFVM) { PetscObject isZero; PetscInt numBd, b; diff --git a/src/solver/solver.hpp b/src/solver/solver.hpp index 8a55297a7..a97b27e8e 100644 --- a/src/solver/solver.hpp +++ b/src/solver/solver.hpp @@ -28,6 +28,10 @@ class Solver { // The region of this solver. const std::shared_ptr region; + // The region excluding any FVM ghost cells at boundaries + const std::shared_ptr regionMinusGhost; + + protected: // an optional petscOptions that is used for this solver PetscOptions petscOptions; @@ -124,6 +128,14 @@ class Solver { */ void GetRange(PetscInt depth, ablate::domain::Range& range) const { this->subDomain->GetRange(this->GetRegion(), depth, range); } + /** + * Get the range of cells defined for this solver without any FVM ghost (boundary) cells + * @param depth + * @param range + */ + void GetCellRangeWithoutGhost(ablate::domain::Range& cellRange) const; + + /** * Restores the is and range - This needs to be removed and replaced with subDomain->RestoreRange * @param cellIS From 0ecd2860bfbc1b66cd7af87ad94a5ef9e850b9b8 Mon Sep 17 00:00:00 2001 From: David Salac Date: Mon, 14 Oct 2024 11:14:49 -0400 Subject: [PATCH 5/9] Moving no ghost over --- src/domain/domain.cpp | 9 +++++++++ src/domain/meshGenerator.cpp | 14 ++++++++++++++ src/finiteVolume/finiteVolumeSolver.cpp | 2 +- src/finiteVolume/finiteVolumeSolver.hpp | 2 +- src/solver/solver.cpp | 6 +++--- src/solver/solver.hpp | 4 ++++ 6 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/domain/domain.cpp b/src/domain/domain.cpp index ff5dca434..e4a9d2243 100644 --- a/src/domain/domain.cpp +++ b/src/domain/domain.cpp @@ -160,6 +160,15 @@ void ablate::domain::Domain::InitializeSubDomains(const std::vectorCreateSubDomainStructures(); } + // Setup the label to extract cell ranges without FVM ghosts. + // This needs to be done after CreateSubDomainStructures so that the local section has been created + for (auto& solver : solvers) { + solver->SetupCellRangeWithoutGhost(); + } + + + + // set all values to nan to allow for a output check if (initializations) { VecSet(solGlobalField, NAN) >> utilities::PetscUtilities::checkError; diff --git a/src/domain/meshGenerator.cpp b/src/domain/meshGenerator.cpp index de521b5a9..8d5bfbdc8 100644 --- a/src/domain/meshGenerator.cpp +++ b/src/domain/meshGenerator.cpp @@ -29,6 +29,20 @@ void ablate::domain::MeshGenerator::ReplaceDm(DM& originalDm, DM& replaceDm) { PetscObjectSetOptions((PetscObject)replaceDm, options) >> utilities::PetscUtilities::checkError; ((DM_Plex*)(replaceDm)->data)->useHashLocation = ((DM_Plex*)originalDm->data)->useHashLocation; + // Fix the periodic localization here until it's fixed in PETSc + DM cdm; + PetscInt localizationHeight; + PetscBool sparseLocalize; + DMGetCoordinateDM(originalDm, &cdm) >> utilities::PetscUtilities::checkError; + DMPlexGetMaxProjectionHeight(cdm, &localizationHeight) >> utilities::PetscUtilities::checkError; + DMGetSparseLocalize(cdm, &sparseLocalize) >> utilities::PetscUtilities::checkError; + + DMGetCoordinateDM(replaceDm, &cdm) >> utilities::PetscUtilities::checkError; + DMPlexSetMaxProjectionHeight(cdm, localizationHeight) >> utilities::PetscUtilities::checkError; + DMSetSparseLocalize(cdm, sparseLocalize) >> utilities::PetscUtilities::checkError; + DMLocalizeCoordinates(replaceDm) >> utilities::PetscUtilities::checkError; + + DMDestroy(&originalDm) >> utilities::PetscUtilities::checkError; originalDm = replaceDm; } diff --git a/src/finiteVolume/finiteVolumeSolver.cpp b/src/finiteVolume/finiteVolumeSolver.cpp index 80d7d74e4..0d0eb7e6d 100644 --- a/src/finiteVolume/finiteVolumeSolver.cpp +++ b/src/finiteVolume/finiteVolumeSolver.cpp @@ -436,7 +436,7 @@ PetscErrorCode ablate::finiteVolume::FiniteVolumeSolver::Restore(PetscViewer vie PetscFunctionReturn(0); } -void ablate::finiteVolume::FiniteVolumeSolver::GetCellRangeWithoutGhost(ablate::domain::Range& faceRange) const { +void ablate::finiteVolume::FiniteVolumeSolver::GetCellRangeWithoutGhostOld(ablate::domain::Range& faceRange) const { // Get the point range DMLabel solverRegionMinusGhostLabel; PetscInt solverRegionMinusGhostValue; diff --git a/src/finiteVolume/finiteVolumeSolver.hpp b/src/finiteVolume/finiteVolumeSolver.hpp index bfa46ab3d..5bcf79ee9 100644 --- a/src/finiteVolume/finiteVolumeSolver.hpp +++ b/src/finiteVolume/finiteVolumeSolver.hpp @@ -212,7 +212,7 @@ class FiniteVolumeSolver : public solver::CellSolver, * @param pEnd * @param points */ - void GetCellRangeWithoutGhost(ablate::domain::Range& faceRange) const; + void GetCellRangeWithoutGhostOld(ablate::domain::Range& faceRange) const; /** * Returns first instance of process of type specifed diff --git a/src/solver/solver.cpp b/src/solver/solver.cpp index fd6200fab..800fbd0f5 100644 --- a/src/solver/solver.cpp +++ b/src/solver/solver.cpp @@ -22,8 +22,10 @@ ablate::solver::Solver::~Solver() { void ablate::solver::Solver::Register(std::shared_ptr subDomainIn) { subDomain = std::move(subDomainIn); +} + +void ablate::solver::Solver::SetupCellRangeWithoutGhost() { - // get the cell is for the solver minus ghost cell // Get the original range ablate::domain::Range cellRange; GetCellRange(cellRange); @@ -61,8 +63,6 @@ void ablate::solver::Solver::Register(std::shared_ptr } RestoreRange(cellRange); - - } void ablate::solver::Solver::PreStage(TS ts, PetscReal stagetime) { diff --git a/src/solver/solver.hpp b/src/solver/solver.hpp index a97b27e8e..dee6888df 100644 --- a/src/solver/solver.hpp +++ b/src/solver/solver.hpp @@ -58,6 +58,10 @@ class Solver { /*** Set up mesh dependent initialization, this may be called multiple times if the mesh changes **/ virtual void Initialize() = 0; + /** Label all ghost cells so that the range can be returned without them. **/ + void SetupCellRangeWithoutGhost(); + + /** string id for this solver **/ [[nodiscard]] inline const std::string& GetSolverId() const { return solverId; } From 476b0818d959aa6d706981c512e1159400bcf1a7 Mon Sep 17 00:00:00 2001 From: David Salac Date: Mon, 14 Oct 2024 11:33:42 -0400 Subject: [PATCH 6/9] Removed function Removed the cell range w/o ghost call from the FV solver --- src/finiteVolume/finiteVolumeSolver.cpp | 18 ------------------ src/finiteVolume/finiteVolumeSolver.hpp | 9 --------- 2 files changed, 27 deletions(-) diff --git a/src/finiteVolume/finiteVolumeSolver.cpp b/src/finiteVolume/finiteVolumeSolver.cpp index 0d0eb7e6d..9f8d03e0d 100644 --- a/src/finiteVolume/finiteVolumeSolver.cpp +++ b/src/finiteVolume/finiteVolumeSolver.cpp @@ -436,24 +436,6 @@ PetscErrorCode ablate::finiteVolume::FiniteVolumeSolver::Restore(PetscViewer vie PetscFunctionReturn(0); } -void ablate::finiteVolume::FiniteVolumeSolver::GetCellRangeWithoutGhostOld(ablate::domain::Range& faceRange) const { - // Get the point range - DMLabel solverRegionMinusGhostLabel; - PetscInt solverRegionMinusGhostValue; - domain::Region::GetLabel(solverRegionMinusGhost, GetSubDomain().GetDM(), solverRegionMinusGhostLabel, solverRegionMinusGhostValue); - - DMLabelGetStratumIS(solverRegionMinusGhostLabel, solverRegionMinusGhostValue, &faceRange.is) >> utilities::PetscUtilities::checkError; - if (faceRange.is == nullptr) { - // There are no points in this region, so skip - faceRange.start = 0; - faceRange.end = 0; - faceRange.points = nullptr; - } else { - // Get the range - ISGetPointRange(faceRange.is, &faceRange.start, &faceRange.end, &faceRange.points) >> utilities::PetscUtilities::checkError; - } -} - PetscErrorCode ablate::finiteVolume::FiniteVolumeSolver::ComputeBoundary(PetscReal time, Vec locX, Vec locX_t) { PetscFunctionBeginUser; auto dm = subDomain->GetDM(); diff --git a/src/finiteVolume/finiteVolumeSolver.hpp b/src/finiteVolume/finiteVolumeSolver.hpp index 5bcf79ee9..0c49cd824 100644 --- a/src/finiteVolume/finiteVolumeSolver.hpp +++ b/src/finiteVolume/finiteVolumeSolver.hpp @@ -205,15 +205,6 @@ class FiniteVolumeSolver : public solver::CellSolver, */ PetscErrorCode Restore(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override; - /** - * Get the cellIS and range over valid cells in this region without ghost cells (boundary or mpi) - * @param cellIS - * @param pStart - * @param pEnd - * @param points - */ - void GetCellRangeWithoutGhostOld(ablate::domain::Range& faceRange) const; - /** * Returns first instance of process of type specifed * @tparam T From 3fc7b4dc8ea80a15aa27582677aa34ea26667034 Mon Sep 17 00:00:00 2001 From: David Salac Date: Mon, 14 Oct 2024 14:03:46 -0400 Subject: [PATCH 7/9] Format fixes and version bump --- CMakeLists.txt | 2 +- src/domain/domain.cpp | 5 +-- src/domain/meshGenerator.cpp | 1 - src/solver/solver.cpp | 80 +++++++++++++++++------------------- src/solver/solver.hpp | 3 -- 5 files changed, 39 insertions(+), 52 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 06536d057..de92e4a9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.18.4) include(config/petscCompilers.cmake) # Set the project details -project(ablateLibrary VERSION 0.12.34) +project(ablateLibrary VERSION 0.12.35) # Load the Required 3rd Party Libaries pkg_check_modules(PETSc REQUIRED IMPORTED_TARGET GLOBAL PETSc) diff --git a/src/domain/domain.cpp b/src/domain/domain.cpp index e4a9d2243..a03a25c81 100644 --- a/src/domain/domain.cpp +++ b/src/domain/domain.cpp @@ -163,12 +163,9 @@ void ablate::domain::Domain::InitializeSubDomains(const std::vectorSetupCellRangeWithoutGhost(); + solver->SetupCellRangeWithoutGhost(); } - - - // set all values to nan to allow for a output check if (initializations) { VecSet(solGlobalField, NAN) >> utilities::PetscUtilities::checkError; diff --git a/src/domain/meshGenerator.cpp b/src/domain/meshGenerator.cpp index 8d5bfbdc8..5ff40af5f 100644 --- a/src/domain/meshGenerator.cpp +++ b/src/domain/meshGenerator.cpp @@ -42,7 +42,6 @@ void ablate::domain::MeshGenerator::ReplaceDm(DM& originalDm, DM& replaceDm) { DMSetSparseLocalize(cdm, sparseLocalize) >> utilities::PetscUtilities::checkError; DMLocalizeCoordinates(replaceDm) >> utilities::PetscUtilities::checkError; - DMDestroy(&originalDm) >> utilities::PetscUtilities::checkError; originalDm = replaceDm; } diff --git a/src/solver/solver.cpp b/src/solver/solver.cpp index 800fbd0f5..1d010891e 100644 --- a/src/solver/solver.cpp +++ b/src/solver/solver.cpp @@ -10,7 +10,6 @@ ablate::solver::Solver::Solver(std::string solverId, std::shared_ptr> utilities::PetscUtilities::checkError; options->Fill(petscOptions); } - } ablate::solver::Solver::~Solver() { @@ -19,50 +18,45 @@ ablate::solver::Solver::~Solver() { } } -void ablate::solver::Solver::Register(std::shared_ptr subDomainIn) { - subDomain = std::move(subDomainIn); - -} +void ablate::solver::Solver::Register(std::shared_ptr subDomainIn) { subDomain = std::move(subDomainIn); } void ablate::solver::Solver::SetupCellRangeWithoutGhost() { + // Get the original range + ablate::domain::Range cellRange; + GetCellRange(cellRange); - // Get the original range - ablate::domain::Range cellRange; - GetCellRange(cellRange); - - // create a new label - auto dm = subDomain->GetDM(); - DMCreateLabel(dm, regionMinusGhost->GetName().c_str()) >> utilities::PetscUtilities::checkError; - DMLabel regionMinusGhostLabel; - PetscInt regionMinusGhostValue; - domain::Region::GetLabel(regionMinusGhost, dm, regionMinusGhostLabel, regionMinusGhostValue); - - // Get the ghost cell label - DMLabel ghostLabel; - DMGetLabel(dm, "ghost", &ghostLabel) >> utilities::PetscUtilities::checkError; - - // check if it is an exterior boundary cell ghost - PetscInt boundaryCellStart; - DMPlexGetCellTypeStratum(dm, DM_POLYTOPE_FV_GHOST, &boundaryCellStart, nullptr) >> utilities::PetscUtilities::checkError; - - // march over every cell - for (PetscInt c = cellRange.start; c < cellRange.end; ++c) { - PetscInt cell = cellRange.points ? cellRange.points[c] : c; - - // check if it is boundary ghost - PetscInt isGhost = -1; - if (ghostLabel) { - DMLabelGetValue(ghostLabel, cell, &isGhost) >> utilities::PetscUtilities::checkError; - } - - PetscInt owned; - DMPlexGetPointGlobal(dm, cell, &owned, nullptr) >> utilities::PetscUtilities::checkError; - if (owned >= 0 && isGhost < 0 && (boundaryCellStart < 0 || cell < boundaryCellStart)) { - DMLabelSetValue(regionMinusGhostLabel, cell, regionMinusGhostValue); - } - } - RestoreRange(cellRange); - + // create a new label + auto dm = subDomain->GetDM(); + DMCreateLabel(dm, regionMinusGhost->GetName().c_str()) >> utilities::PetscUtilities::checkError; + DMLabel regionMinusGhostLabel; + PetscInt regionMinusGhostValue; + domain::Region::GetLabel(regionMinusGhost, dm, regionMinusGhostLabel, regionMinusGhostValue); + + // Get the ghost cell label + DMLabel ghostLabel; + DMGetLabel(dm, "ghost", &ghostLabel) >> utilities::PetscUtilities::checkError; + + // check if it is an exterior boundary cell ghost + PetscInt boundaryCellStart; + DMPlexGetCellTypeStratum(dm, DM_POLYTOPE_FV_GHOST, &boundaryCellStart, nullptr) >> utilities::PetscUtilities::checkError; + + // march over every cell + for (PetscInt c = cellRange.start; c < cellRange.end; ++c) { + PetscInt cell = cellRange.points ? cellRange.points[c] : c; + + // check if it is boundary ghost + PetscInt isGhost = -1; + if (ghostLabel) { + DMLabelGetValue(ghostLabel, cell, &isGhost) >> utilities::PetscUtilities::checkError; + } + + PetscInt owned; + DMPlexGetPointGlobal(dm, cell, &owned, nullptr) >> utilities::PetscUtilities::checkError; + if (owned >= 0 && isGhost < 0 && (boundaryCellStart < 0 || cell < boundaryCellStart)) { + DMLabelSetValue(regionMinusGhostLabel, cell, regionMinusGhostValue); + } + } + RestoreRange(cellRange); } void ablate::solver::Solver::PreStage(TS ts, PetscReal stagetime) { @@ -92,7 +86,7 @@ static PetscErrorCode zero(PetscInt dim, PetscReal time, const PetscReal x[], Pe return 0; } -void ablate::solver::Solver::GetCellRangeWithoutGhost(ablate::domain::Range& cellRange) const { +void ablate::solver::Solver::GetCellRangeWithoutGhost(ablate::domain::Range &cellRange) const { // Get the point range DMLabel regionMinusGhostLabel; PetscInt regionMinusGhostValue; diff --git a/src/solver/solver.hpp b/src/solver/solver.hpp index dee6888df..ae580a209 100644 --- a/src/solver/solver.hpp +++ b/src/solver/solver.hpp @@ -31,7 +31,6 @@ class Solver { // The region excluding any FVM ghost cells at boundaries const std::shared_ptr regionMinusGhost; - protected: // an optional petscOptions that is used for this solver PetscOptions petscOptions; @@ -61,7 +60,6 @@ class Solver { /** Label all ghost cells so that the range can be returned without them. **/ void SetupCellRangeWithoutGhost(); - /** string id for this solver **/ [[nodiscard]] inline const std::string& GetSolverId() const { return solverId; } @@ -139,7 +137,6 @@ class Solver { */ void GetCellRangeWithoutGhost(ablate::domain::Range& cellRange) const; - /** * Restores the is and range - This needs to be removed and replaced with subDomain->RestoreRange * @param cellIS From 6782553f2c5812d057d4d32a6c2d29441053c4a4 Mon Sep 17 00:00:00 2001 From: David Salac Date: Mon, 14 Oct 2024 14:55:39 -0400 Subject: [PATCH 8/9] Casting to PetscInt --- src/domain/boxMesh.cpp | 2 +- src/domain/boxMeshBoundaryCells.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/domain/boxMesh.cpp b/src/domain/boxMesh.cpp index ca59e17c7..914b7e32c 100644 --- a/src/domain/boxMesh.cpp +++ b/src/domain/boxMesh.cpp @@ -36,7 +36,7 @@ DM ablate::domain::BoxMesh::CreateBoxDM(const std::string& name, std::vector facesPetsc(faces.begin(), faces.end()); DM dm; - DMPlexCreateBoxMesh(PETSC_COMM_WORLD, (PetscInt)dimensions, simplex ? PETSC_TRUE : PETSC_FALSE, &facesPetsc[0], &lower[0], &upper[0], &boundaryTypes[0], PETSC_TRUE, dimensions, PETSC_TRUE, &dm) >> + DMPlexCreateBoxMesh(PETSC_COMM_WORLD, (PetscInt)dimensions, simplex ? PETSC_TRUE : PETSC_FALSE, &facesPetsc[0], &lower[0], &upper[0], &boundaryTypes[0], PETSC_TRUE, (PetscInt)dimensions, PETSC_TRUE, &dm) >> utilities::PetscUtilities::checkError; PetscObjectSetName((PetscObject)dm, name.c_str()) >> utilities::PetscUtilities::checkError; return dm; diff --git a/src/domain/boxMeshBoundaryCells.cpp b/src/domain/boxMeshBoundaryCells.cpp index 331fe681d..a51e5f0aa 100644 --- a/src/domain/boxMeshBoundaryCells.cpp +++ b/src/domain/boxMeshBoundaryCells.cpp @@ -66,7 +66,7 @@ DM ablate::domain::BoxMeshBoundaryCells::CreateBoxDM(const std::string& name, st // Make copy with PetscInt std::vector facesPetsc(faces.begin(), faces.end()); DM dm; - DMPlexCreateBoxMesh(PETSC_COMM_WORLD, (PetscInt)dimensions, simplex ? PETSC_TRUE : PETSC_FALSE, &facesPetsc[0], &lower[0], &upper[0], nullptr, PETSC_TRUE, dimensions, PETSC_TRUE, &dm) >> + DMPlexCreateBoxMesh(PETSC_COMM_WORLD, (PetscInt)dimensions, simplex ? PETSC_TRUE : PETSC_FALSE, &facesPetsc[0], &lower[0], &upper[0], nullptr, PETSC_TRUE, (PetscInt)dimensions, PETSC_TRUE, &dm) >> utilities::PetscUtilities::checkError; PetscObjectSetName((PetscObject)dm, name.c_str()) >> utilities::PetscUtilities::checkError; return dm; From be51f88e66d182b0f525c450217b34de343c654d Mon Sep 17 00:00:00 2001 From: David Salac Date: Mon, 14 Oct 2024 15:04:13 -0400 Subject: [PATCH 9/9] Updated formatting --- src/domain/boxMesh.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/domain/boxMesh.cpp b/src/domain/boxMesh.cpp index 914b7e32c..071bd6230 100644 --- a/src/domain/boxMesh.cpp +++ b/src/domain/boxMesh.cpp @@ -36,7 +36,8 @@ DM ablate::domain::BoxMesh::CreateBoxDM(const std::string& name, std::vector facesPetsc(faces.begin(), faces.end()); DM dm; - DMPlexCreateBoxMesh(PETSC_COMM_WORLD, (PetscInt)dimensions, simplex ? PETSC_TRUE : PETSC_FALSE, &facesPetsc[0], &lower[0], &upper[0], &boundaryTypes[0], PETSC_TRUE, (PetscInt)dimensions, PETSC_TRUE, &dm) >> + DMPlexCreateBoxMesh( + PETSC_COMM_WORLD, (PetscInt)dimensions, simplex ? PETSC_TRUE : PETSC_FALSE, &facesPetsc[0], &lower[0], &upper[0], &boundaryTypes[0], PETSC_TRUE, (PetscInt)dimensions, PETSC_TRUE, &dm) >> utilities::PetscUtilities::checkError; PetscObjectSetName((PetscObject)dm, name.c_str()) >> utilities::PetscUtilities::checkError; return dm;