Skip to content

Commit

Permalink
update NeoFOAM, run format
Browse files Browse the repository at this point in the history
  • Loading branch information
greole committed Dec 6, 2024
1 parent f57e7b4 commit a448f31
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FoamAdapter has the following requirements
* _cmake 3.22+_
* _gcc >= 12_ or _clang >= 18+_
* OpenFOAM _2406_
* CUDA _12.1_ (for GPU support)
* CUDA _12.1_ (for GPU support)

## Compilation

Expand Down
4 changes: 3 additions & 1 deletion include/FoamAdapter/readers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ auto constructSurfaceField(
using type_primitive_t = typename type_map<FoamType>::mapped_type;
using foam_primitive_t = typename FoamType::cmptType;

type_container_t out(exec, in.name(), nfMesh, std::move(readSurfaceBoundaryConditions(nfMesh, in)));
type_container_t out(
exec, in.name(), nfMesh, std::move(readSurfaceBoundaryConditions(nfMesh, in))
);

Field<foam_primitive_t> flattenedField(out.internalField().size());
size_t nInternal = nfMesh.nInternalFaces();
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ add_library(FoamAdapter SHARED)

target_link_libraries(FoamAdapter PUBLIC FoamAdapter_public_api OpenFOAM NeoFOAM)

target_sources(FoamAdapter PRIVATE "conversion/convert.cpp" "setup.cpp" "meshAdapter.cpp" "readers/foamDictionary.cpp")

target_sources(FoamAdapter PRIVATE "conversion/convert.cpp" "setup.cpp" "meshAdapter.cpp"
"readers/foamDictionary.cpp")
14 changes: 7 additions & 7 deletions src/meshAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ MeshAdapter::MeshAdapter(
const bool syncPar
)
: fvMesh(
io,
std::move(points),
std::move(faces),
std::move(allOwner),
std::move(allNeighbour),
syncPar
),
io,
std::move(points),
std::move(faces),
std::move(allOwner),
std::move(allNeighbour),
syncPar
),
nfMesh_(readOpenFOAMMesh(exec, *this))
{}

Expand Down
7 changes: 6 additions & 1 deletion test/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ auto randomVectorField(const Time& runTime, const MeshAdapter& mesh)
std::mt19937 gen(rd()); // Standard mersenne_twister_engine seeded with rd()
std::uniform_real_distribution<> dis(1.0, 2.0);
return createRandomField<volVectorField>(
runTime, mesh, "U", [&]() { return vector {dis(gen), dis(gen), dis(gen)}; }
runTime,
mesh,
"U",
[&]() {
return vector {dis(gen), dis(gen), dis(gen)};
}
);
}

Expand Down

0 comments on commit a448f31

Please sign in to comment.