diff --git a/META-INFO/api-info b/META-INFO/api-info index 8e35a8bceb..1952c86b39 100644 --- a/META-INFO/api-info +++ b/META-INFO/api-info @@ -1,2 +1,2 @@ api=2312 -patch=0 +patch=240220 diff --git a/etc/config.csh/setup b/etc/config.csh/setup index 33b39c927f..c2b4d4c2ac 100644 --- a/etc/config.csh/setup +++ b/etc/config.csh/setup @@ -197,8 +197,8 @@ if ( "$FOAM_MPI" != dummy ) then _foamAddLib "${FOAM_LIBBIN}/${FOAM_MPI}" endif -# OpenFOAM user, group libraries -_foamAddLib "${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}" +_foamAddLib "$FOAM_SITE_LIBBIN" # OpenFOAM group libraries +_foamAddLib "$FOAM_USER_LIBBIN" # OpenFOAM user libraries if ( -d "$WM_PROJECT_DIR/doc/man1" ) then _foamAddMan "$WM_PROJECT_DIR/doc" diff --git a/etc/config.sh/setup b/etc/config.sh/setup index 837eb90de4..7e35c3dcb8 100644 --- a/etc/config.sh/setup +++ b/etc/config.sh/setup @@ -229,8 +229,8 @@ then _foamAddLib "$FOAM_LIBBIN/$FOAM_MPI" fi -# OpenFOAM user, group libraries -_foamAddLib "$FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN" +_foamAddLib "$FOAM_SITE_LIBBIN" # OpenFOAM group libraries +_foamAddLib "$FOAM_USER_LIBBIN" # OpenFOAM user libraries if [ -d "$WM_PROJECT_DIR/doc/man1" ] then diff --git a/modules/turbulence-community b/modules/turbulence-community index a7af00a48d..06b391bb47 160000 --- a/modules/turbulence-community +++ b/modules/turbulence-community @@ -1 +1 @@ -Subproject commit a7af00a48d3a4962a08aeea445c6f8db797bc823 +Subproject commit 06b391bb475f0386342b6f9b7fe5496ae87e464f diff --git a/src/OpenFOAM/matrices/schemes/schemesLookup.C b/src/OpenFOAM/matrices/schemes/schemesLookup.C index c9a1b02865..2045a96dd4 100644 --- a/src/OpenFOAM/matrices/schemes/schemesLookup.C +++ b/src/OpenFOAM/matrices/schemes/schemesLookup.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2019-2023 OpenCFD Ltd. + Copyright (C) 2019-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -133,7 +133,7 @@ Foam::schemesLookup::schemesLookup obr.time().system(), obr, rOpt, - IOobject::NO_WRITE + IOobjectOption::NO_WRITE ), fallback ), @@ -153,18 +153,23 @@ Foam::schemesLookup::schemesLookup fluxRequiredDefault_(false), steady_(false) { - // Treat as MUST_READ_IF_MODIFIED whenever possible + // Treat as READ_MODIFIED whenever possible if ( - readOpt() == IOobject::MUST_READ + readOpt() == IOobjectOption::MUST_READ || (isReadOptional() && headerOk()) ) { - readOpt(IOobject::MUST_READ_IF_MODIFIED); + readOpt(IOobjectOption::READ_MODIFIED); addWatch(); } - if (readOpt() == IOobject::MUST_READ_IF_MODIFIED) + // Update: from values read or copied in + if + ( + readOpt() == IOobjectOption::READ_MODIFIED + || !dictionary::empty() + ) { read(selectedDict()); } diff --git a/src/OpenFOAM/matrices/solution/solution.C b/src/OpenFOAM/matrices/solution/solution.C index e8c837a056..27b0eac1df 100644 --- a/src/OpenFOAM/matrices/solution/solution.C +++ b/src/OpenFOAM/matrices/solution/solution.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019-2023 OpenCFD Ltd. + Copyright (C) 2019-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -174,7 +174,7 @@ Foam::solution::solution obr.time().system(), obr, rOpt, - IOobject::NO_WRITE + IOobjectOption::NO_WRITE ), fallback ), @@ -184,18 +184,23 @@ Foam::solution::solution eqnRelaxDict_(), solvers_() { - // Treat as MUST_READ_IF_MODIFIED whenever possible + // Treat as READ_MODIFIED whenever possible if ( - readOpt() == IOobject::MUST_READ + readOpt() == IOobjectOption::MUST_READ || (isReadOptional() && headerOk()) ) { - readOpt(IOobject::MUST_READ_IF_MODIFIED); + readOpt(IOobjectOption::READ_MODIFIED); addWatch(); } - if (readOpt() == IOobject::MUST_READ_IF_MODIFIED) + // Update: from values read or copied in + if + ( + readOpt() == IOobjectOption::READ_MODIFIED + || !dictionary::empty() + ) { read(selectedDict()); } diff --git a/src/meshTools/triangulatedPatch/triangulatedPatch.C b/src/meshTools/triangulatedPatch/triangulatedPatch.C index 513514cfbf..f80ec25595 100644 --- a/src/meshTools/triangulatedPatch/triangulatedPatch.C +++ b/src/meshTools/triangulatedPatch/triangulatedPatch.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2023 OpenCFD Ltd. + Copyright (C) 2023-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,7 +26,6 @@ License \*---------------------------------------------------------------------------*/ #include "triangulatedPatch.H" -#include "triPointRef.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -50,6 +49,8 @@ bool Foam::triangulatedPatch::randomPoint // Find corresponding decomposed face triangle // Note: triWght_ is sized nTri+1 (zero added at start) + // + // TBD: binary search with findLower(triWght_, c) ?? label trii = 0; for (label i = 0; i < triWght_.size() - 1; ++i) { @@ -62,11 +63,9 @@ bool Foam::triangulatedPatch::randomPoint // Find random point in triangle const pointField& points = patch_.points(); - const face& tf = triFace_[trii]; - const triPointRef tri(points[tf[0]], points[tf[1]], points[tf[2]]); - result = tri.randomPoint(rnd); - facei = triToFace_[trii]; + result = triFace_[trii].tri(points).randomPoint(rnd); + facei = triFace_[trii].index(); celli = patch_.faceCells()[facei]; if (perturbTol_ > 0) @@ -97,7 +96,6 @@ Foam::triangulatedPatch::triangulatedPatch patch_(patch), perturbTol_(perturbTol), triFace_(), - triToFace_(), triWght_() { update(); @@ -115,70 +113,95 @@ Foam::triangulatedPatch::triangulatedPatch {} +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +void Foam::triangulatedPatch::triangulate +( + const polyPatch& pp, + List& tris +) +{ + const pointField& points = pp.points(); + + // Triangulate the patch faces and create addressing + label nTris = 0; + for (const face& f : pp) + { + nTris += f.nTriangles(); + } + + DynamicList dynTris(nTris); + DynamicList tfaces(8); // work array + + label facei = 0; + for (const face& f : pp) + { + tfaces.clear(); + f.triangles(points, tfaces); + + for (const auto& t : tfaces) + { + dynTris.emplace_back(t[0], t[1], t[2], facei); + } + ++facei; + } + + tris.transfer(dynTris); +} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::triangulatedPatch::update() { + triFace_.clear(); + triWght_.clear(); + + triangulate(patch_, triFace_); + const pointField& points = patch_.points(); - // Triangulate the patch faces and create addressing - DynamicList