From db04e91eca35d3b7c758fb4f510c6f37d0c122bb Mon Sep 17 00:00:00 2001 From: Ann Almgren Date: Thu, 26 Sep 2024 20:49:39 -0700 Subject: [PATCH 1/6] fix for the last commit --- src/incflo.H | 42 +++++++++++++++++++++++++----------------- src/incflo.cpp | 15 +++++++++++++++ src/setup/init.cpp | 7 ++++--- 3 files changed, 44 insertions(+), 20 deletions(-) diff --git a/src/incflo.H b/src/incflo.H index 35ad66d1..c8b34a27 100644 --- a/src/incflo.H +++ b/src/incflo.H @@ -263,23 +263,31 @@ public: // /////////////////////////////////////////////////////////////////////////// - void ApplyProjection( amrex::Vector const& density, - AMREX_D_DECL(amrex::Vector const& u_mac, - amrex::Vector const& v_mac, - amrex::Vector const& w_mac), - amrex::Real time, amrex::Real scaling_factor, bool incremental); - void ApplyNodalProjection(amrex::Vector density, - amrex::Real time, amrex::Real scaling_factor, bool incremental); - void ApplyNodalProjection(amrex::Vector const& density, - amrex::Vector vel, - amrex::Vector const& divu_Source, - amrex::Real time, amrex::Real scaling_factor, bool incremental, - bool set_inflow_bc); - void ApplyCCProjection(amrex::Vector density, - AMREX_D_DECL(amrex::Vector const& u_mac, - amrex::Vector const& v_mac, - amrex::Vector const& w_mac), - amrex::Real time, amrex::Real scaling_factor, bool incremental); + void ApplyProjection ( amrex::Vector const& density, + AMREX_D_DECL(amrex::Vector const& u_mac, + amrex::Vector const& v_mac, + amrex::Vector const& w_mac), + amrex::Real time, amrex::Real scaling_factor, bool incremental); + + void ApplyProjection (amrex::Vector const& density, + amrex::Vector vel, + amrex::Vector const& divu_Source, + amrex::Real time, amrex::Real scaling_factor, bool incremental, + bool set_inflow_bc); + + void ApplyNodalProjection (amrex::Vector density, + amrex::Real time, amrex::Real scaling_factor, bool incremental); + void ApplyNodalProjection (amrex::Vector const& density, + amrex::Vector vel, + amrex::Vector const& divu_Source, + amrex::Real time, amrex::Real scaling_factor, bool incremental, + bool set_inflow_bc); + + void ApplyCCProjection (amrex::Vector density, + AMREX_D_DECL(amrex::Vector const& u_mac, + amrex::Vector const& v_mac, + amrex::Vector const& w_mac), + amrex::Real time, amrex::Real scaling_factor, bool incremental); /////////////////////////////////////////////////////////////////////////// // diff --git a/src/incflo.cpp b/src/incflo.cpp index fd8a42b0..9e1cee8d 100644 --- a/src/incflo.cpp +++ b/src/incflo.cpp @@ -209,7 +209,22 @@ incflo::ApplyProjection (Vector const& density, time,scaling_factor,incremental); } else + { ApplyNodalProjection(density,time,scaling_factor,incremental); + } +} + +void +incflo::ApplyProjection (Vector const& density, + Vector vel, + Vector const& divu_Source, + Real time, Real scaling_factor, bool incremental, + bool set_inflow_bc) +{ + AMREX_ALWAYS_ASSERT("This is not yet coded for ccproj!"); + + ApplyNodalProjection(density, vel, divu_Source, time, scaling_factor, + incremental, set_inflow_bc); } // Make a new level from scratch using provided BoxArray and DistributionMapping. diff --git a/src/setup/init.cpp b/src/setup/init.cpp index 6878c847..bdec12bb 100644 --- a/src/setup/init.cpp +++ b/src/setup/init.cpp @@ -466,9 +466,10 @@ void incflo::InitialPressureProjection() // Always zero this here Vector Source(finest_level+1, nullptr); - ApplyProjection(get_density_new_const(), - AMREX_D_DECL(GetVecOfPtrs(u_mac_tmp), GetVecOfPtrs(v_mac_tmp), - GetVecOfPtrs(w_mac_tmp)),m_cur_time,dummy_dt,false); + // FIXME FIXME FIXME - THIS ONLY WORKS RIGHT FOR NODAL PROJ + ApplyProjection(get_density_new_const(), GetVecOfPtrs(vel), Source, + m_cur_time, dummy_dt, false /*incremental*/, + true /*set_inflow_bc*/); } #ifdef AMREX_USE_EB From 433b3300da06a1b5faac846d31936b4e7a84ea12 Mon Sep 17 00:00:00 2001 From: Ann Almgren Date: Fri, 27 Sep 2024 06:27:05 -0700 Subject: [PATCH 2/6] add use_cc_proj to docs --- Docs/sphinx_documentation/source/InputsAlgorithm.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Docs/sphinx_documentation/source/InputsAlgorithm.rst b/Docs/sphinx_documentation/source/InputsAlgorithm.rst index f3713113..ae3ba821 100644 --- a/Docs/sphinx_documentation/source/InputsAlgorithm.rst +++ b/Docs/sphinx_documentation/source/InputsAlgorithm.rst @@ -28,6 +28,9 @@ The following inputs must be preceded by "incflo." +----------------------+-----------------------------------------------------------------------+-------------+--------------+ | mu_s | scalar diffusivity | Real(s) | 0.0 | +----------------------+-----------------------------------------------------------------------+-------------+--------------+ +| use_cc_proj | Use cell-centered rather than nodal pressure; this changes the | bool | false | +| | which approximate projection we use | | | ++----------------------+-----------------------------------------------------------------------+-------------+--------------+ | use_tensor_solve | In velocity solve, use multicomponent :math:`\nabla \cdot \tau` | bool | true | | | otherwise use separate solves for each velocity component | | | +----------------------+-----------------------------------------------------------------------+-------------+--------------+ From 440400e8131fc1beb5f3be4c9c351c011cc6142f Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Fri, 27 Sep 2024 09:04:21 -0700 Subject: [PATCH 3/6] Fix pip3 --- .github/workflows/codespell.yml | 2 +- .github/workflows/docs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index bec24c5c..b7ef457d 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -17,7 +17,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y --no-install-recommends python3-pip - pip3 install --user codespell + pip3 install --break-system-packages --user codespell - name: Run codespell run: codespell diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9151622c..72271151 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,7 +16,7 @@ jobs: run: | .github/workflows/dependencies/documentation.sh echo "Installing python packages for docs..." - pip3 install sphinx sphinx_rtd_theme breathe + pip3 install --break-system-packages sphinx sphinx_rtd_theme breathe - name: Install and Build run: | From 3b2e995d4c1eac97795bd407e85b4eaf39324ba1 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Fri, 27 Sep 2024 12:20:24 -0700 Subject: [PATCH 4/6] Fix warning --- src/incflo.H | 2 +- src/incflo.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/incflo.H b/src/incflo.H index c8b34a27..6e3c5477 100644 --- a/src/incflo.H +++ b/src/incflo.H @@ -270,7 +270,7 @@ public: amrex::Real time, amrex::Real scaling_factor, bool incremental); void ApplyProjection (amrex::Vector const& density, - amrex::Vector vel, + amrex::Vector const& vel, amrex::Vector const& divu_Source, amrex::Real time, amrex::Real scaling_factor, bool incremental, bool set_inflow_bc); diff --git a/src/incflo.cpp b/src/incflo.cpp index 9e1cee8d..d9beef8b 100644 --- a/src/incflo.cpp +++ b/src/incflo.cpp @@ -216,7 +216,7 @@ incflo::ApplyProjection (Vector const& density, void incflo::ApplyProjection (Vector const& density, - Vector vel, + Vector const& vel, Vector const& divu_Source, Real time, Real scaling_factor, bool incremental, bool set_inflow_bc) From 4477245e07c776f4b304c4260d4c5e41b856180b Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Fri, 27 Sep 2024 12:25:03 -0700 Subject: [PATCH 5/6] Revert "Fix pip3" This reverts commit 440400e8131fc1beb5f3be4c9c351c011cc6142f. --- .github/workflows/codespell.yml | 2 +- .github/workflows/docs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index b7ef457d..bec24c5c 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -17,7 +17,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y --no-install-recommends python3-pip - pip3 install --break-system-packages --user codespell + pip3 install --user codespell - name: Run codespell run: codespell diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 72271151..9151622c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,7 +16,7 @@ jobs: run: | .github/workflows/dependencies/documentation.sh echo "Installing python packages for docs..." - pip3 install --break-system-packages sphinx sphinx_rtd_theme breathe + pip3 install sphinx sphinx_rtd_theme breathe - name: Install and Build run: | From 7c23759e9423dfc80d3b9eea6950ad78644b37d0 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Fri, 27 Sep 2024 12:26:02 -0700 Subject: [PATCH 6/6] Use ubuntu-22.04 --- .github/workflows/codespell.yml | 3 +-- .github/workflows/docs.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index bec24c5c..faaa2ebc 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -8,8 +8,7 @@ concurrency: jobs: codespell: - runs-on: ubuntu-latest - + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9151622c..0ab04eb6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,7 +7,7 @@ concurrency: jobs: build-and-deploy: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4