Skip to content

Commit

Permalink
benchmark compile
Browse files Browse the repository at this point in the history
  • Loading branch information
HenningScheufler committed Jul 15, 2024
1 parent 645d3b3 commit d6fcb17
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 19 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_subdirectory(NeoFOAM)
add_subdirectory(src)
add_subdirectory(test)
add_subdirectory(benchmarks)
2 changes: 1 addition & 1 deletion benchmarkSuite/scalarAdvection/scalarAdvection/Allrun
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mesh=$2

runApplication blockMesh

runApplication ../../../build/src/benchmarks/scalarAdvection/scalarAdvection
runApplication ../../../build/ReleaseCudaAll/bin/scalarAdvection


#------------------------------------------------------------------------------
6 changes: 3 additions & 3 deletions benchmarks/gradOperator/gradOperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#include "Kokkos_Core.hpp"

#include "NeoFOAM/core/executor/executor.hpp"
#include "NeoFOAM/fields/FieldTypeDefs.hpp"
#include "NeoFOAM/mesh/unstructuredMesh/unstructuredMesh.hpp"
#include "NeoFOAM/cellCentredFiniteVolume/grad/gaussGreenGrad.hpp"
#include "NeoFOAM/fields/field.hpp"
#include "NeoFOAM/mesh/unstructured.hpp"
#include "NeoFOAM/finiteVolume/operators/gaussGreenGrad.hpp"

#include "FoamAdapter/readers/foamMesh.hpp"
#include "FoamAdapter/writers/writers.hpp"
Expand Down
10 changes: 5 additions & 5 deletions benchmarks/scalarAdvection/NeoFoamScalarAdvection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// SPDX-FileCopyrightText: 2023 NeoFOAM authors

#include "NeoFOAM/core/executor/executor.hpp"
#include "NeoFOAM/fields/FieldTypeDefs.hpp"
#include "NeoFOAM/mesh/unstructuredMesh/unstructuredMesh.hpp"
#include "NeoFOAM/cellCentredFiniteVolume/grad/gaussGreenGrad.hpp"
#include "NeoFOAM/cellCentredFiniteVolume/div/gaussGreenDiv.hpp"
#include "NeoFOAM/finiteVolume/interpolation/surfaceInterpolationSelector.hpp"
#include "NeoFOAM/fields/field.hpp"
#include "NeoFOAM/mesh/unstructured.hpp"
#include "NeoFOAM/finiteVolume/operators/gaussGreenDiv.hpp"
#include "NeoFOAM/finiteVolume/operators/gaussGreenGrad.hpp"
#include "NeoFOAM/finiteVolume/interpolation/surfaceInterpolation.hpp"

#define namespaceFoam // Suppress <using namespace Foam;>
#include "fvCFD.H"
Expand Down
25 changes: 15 additions & 10 deletions benchmarks/scalarAdvection/scalarAdvection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// SPDX-FileCopyrightText: 2023 NeoFOAM authors

#include "NeoFOAM/core/executor/executor.hpp"
#include "NeoFOAM/fields/FieldTypeDefs.hpp"
#include "NeoFOAM/mesh/unstructuredMesh/unstructuredMesh.hpp"
#include "NeoFOAM/cellCentredFiniteVolume/grad/gaussGreenGrad.hpp"
#include "NeoFOAM/cellCentredFiniteVolume/div/gaussGreenDiv.hpp"
#include "NeoFOAM/finiteVolume/interpolation/surfaceInterpolationSelector.hpp"
#include "NeoFOAM/fields/field.hpp"
#include "NeoFOAM/mesh/unstructured.hpp"
#include "NeoFOAM/finiteVolume/operators/gaussGreenDiv.hpp"
#include "NeoFOAM/finiteVolume/operators/gaussGreenGrad.hpp"
#include "NeoFOAM/finiteVolume/interpolation/surfaceInterpolation.hpp"

#define namespaceFoam // Suppress <using namespace Foam;>
#include "fvCFD.H"
Expand All @@ -18,6 +18,7 @@
#include "FoamAdapter/setup/setup.hpp"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace fvcc = NeoFOAM::finiteVolume::cellCentred;

int main(int argc, char* argv[])
{
Expand Down Expand Up @@ -64,7 +65,7 @@ int main(int argc, char* argv[])
// std::pow((s_cc[celli][1] - 0.75) / spread, 2.0)));
// });
// neoT.correctBoundaryConditions();
NeoFOAM::fvccSurfaceField<NeoFOAM::scalar> neoPhi = constructSurfaceField(exec, uMesh, phi);
fvcc::SurfaceField<NeoFOAM::scalar> neoPhi = constructSurfaceField(exec, uMesh, phi);

Foam::Info << "writing neoT field" << Foam::endl;
write(neoT.internalField(), mesh, "neoT");
Expand Down Expand Up @@ -95,8 +96,7 @@ int main(int argc, char* argv[])
}
}
phi0 = Foam::linearInterpolate(U0) & mesh.Sf();
NeoFOAM::fvccSurfaceField<NeoFOAM::scalar> neoPhi0 =
constructSurfaceField(exec, uMesh, phi0);
fvcc::SurfaceField<NeoFOAM::scalar> neoPhi0 = constructSurfaceField(exec, uMesh, phi0);

Foam::volScalarField ofDivT("ofDivT", Foam::fvc::div(phi, T));

Expand Down Expand Up @@ -144,10 +144,15 @@ int main(int argc, char* argv[])
addProfiling(neoFoamAdvection, "neoFoamAdvection");
NeoFOAM::fill(neoDivT.internalField(), 0.0);
NeoFOAM::fill(neoDivT.boundaryField().value(), 0.0);
NeoFOAM::gaussGreenDiv(

NeoFOAM::GaussGreenDiv(
exec,
uMesh,
NeoFOAM::surfaceInterpolationSelector(std::string("upwind"), exec, mesh.uMesh())
NeoFOAM::SurfaceInterpolation(
exec,
uMesh,
NeoFOAM::SurfaceInterpolationFactory::create("upwind", exec, uMesh)
)
)
.div(neoDivT, neoPhi, neoT);
neoT.internalField() =
Expand Down

0 comments on commit d6fcb17

Please sign in to comment.