Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New ASPH H update algorithm #302

Open
wants to merge 141 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
c99d3a1
Generalizing hydros to allow user specification of custom smoothing
jmikeowen Feb 27, 2024
ac2929a
Screening TaylorImpact test to be skipped during debug build testing
jmikeowen Mar 1, 2024
c28c1d2
Modifying (and simplifying) TableKernel to use QuadraticInterpolator
jmikeowen Mar 1, 2024
b7ab895
Updating tests with reference changes
jmikeowen Mar 1, 2024
ca8b3bb
Cleanup
jmikeowen Mar 1, 2024
308f49c
Updating TableKernel unit test
jmikeowen Mar 1, 2024
7ac8845
Updating TensileRod reference data
jmikeowen Mar 1, 2024
19811cc
One more test reference data update. It appears all tests are passing.
jmikeowen Mar 2, 2024
e9ebda5
Loosening a tolerance for a test that intermittently fails (nothing to
jmikeowen Mar 2, 2024
4b5dee1
Simplifying how we integrate for nperh reference lookups. Also
jmikeowen Mar 5, 2024
4acd830
Reworked bisectRoot a bit, reinstantiating the y-tolerance for
jmikeowen Mar 5, 2024
6c8ab42
Adding initialization methods for CubicHermiteInterpolator, to be
jmikeowen Mar 6, 2024
2cd6444
Adding a linear interpolator based on linear regression
jmikeowen Mar 8, 2024
611a48b
Progress on SPH and ASPH ideal H
jmikeowen Mar 8, 2024
e918f37
Restoring monotonicity to nperh(Wsum) lookups
jmikeowen Mar 8, 2024
4c66a47
Fixing a comment
jmikeowen Mar 11, 2024
f90ce4d
Adding plots testing ASPH with different aspect ratios
jmikeowen Mar 11, 2024
94fb57c
Adding compiler guards
jmikeowen Mar 12, 2024
eb98b89
Checkpoint
jmikeowen Mar 12, 2024
014cf3e
Checkpoint on a crazy comb filter experiment
jmikeowen Mar 14, 2024
0f1290d
Extended interface for idealH in SmoothingScale methods to allow
jmikeowen Mar 18, 2024
8f4c9a8
Removing the temporary ASPHv2 object since we've folded that
jmikeowen Mar 18, 2024
e5c9917
More testing of the new ASPH ideas
jmikeowen Mar 19, 2024
997bdee
Interface update
jmikeowen Mar 19, 2024
0041b75
Changing default distribution method
jmikeowen Mar 21, 2024
33674cc
Checkpoint -- we have to make a radical change for the ideal ASPH H,
jmikeowen Mar 21, 2024
27bddf9
Experimenting with a whole different ASPH idea based on extracting the
jmikeowen Mar 22, 2024
cbd5ea3
Adding ostream operator to Box1d
jmikeowen Mar 25, 2024
ec8e53d
Checkpoint
jmikeowen Mar 26, 2024
b1c6f66
Using Boost::Geometry for 2D convex hull
jmikeowen Mar 26, 2024
99e2668
Protecting sqrt from generating a NaN
jmikeowen Mar 26, 2024
45bb52a
A differnt ASPH experiment using summation second moments again
jmikeowen Mar 26, 2024
15eea0a
Support for Vector2d natively in Boost::Geometryu
jmikeowen Mar 26, 2024
8f2f704
Replace redundant calculation with function call
jmikeowen Mar 28, 2024
1dfe1f4
Checkpoint
jmikeowen Mar 29, 2024
8045055
Trying an alternate way to work our transform directly on H rather
jmikeowen Mar 29, 2024
74b19e0
Checkpoint -- I believe our problem now is that we need to correct for
jmikeowen Apr 2, 2024
de0f760
Checkpoint
jmikeowen Apr 15, 2024
c834cff
Checkpoint
jmikeowen Apr 16, 2024
48aae45
Checkpoint
jmikeowen Apr 16, 2024
93105c6
Adding python bindings for bisectRoot
jmikeowen Apr 18, 2024
2ca0718
Checkpoint -- experimenting with RK
jmikeowen Apr 18, 2024
88f8e29
INITIAL changes to make smoothing scale advancement it's own Physics
jmikeowen Apr 24, 2024
8db728d
Working though adding Python interface and changes for new independent
jmikeowen Apr 29, 2024
20e7ae0
Getting more tests running with new smoothing scale package
jmikeowen May 6, 2024
ed3326a
Dodging deprecation warnings by judicious header inclusion
jmikeowen May 7, 2024
11d87bb
Working on a different convex hull approach to node volume selection
jmikeowen May 8, 2024
f1ef4d6
Looks like using the convex hull as an optimizing precursor to
jmikeowen May 9, 2024
a78e437
Generalized our Boost::Geometry trait for GeomVector
jmikeowen May 9, 2024
e48b034
Fiddling with different ways to measure the second moment
jmikeowen May 9, 2024
5a83eeb
Got things running with the separate SmoothingScale physics
jmikeowen May 13, 2024
24c5919
Changing nperh to match our kernel choice for the 2D Noh problem
jmikeowen May 14, 2024
64fe066
Checkpoint
jmikeowen May 15, 2024
21b0682
Merge branch 'bugfix/PalphaConstructor' into feature/ASPHv2
jmikeowen May 15, 2024
8bb9d22
Order of ops for iteration startup
jmikeowen May 15, 2024
1a0db43
Checkpoint
jmikeowen May 15, 2024
4f7cda1
Checkpoint
jmikeowen May 15, 2024
80c3698
Merge branch 'develop' into feature/ASPHv2
jmikeowen May 16, 2024
399b804
Averaging in sqrt(psi) seems better than the psi directly
jmikeowen May 16, 2024
b63341f
Making ASPH pure IntegrateH during a cycle, and only apply the IdealH
jmikeowen May 16, 2024
c12b3a1
Experimenting with a crude artificial pair-wise pressure to push
jmikeowen May 16, 2024
24c0659
Checkpoint
jmikeowen May 16, 2024
529655d
Experimenting with directly moving the points toward the local centroid
jmikeowen May 20, 2024
a8a418c
First stage getting the Voronoi cell geometry as a generic physics
jmikeowen May 22, 2024
b485532
Removing debug print
jmikeowen May 22, 2024
79593d2
Boundary condition fixes -- seems to correct ASPH iterateIdealH
jmikeowen May 22, 2024
21b5650
Very rough first cut at sub-point/cell pressure hourglass control
jmikeowen May 23, 2024
7b57301
Implemented 2D subcell pressure HG control
jmikeowen May 23, 2024
dedc4ed
Converting controller iterateIdealH to find and use the physics package
jmikeowen May 24, 2024
ea6c185
Starting to use cell center of mass rather than centroid for filtering
jmikeowen May 24, 2024
dffe643
Better dummy MPI wrapper protection
jmikeowen May 28, 2024
1d602d8
Grabbing CellFaceFlags
jmikeowen May 28, 2024
3e9741c
Making node pair hashing independent of order (i,j <-> j,i)
jmikeowen Jun 6, 2024
fa234fe
Switched to HG forces acting pairwise rather than internal to points.…
jmikeowen Jun 6, 2024
2e655b9
Implementing 2D triangular sub-cell corrections
jmikeowen Jun 7, 2024
0f3aacb
Making 2D & 3D Voronoi geometries return full CellFaceFlags
jmikeowen Jun 7, 2024
2fdbeee
Allowing more interpolation kernels for 1D Sod test
jmikeowen Jun 7, 2024
2e2d2c0
Moving Voronoi geometry calculation to start of step, which is
jmikeowen Jun 7, 2024
3842b1d
Fixing operator<<(Box1d)
jmikeowen Jun 7, 2024
0378f87
Fixing compiler guard
jmikeowen Jun 7, 2024
48a34bd
Trying to figure out handing parallel correctly for subpoint pressures
jmikeowen Jun 7, 2024
719e6fd
Adding logic to clip polytopes for reflecting boundary enforcement
jmikeowen Jun 12, 2024
93d75f7
Spelling
jmikeowen Jun 12, 2024
9a4bd30
Checkpoint working on pair-wise HG forces
jmikeowen Jun 12, 2024
6dc0dd4
Merge branch 'develop' into feature/ASPHv2
jmikeowen Jun 12, 2024
1ea0bed
Fixes from merging with develop
jmikeowen Jun 12, 2024
122ee2a
Another develop merge bugfix
jmikeowen Jun 12, 2024
0638bec
Merge branch 'develop' into feature/ASPHv2
jmikeowen Jun 27, 2024
0503ccd
Fixed one problem with Voronoi cells building during the step related
jmikeowen Jun 27, 2024
ed28b83
We messed up by a factor of the mass. This isn't right yet, but closer.
jmikeowen Jun 28, 2024
cb90295
Merge branch 'develop' into feature/ASPHv2
jmikeowen Jul 19, 2024
b2d8421
Catching up with Landon's changes
jmikeowen Jul 20, 2024
519e494
Sorted some problems for serial/no ghost points runs with the new
jmikeowen Jul 22, 2024
df9e61b
Merge branch 'develop' into feature/ASPHv2
jmikeowen Jul 23, 2024
23e9825
Working on our targeted test for hourglass filtering (1D)
jmikeowen Jul 24, 2024
575c554
Adding time step control for hourglass pressure filter
jmikeowen Jul 25, 2024
57ae1a9
More testing
jmikeowen Jul 25, 2024
21697a9
Found the latest problem with energy conservation
jmikeowen Jul 26, 2024
a8176c8
Gah! Bug in ASPH H algorithm smoothing
jmikeowen Jul 29, 2024
260b840
Changing reference pressure for HG control, but not affecting ASPH Noh
jmikeowen Jul 29, 2024
7397fb9
Defaulting to WendlandC4 kernel
jmikeowen Jul 29, 2024
7bcf5fd
Implemented 3D filter sub-pressures, and adding option to do direct
jmikeowen Jul 29, 2024
24b53df
Fixing a mysterious thread problem with ASPH
jmikeowen Jul 30, 2024
c8ae196
Changing a deffault
jmikeowen Jul 30, 2024
1c71d17
Merge branch 'develop' into feature/ASPHv2
jmikeowen Jul 31, 2024
fa88ced
Fiddling with the direct centroidal motion option
jmikeowen Aug 1, 2024
b65eebd
Learned a few things with a 2D hourglass direct test
jmikeowen Aug 5, 2024
28754be
Renaming filter->xfilter in script
jmikeowen Aug 7, 2024
e33575c
Cleaned up some unnecessary variables/storage for the compatible ener…
jmikeowen Aug 9, 2024
e8038ba
Implementing 3D second-moment for tetrahedra and cleaning up warnings
jmikeowen Aug 10, 2024
3af0115
Test update with new smoothing scale algorithm interface
jmikeowen Aug 10, 2024
a152e28
Test updates
jmikeowen Aug 12, 2024
35701aa
Fixing more tests (including a few actual problems)
jmikeowen Aug 13, 2024
fcf963c
Contract bug fix
jmikeowen Aug 13, 2024
ad8d917
Updates for new smoothing scale physics interface
jmikeowen Aug 13, 2024
8cd19e5
Test updates with new interface
jmikeowen Aug 13, 2024
80a48f8
More test fixes
jmikeowen Aug 13, 2024
eea0679
DEM fixes
jmikeowen Aug 13, 2024
45260eb
Test updates
jmikeowen Aug 13, 2024
066629a
Checkpoint
jmikeowen Aug 16, 2024
0670aff
CubicHermiteInterpolator now uses a solve for the gradient values if …
jmikeowen Aug 16, 2024
576dd32
Test updates with modified CubicHermiteInterpolator
jmikeowen Aug 16, 2024
3825fe3
Debugged a tolerance issue with ANEOS
jmikeowen Aug 20, 2024
d06d490
Merge branch 'develop' into feature/ASPHv2
jmikeowen Aug 21, 2024
3718784
Fixing compile warnings
jmikeowen Aug 21, 2024
8b276d0
Cleaning up CLANG warnings. Also turning on warnings as errors for c…
jmikeowen Aug 21, 2024
d3e0283
Test robustness fix
jmikeowen Aug 21, 2024
077632d
Cleaned up clang warnings for optimized build
jmikeowen Aug 22, 2024
ec18353
Fixing clang treat warnings as errors flag for CI
jmikeowen Aug 22, 2024
2d28e1d
Physics::postStateUpdate now returns a bool indicating if boundary co…
jmikeowen Aug 22, 2024
a05ad5f
Adding compiler flags to help building on IBM blueos
jmikeowen Sep 4, 2024
21856be
Testing tolerance for BlueOS slightly different on Tensile Rod test
jmikeowen Sep 4, 2024
ec5c69a
- Cleaned up ASPH implementation, removing unused code and variables.
jmikeowen Sep 11, 2024
f827caa
Merge branch 'develop' into feature/ASPHv2
jmikeowen Sep 11, 2024
5813b17
Making test robust with random seeds (and a few other improvements)
jmikeowen Sep 11, 2024
0916e18
Added missing Python bindings
jmikeowen Sep 11, 2024
602be57
Moving -fvar-tracking-assignments-toggle to be on for PYB11 builds on…
jmikeowen Sep 13, 2024
e674000
Changing -fvar-tracking-assignments-toggle to -fno-var-tracking-assig…
jmikeowen Sep 18, 2024
b60c052
Updating Spheral Release notes
jmikeowen Sep 19, 2024
e1d88b9
Adding more flexibility to the IdealH user override functor in the AS…
jmikeowen Sep 20, 2024
3c0680b
Fixed some problems with the initial iterateIdealH. Also adding a
jmikeowen Sep 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitlab/specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.gcc_mvapich2_cxxonly:
variables:
SPEC: 'gcc@$GCC_VERSION^mvapich2'
EXTRA_CMAKE_ARGS: '-DENABLE_CXXONLY=On'
EXTRA_CMAKE_ARGS: '-DENABLE_CXXONLY=On -DENABLE_WARNINGS_AS_ERRORS=On'

.gcc_mvapich2:
variables:
Expand All @@ -28,6 +28,7 @@
.clang_mvapich2:
variables:
SPEC: 'clang@$CLANG_VERSION^mvapich2'
EXTRA_CMAKE_ARGS: '-DENABLE_WARNINGS_AS_ERRORS=On'

.cuda_11_gcc_~mpi:
variables:
Expand Down
14 changes: 14 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ Notable changes include:
* TPL builds have been split off into a separate Gitlab CI stage to help with timeouts on allocations.
* Failed ATS runs are automatically retested once in the Gitlab CI.
* Python execute command is centralized in scripts/spheralutils.py now.
* New ASPH idealH algorithm implemented, which is much more robust and accurate as H elongations become extreme.
* New experimental hourglass control algorithm implemented, along with some basic tests/demonstrations.
* H update algorithms converted to their own independent physics packages, no longer part of the various hydro packages.
* Physics interface updated slightly:
* Physics::postStateUpdate now returns a bool indicating if boundary conditions should be enforced again.
* Physics packages can now have Physics sub-packages, which can be run before or after the main package. The SpheralController
now checks for these packages and adds them to the physics package list as needed.
* Physics packages can indicate if they require Voronoi cell information be available. If so, a new package which computes and
updates the Voronoi information is automatically added to the package list by the SpheralController (similar to how the
Reproducing Kernel corrections are handled).

* Build changes / improvements:
* Distributed source directory must always be built now.
Expand All @@ -23,10 +33,14 @@ Notable changes include:
* The FSISPH package is now optional (SPHERAL\_ENABLE\_FSISPH).
* The GSPH package is now optional (SPHERAL\_ENABLE\_GSPH).
* The SVPH package is now optional (SPHERAL\_ENABLE\_SVPH).
* Added a GCC flag to prevent building variable tracking symbols when building PYB11 modules. This is unnecessary, and
on some platforms trying to build such symbols is very expensive and in some cases fails.

* Bug Fixes / improvements:
* Wrappers for MPI calls are simplified and improved.
* Time step estimate due to velocity divergence in RZ space has been fixed.
* Fixed tolerances for ANEOS equation of state temperature lookup
* Clang C++ warnings have eliminated, so the Clang CI tests have been updated to treat warnings as errors.

Version v2024.06.1 -- Release date 2024-07-09
==============================================
Expand Down
24 changes: 21 additions & 3 deletions cmake/Compilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ option(ENABLE_MISSING_INCLUDE_DIR_WARNINGS "show unused parameter warnings" ON)
set(CXX_WARNING_FLAGS "")
if (ENABLE_WARNINGS)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
list(APPEND CXX_WARNING_FLAGS -Wno-unused-command-line-argument -Wno-c++17-extensions)
list(APPEND CXX_WARNING_FLAGS -fdiagnostics-show-option -Wno-unused-command-line-argument -Wno-c++17-extensions)
endif()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
Expand Down Expand Up @@ -59,7 +59,6 @@ message("-- using warning flags ${CXX_WARNING_FLAGS}")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wno-missing-include-dirs")
message("-- Fortran flags: ${CMAKE_Fortran_FLAGS}")


#-------------------------------------------------------------------------------
# PYB11 Target Flags
#-------------------------------------------------------------------------------
Expand All @@ -75,7 +74,8 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-Wno-delete-abstract-non-virtual-dtor)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
list(APPEND SPHERAL_PYB11_TARGET_FLAGS
-Wno-pedantic)
-Wno-pedantic
-fno-var-tracking-assignments)
endif()

#-------------------------------------------------------------------------------
Expand All @@ -85,3 +85,21 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
set(CMAKE_CXX_FLAGS -wd11074,11076,654)
set(SPHERAL_PYB11_TARGET_FLAGS )
endif()

#-------------------------------------------------------------------------------
# BlueOS specific flags
#-------------------------------------------------------------------------------
if (DEFINED ENV{SYS_TYPE})
if ("$ENV{SYS_TYPE}" STREQUAL "blueos_3_ppc64le_ib_p9")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CXX_BLUEOS_FLAGS "-Os") # Needed to prevent relocation overflow errors during link
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${CXX_BLUEOS_FLAGS}>")
message("-- Adding ${CXX_BLUEOS_FLAGS} to C++ compile flags")
endif()
endif()
endif()
#set(CXX_STRIP_FLAGS "-fdata-sections;-ffunction-sections")
#set(CXX_LINK_STRIP_FLAGS "-Wl,--gc-sections")
#set(CXX_LINK_STRIP_FLAGS "-Wl,-z combreloc")
#add_link_options("${CXX_LINK_STRIP_FLAGS}")

13 changes: 13 additions & 0 deletions scripts/spack/configs/blueos_3_ppc64le_ib/compilers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,16 @@ compilers:
modules: []
environment: {}
extra_rpaths: []
- compiler:
spec: gcc@10.2.1
paths:
cc: /usr/tce/packages/gcc/gcc-10.2.1/bin/gcc
cxx: /usr/tce/packages/gcc/gcc-10.2.1/bin/g++
f77: /usr/tce/packages/gcc/gcc-10.2.1/bin/gfortran
fc: /usr/tce/packages/gcc/gcc-10.2.1/bin/gfortran
flags: {}
operating_system: rhel7
target: ppc64le
modules: []
environment: {}
extra_rpaths: []
2 changes: 1 addition & 1 deletion src/Boundary/ConstantBoundary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ restoreState(const FileIO& file, const string& pathName) {
vector<std::string> keys;
file.read(keys, pathName + "/keys");
mBufferedValues.clear();
for (const auto key: keys) {
for (const auto& key: keys) {
std::string val;
file.read(val, pathName + "/BufferedValues/" + key);
mBufferedValues[key] = vector<char>(val.begin(), val.end());
Expand Down
74 changes: 70 additions & 4 deletions src/Boundary/ReflectingBoundary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ namespace {
//------------------------------------------------------------------------------
// Reflect a faceted volume
//------------------------------------------------------------------------------
inline
Dim<1>::FacetedVolume
static inline reflectFacetedVolume(const ReflectingBoundary<Dim<1>>& bc,
reflectFacetedVolume(const ReflectingBoundary<Dim<1>>& bc,
const Dim<1>::FacetedVolume& poly) {
const auto& plane = bc.enterPlane();
return Dim<1>::FacetedVolume(bc.mapPosition(poly.center(),
Expand All @@ -41,10 +42,11 @@ static inline reflectFacetedVolume(const ReflectingBoundary<Dim<1>>& bc,
poly.extent());
}

inline
Dim<2>::FacetedVolume
static inline reflectFacetedVolume(const ReflectingBoundary<Dim<2>>& bc,
reflectFacetedVolume(const ReflectingBoundary<Dim<2>>& bc,
const Dim<2>::FacetedVolume& poly) {
typedef Dim<2>::Vector Vector;
using Vector = Dim<2>::Vector;
const auto& plane = bc.enterPlane();
const auto& verts0 = poly.vertices();
const auto& facets = poly.facetVertices();
Expand All @@ -53,8 +55,9 @@ static inline reflectFacetedVolume(const ReflectingBoundary<Dim<2>>& bc,
return Dim<2>::FacetedVolume(verts1, facets);
}

inline
Dim<3>::FacetedVolume
static inline reflectFacetedVolume(const ReflectingBoundary<Dim<3>>& bc,
reflectFacetedVolume(const ReflectingBoundary<Dim<3>>& bc,
const Dim<3>::FacetedVolume& poly) {
const auto& plane = bc.enterPlane();
auto verts = poly.vertices();
Expand All @@ -65,8 +68,70 @@ static inline reflectFacetedVolume(const ReflectingBoundary<Dim<3>>& bc,
return Dim<3>::FacetedVolume(verts, facets);
}

//------------------------------------------------------------------------------
// Clip a faceted volume
//------------------------------------------------------------------------------
inline
void
clipFacetedVolume(const ReflectingBoundary<Dim<1>>& bc,
Dim<1>::FacetedVolume& poly) {
using FacetedVolume = Dim<1>::FacetedVolume;
const auto& plane = bc.enterPlane();
if (min(plane.compare(poly.xmin()), plane.compare(poly.xmax())) == -1) {
auto xmin = poly.xmin();
auto xmax = poly.xmax();
if (plane.compare(xmin) == -1) xmin = plane.point();
if (plane.compare(xmax) == -1) xmax = plane.point();
poly = FacetedVolume({xmin, xmax});
}
}

inline
void
clipFacetedVolume(const ReflectingBoundary<Dim<2>>& bc,
Dim<2>::FacetedVolume& poly) {
const auto& plane = bc.enterPlane();
const auto& verts = poly.vertices();
const auto nverts = verts.size();
bool ok = true;
auto ivert = 0u;
while (ok and ivert < nverts) {
if (plane.compare(verts[ivert]) == -1) {
ok = false;
PolyClipperPolygon PCpoly;
convertToPolyClipper(PCpoly, poly);
PolyClipperPlane2d PCplane(plane.point(), plane.normal());
PolyClipper::clipPolygon(PCpoly, {PCplane});
convertFromPolyClipper(poly, PCpoly);
}
++ivert;
}
}

inline
void
clipFacetedVolume(const ReflectingBoundary<Dim<3>>& bc,
Dim<3>::FacetedVolume& poly) {
const auto& plane = bc.enterPlane();
const auto& verts = poly.vertices();
const auto nverts = verts.size();
bool ok = true;
auto ivert = 0u;
while (ok and ivert < nverts) {
if (plane.compare(verts[ivert]) == -1) {
ok = false;
PolyClipperPolyhedron PCpoly;
convertToPolyClipper(PCpoly, poly);
PolyClipperPlane3d PCplane(plane.point(), plane.normal());
PolyClipper::clipPolyhedron(PCpoly, {PCplane});
convertFromPolyClipper(poly, PCpoly);
}
++ivert;
}
}

} // anonymous

//------------------------------------------------------------------------------
// Empty constructor.
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -572,6 +637,7 @@ enforceBoundary(Field<Dimension, typename Dimension::FacetedVolume>& field) cons
++itr) {
CHECK(*itr >= 0 && *itr < (int)nodeList.numInternalNodes());
field(*itr) = reflectFacetedVolume(*this, field(*itr));
clipFacetedVolume(*this, field(*itr));
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ list(APPEND _packages
Physics
Porosity
RK
VoronoiCells
SPH
SolidMaterial
Strength
Utilities
SmoothingScale
)

if (SPHERAL_ENABLE_ARTIFICIAL_CONDUCTION)
Expand Down
Loading
Loading