Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a4b8976
Limit time step at material interfaces and test with python SquareEtc…
FilipovicLado Dec 6, 2025
c3fc0d4
Update logger
tobre1 Dec 7, 2025
1e43bb5
Reverted material interface behavior and added removeLastMaterial fun…
FilipovicLado Dec 9, 2025
ee65258
format
FilipovicLado Dec 9, 2025
a1dc1da
Fix material interface stability with adaptive sub-stepping of thin l…
FilipovicLado Dec 10, 2025
6112431
Added WENO integration scheme
FilipovicLado Dec 10, 2025
347fe7d
Add option to enable adaptive time stepping during advection
tobre1 Dec 10, 2025
2e305b4
Add python bindings
tobre1 Dec 12, 2025
b3fdb1c
Bump version
tobre1 Dec 15, 2025
500a15c
Add option to set the adaptive time stepping threshold
tobre1 Dec 15, 2025
7c04453
Fix MultiSurfaceMesh ctors
tobre1 Dec 15, 2025
9bc958c
Added Runge-Kutta 3 time integration
FilipovicLado Dec 15, 2025
a26061a
Merge remote-tracking branch 'origin/fix_material_interface' into fix…
FilipovicLado Dec 15, 2025
b284716
Added Runge Kutta time integration scheme
FilipovicLado Dec 15, 2025
6f3c4b2
Merge branch 'master' into fix_material_interface
FilipovicLado Dec 15, 2025
58628fd
Fixed errors from previous commit and format
FilipovicLado Dec 15, 2025
6e29432
Clean up
tobre1 Dec 16, 2025
594cd08
Update Python stubs
tobre1 Dec 16, 2025
6d8767f
Fixed time step differences between FE and RK3
FilipovicLado Dec 17, 2025
7cce26b
Format AirGapDeposition example
FilipovicLado Dec 17, 2025
d276af6
rename integration -> discretization where appropriate
kenyastyle Dec 18, 2025
cfdd2c4
fix formatting
kenyastyle Dec 18, 2025
07f825f
Updated AirGapDeposition, Deposition, and SquareEtch examples to work…
FilipovicLado Dec 19, 2025
6688fc9
format
FilipovicLado Dec 19, 2025
be39c43
fixed SquareEtch example
FilipovicLado Dec 19, 2025
916de96
prepareLS(); in computeRates was added again which made it redundant …
FilipovicLado Dec 19, 2025
04a7256
Rename to SpatialScheme, add legacy IntegrationSchemeEnum
tobre1 Dec 22, 2025
726ca99
Fixed RK3 time integration scheme to only need velocities on the spar…
FilipovicLado Dec 22, 2025
7c3db6f
Fixed RK3 (Strong-Stability preserving Runge-Kutta 3rd order) tempora…
FilipovicLado Dec 27, 2025
3ef818c
Merge remote-tracking branch 'origin/master' into fix_material_interface
FilipovicLado Dec 27, 2025
3b7f5a4
Merge remote-tracking branch 'origin/rename' into fix_material_interf…
FilipovicLado Dec 27, 2025
824bb7a
Added compile-time "IntegrationScheme" naming depreciation narning.
FilipovicLado Dec 28, 2025
10e4c0f
format
FilipovicLado Dec 28, 2025
13cafda
Refactor Advect to use TemporalSchemeEnum and consolidate time integr…
FilipovicLado Dec 29, 2025
0be959b
Allow for calculating intermediate velocities during higher order tim…
FilipovicLado Dec 30, 2025
10c07f5
Added python bindings to the velocity calculation callback function
FilipovicLado Dec 30, 2025
f6f5025
Merge remote-tracking branch 'origin/master' into int-velocities
FilipovicLado Jan 8, 2026
307e141
Small fixes in FromMesh and MarkVoidPoints, add velocityUpdateCallbac…
FilipovicLado Jan 8, 2026
f597f69
format
FilipovicLado Jan 8, 2026
10685ff
remove last velocity calculation when in single step mode
FilipovicLado Jan 8, 2026
0b687a9
fixed failing PatternedSubstrate and VolumeToLevelSets examples, adde…
FilipovicLado Jan 8, 2026
5a01389
format
FilipovicLado Jan 8, 2026
fea7a19
remove GIT_TAG for ViennaHRLE
FilipovicLado Jan 8, 2026
c4a8639
Merge remote-tracking branch 'origin/master' into int-velocities
FilipovicLado Jan 9, 2026
5d6921f
Merge remote-tracking branch 'origin/fix-examples' into int-velocities
FilipovicLado Jan 9, 2026
e920b82
Added 3D options and tests for comparing domains
FilipovicLado Jan 9, 2026
04fb487
format
FilipovicLado Jan 9, 2026
99552b7
use CompareVolume for 3D and CompareArea for 2D, fix minor errors, im…
FilipovicLado Jan 13, 2026
1ef34ab
Removed CompareArea from top level Python API, now it is only in d2
FilipovicLado Jan 13, 2026
f015792
Update python stubs
tobre1 Jan 13, 2026
b2680f0
Merge pull from origin
tobre1 Jan 13, 2026
15b87ee
Small fixes
tobre1 Jan 13, 2026
9a0a6ff
Correct inconsistency in custom z-increments.
kenyastyle Jan 13, 2026
0004c0f
Small fixes and improvements to tests.
kenyastyle Jan 13, 2026
0c8e61a
Minor fix
FilipovicLado Jan 13, 2026
8d9e700
initialize all Vec3Ds to 0, add 3rd order WENO spatial scheme, improv…
FilipovicLado Jan 15, 2026
1fd1f35
rename lsWENO5.hpp to lsWENO.hpp
FilipovicLado Jan 15, 2026
66e6105
assert WENO order 3 or 5 only is permitted
FilipovicLado Jan 15, 2026
73071b5
update ViennaCore and ViennaHRLE versions
FilipovicLado Jan 15, 2026
8704233
Merge remote-tracking branch 'origin/master' into weno3
FilipovicLado Jan 15, 2026
d2ed3ed
remove double lines in lsCalcVisibilities
FilipovicLado Jan 15, 2026
003e2f9
remove code duplication resulting from a faulty merge
FilipovicLado Jan 15, 2026
5760afb
format
FilipovicLado Jan 15, 2026
55283b1
fix memcmp error by including <cstring>
FilipovicLado Jan 15, 2026
44279d2
remove commented lines from lsDomain and lsPointData
FilipovicLado Jan 15, 2026
810fb5e
changed order iof includes
FilipovicLado Jan 15, 2026
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ _generate/
*env*
.mypy_cache/
.eggs/
test.ipynb
test.ipynb
testall.sh
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ include(cmake/vtk.cmake)

CPMAddPackage(
NAME ViennaCore
VERSION 1.9.0
VERSION 1.9.3
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaCore"
OPTIONS "VIENNACORE_FORMAT_EXCLUDE build/"
EXCLUDE_FROM_ALL ${VIENNALS_BUILD_PYTHON})
Expand All @@ -125,7 +125,7 @@ CPMAddPackage(

CPMFindPackage(
NAME ViennaHRLE
VERSION 0.7.0
VERSION 0.8.0
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaHRLE"
EXCLUDE_FROM_ALL ${VIENNALS_BUILD_PYTHON})

Expand Down
7 changes: 3 additions & 4 deletions examples/SquareEtch/SquareEtch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ int main() {
// Analytical velocity fields and dissipation coefficients
// can only be used with this spatial discretization scheme
advectionKernel.setSpatialScheme(
// ls::SpatialSchemeEnum::LOCAL_LAX_FRIEDRICHS_ANALYTICAL_1ST_ORDER);
ls::SpatialSchemeEnum::WENO_5TH_ORDER);
ls::SpatialSchemeEnum::LOCAL_LAX_FRIEDRICHS_ANALYTICAL_1ST_ORDER);
} else {
// for numerical velocities, just use the default
// spatial discretization scheme, which is not accurate for certain
Expand All @@ -211,8 +210,8 @@ int main() {
// For coordinate independent velocity functions
// this numerical scheme is superior though.
// However, it is slower.
// advectionKernel.setSpatialScheme(
// ls::SpatialSchemeEnum::STENCIL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER);
advectionKernel.setSpatialScheme(
ls::SpatialSchemeEnum::STENCIL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER);
}

// advect the level set until 50s have passed
Expand Down
22 changes: 14 additions & 8 deletions include/viennals/lsAdvect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <lsLocalLaxFriedrichsAnalytical.hpp>
#include <lsLocalLocalLaxFriedrichs.hpp>
#include <lsStencilLocalLaxFriedrichsScalar.hpp>
#include <lsWENO5.hpp>
#include <lsWENO.hpp>

// Include implementation of time integration schemes
#include <lsAdvectIntegrationSchemes.hpp>
Expand Down Expand Up @@ -147,12 +147,12 @@ template <class T, int D> class Advect {
// move neighborIterator to current position
neighborIterator.goToIndicesSequential(indices);

Vec3D<T> coords;
Vec3D<T> coords{};
for (unsigned i = 0; i < D; ++i) {
coords[i] = indices[i] * gridDelta;
}

Vec3D<T> normal = {};
Vec3D<T> normal{};
T normalModulus = 0.;
for (unsigned i = 0; i < D; ++i) {
const T phiPos = neighborIterator.getNeighbor(i).getValue();
Expand Down Expand Up @@ -664,10 +664,15 @@ template <class T, int D> class Advect {
auto is = lsInternal::StencilLocalLaxFriedrichsScalar<T, D, 1>(
levelSets.back(), velocities, dissipationAlpha);
currentTimeStep = integrateTime(is, maxTimeStep);
} else if (spatialScheme == SpatialSchemeEnum::WENO_3RD_ORDER) {
// Instantiate WENO with order 3
auto is = lsInternal::WENO<T, D, 3>(levelSets.back(), velocities,
dissipationAlpha);
currentTimeStep = integrateTime(is, maxTimeStep);
} else if (spatialScheme == SpatialSchemeEnum::WENO_5TH_ORDER) {
// Instantiate WENO5 with order 3 (neighbors +/- 3)
auto is = lsInternal::WENO5<T, D, 3>(levelSets.back(), velocities,
dissipationAlpha);
// Instantiate WENO with order 5
auto is = lsInternal::WENO<T, D, 5>(levelSets.back(), velocities,
dissipationAlpha);
currentTimeStep = integrateTime(is, maxTimeStep);
} else {
VIENNACORE_LOG_ERROR("Advect: Discretization scheme not found.");
Expand Down Expand Up @@ -998,9 +1003,10 @@ template <class T, int D> class Advect {
SpatialSchemeEnum::STENCIL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER) {
lsInternal::StencilLocalLaxFriedrichsScalar<T, D, 1>::prepareLS(
levelSets.back());
} else if (spatialScheme == SpatialSchemeEnum::WENO_3RD_ORDER) {
lsInternal::WENO<T, D, 3>::prepareLS(levelSets.back());
} else if (spatialScheme == SpatialSchemeEnum::WENO_5TH_ORDER) {
// WENO5 requires a stencil radius of 3 (template parameter 3)
lsInternal::WENO5<T, D, 3>::prepareLS(levelSets.back());
lsInternal::WENO<T, D, 5>::prepareLS(levelSets.back());
} else {
VIENNACORE_LOG_ERROR("Advect: Discretization scheme not found.");
}
Expand Down
3 changes: 2 additions & 1 deletion include/viennals/lsAdvectIntegrationSchemes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ enum class SpatialSchemeEnum : unsigned {
LOCAL_LAX_FRIEDRICHS_1ST_ORDER = 7,
LOCAL_LAX_FRIEDRICHS_2ND_ORDER = 8,
STENCIL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER = 9,
WENO_5TH_ORDER = 10
WENO_3RD_ORDER = 10,
WENO_5TH_ORDER = 11
};

// Legacy naming (deprecated, will be removed in future versions)
Expand Down
4 changes: 2 additions & 2 deletions include/viennals/lsCalculateNormalVectors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ template <class T, int D> class CalculateNormalVectors {
continue;
} else if (std::abs(center.getValue()) > maxValue) {
// push an empty vector to keep ordering correct
Vec3D<T> tmp = {};
Vec3D<T> tmp{};
normalVectors.push_back(tmp);
continue;
}

Vec3D<T> n;
Vec3D<T> n{};

T denominator = 0;
for (int i = 0; i < D; i++) {
Expand Down
6 changes: 3 additions & 3 deletions include/viennals/lsCalculateVisibilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ template <class T, int D> class CalculateVisibilities {
std::fill(visibilities.begin(), visibilities.end(), static_cast<T>(1.0));
} else {
// *** Determine extents of domain ***
Vec3D<T> minDefinedPoint;
Vec3D<T> maxDefinedPoint;
Vec3D<T> minDefinedPoint{};
Vec3D<T> maxDefinedPoint{};
// Initialize with extreme values
for (int i = 0; i < D; ++i) {
minDefinedPoint[i] = std::numeric_limits<T>::max();
Expand Down Expand Up @@ -87,7 +87,7 @@ template <class T, int D> class CalculateVisibilities {
continue;

// Starting position of the point
Vec3D<T> currentPos;
Vec3D<T> currentPos{};
for (int i = 0; i < D; ++i) {
currentPos[i] = it.getStartIndices(i);
}
Expand Down
3 changes: 2 additions & 1 deletion include/viennals/lsCompareCriticalDimensions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ template <class T, int D = 2> class CompareCriticalDimensions {
continue;

// Create points for target and sample positions
Vec3D<T> coordTarget = {0.0, 0.0, 0.0}, coordSample = {0.0, 0.0, 0.0};
Vec3D<T> coordTarget{};
Vec3D<T> coordSample{};

for (int i = 0; i < D; ++i) {
if (i == result.measureDimension) {
Expand Down
3 changes: 2 additions & 1 deletion include/viennals/lsDomain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <lsPreCompileMacros.hpp>

#include <cstring>
#include <limits>

#include <hrleDomain.hpp>
Expand Down Expand Up @@ -221,7 +222,7 @@ template <class T, int D> class Domain {
// Check identifier
char identifier[8];
stream.read(identifier, 8);
if (std::string(identifier).compare(0, 8, "lsDomain")) {
if (std::memcmp(identifier, "lsDomain", 8) != 0) {
Logger::getInstance()
.addError(
"Reading Domain from stream failed. Header could not be found.")
Expand Down
2 changes: 1 addition & 1 deletion include/viennals/lsEngquistOsher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ template <class T, int D, int order> class EngquistOsher {

// Calculate normal vector for velocity calculation
// use std::array since it will be exposed to interface
Vec3D<T> normalVector = {};
Vec3D<T> normalVector{};
if (calculateNormalVectors) {
T denominator = 0;
for (int i = 0; i < D; i++) {
Expand Down
2 changes: 1 addition & 1 deletion include/viennals/lsExtrude.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ template <class T> class Extrude {
SmartPointer<Domain<T, 3>> outputLevelSet = nullptr;
Vec2D<T> extent = {0., 0.};
int extrusionAxis = 0;
std::array<BoundaryConditionEnum, 3> boundaryConds = {};
std::array<BoundaryConditionEnum, 3> boundaryConds{};

public:
Extrude() = default;
Expand Down
2 changes: 1 addition & 1 deletion include/viennals/lsGeometricAdvect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ template <class T, int D> class GeometricAdvect {
{
std::vector<T> scalarData;
for (auto it = newPoints[0].begin(); it != newPoints[0].end(); ++it) {
Vec3D<T> node{0., 0., 0.};
Vec3D<T> node{};
for (unsigned i = 0; i < D; ++i) {
node[i] = T((it->first)[i]) * gridDelta;
}
Expand Down
6 changes: 3 additions & 3 deletions include/viennals/lsGeometricAdvectDistributions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class SphereDistribution : public GeometricAdvectDistribution<T, D> {
}

std::array<viennahrle::CoordType, 6> getBounds() const override {
std::array<viennahrle::CoordType, 6> bounds = {};
std::array<viennahrle::CoordType, 6> bounds{};
for (unsigned i = 0; i < D; ++i) {
bounds[2 * i] = -radius;
bounds[2 * i + 1] = radius;
Expand Down Expand Up @@ -157,7 +157,7 @@ class BoxDistribution : public GeometricAdvectDistribution<T, D> {
}

std::array<viennahrle::CoordType, 6> getBounds() const override {
std::array<viennahrle::CoordType, 6> bounds = {};
std::array<viennahrle::CoordType, 6> bounds{};
for (unsigned i = 0; i < D; ++i) {
bounds[2 * i] = -posExtent[i];
bounds[2 * i + 1] = posExtent[i];
Expand Down Expand Up @@ -240,7 +240,7 @@ class CustomSphereDistribution : public GeometricAdvectDistribution<T, D> {
}

std::array<viennahrle::CoordType, 6> getBounds() const override {
std::array<viennahrle::CoordType, 6> bounds = {};
std::array<viennahrle::CoordType, 6> bounds{};
for (unsigned i = 0; i < D; ++i) {
bounds[2 * i] = -maxRadius_;
bounds[2 * i + 1] = maxRadius_;
Expand Down
2 changes: 1 addition & 1 deletion include/viennals/lsLaxFriedrichs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ template <class T, int D, int order> class LaxFriedrichs {
T grad = 0.;
T dissipation = 0.;

Vec3D<T> normalVector = {};
Vec3D<T> normalVector{};
T normalModulus = 0;

for (int i = 0; i < D; i++) { // iterate over dimensions
Expand Down
8 changes: 4 additions & 4 deletions include/viennals/lsLocalLaxFriedrichs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ template <class T, int D, int order> class LocalLaxFriedrichs {
T grad = 0.;
T dissipation = 0.;

Vec3D<T> normalVector = {};
Vec3D<T> normalVector{};
T normalModulus = 0;

for (int i = 0; i < D; i++) { // iterate over dimensions
Expand Down Expand Up @@ -183,7 +183,7 @@ template <class T, int D, int order> class LocalLaxFriedrichs {
}

// calculate alphas
T alpha[D] = {};
T alpha[D]{};
{
// alpha calculation is always on order 1 stencil
const viennahrle::IndexType minIndex = -1;
Expand All @@ -192,11 +192,11 @@ template <class T, int D, int order> class LocalLaxFriedrichs {

viennahrle::Index<D> neighborIndex(minIndex);
for (unsigned i = 0; i < numNeighbors; ++i) {
Vec3D<T> coords;
Vec3D<T> coords{};
for (unsigned dir = 0; dir < D; ++dir) {
coords[dir] = coordinate[dir] + neighborIndex[dir] * gridDelta;
}
Vec3D<T> normal = {};
Vec3D<T> normal{};
double normalModulus = 0.;
auto center = neighborIterator.getNeighbor(neighborIndex).getValue();
for (unsigned dir = 0; dir < D; ++dir) {
Expand Down
6 changes: 3 additions & 3 deletions include/viennals/lsLocalLaxFriedrichsAnalytical.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ template <class T, int D, int order> class LocalLaxFriedrichsAnalytical {
T grad = 0.;
T dissipation = 0.;

Vec3D<T> normalVector = {};
Vec3D<T> normalVector{};
T normalModulus = 0;

for (int i = 0; i < D; i++) { // iterate over dimensions
Expand Down Expand Up @@ -182,7 +182,7 @@ template <class T, int D, int order> class LocalLaxFriedrichsAnalytical {
}

// calculate alphas
T alpha[D] = {};
T alpha[D]{};
{
// alpha calculation is always on order 1 stencil
constexpr viennahrle::IndexType minIndex = -1;
Expand All @@ -192,7 +192,7 @@ template <class T, int D, int order> class LocalLaxFriedrichsAnalytical {
viennahrle::Index<D> neighborIndex(minIndex);
for (unsigned i = 0; i < numNeighbors; ++i) {

Vec3D<T> normal = {};
Vec3D<T> normal{};
auto center = neighborIterator.getNeighbor(neighborIndex).getValue();
for (unsigned dir = 0; dir < D; ++dir) {
viennahrle::Index<D> unity(0);
Expand Down
2 changes: 1 addition & 1 deletion include/viennals/lsLocalLocalLaxFriedrichs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ template <class T, int D, int order> class LocalLocalLaxFriedrichs {
T grad = 0.;
T dissipation = 0.;

Vec3D<T> normalVector = {};
Vec3D<T> normalVector{};
T normalModulus = 0;

for (int i = 0; i < D; i++) { // iterate over dimensions
Expand Down
3 changes: 1 addition & 2 deletions include/viennals/lsMakeGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,9 @@ template <class T, int D> class MakeGeometry {

// create and insert points at base
for (double angle = 0.; angle < limit; angle += smallAngle) {
Vec3D<T> point;
Vec3D<T> point{};
point[0] = cylinder->radius * std::cos(angle);
point[1] = cylinder->radius * std::sin(angle);
point[2] = 0.0;
points.push_back(point);
mesh->insertNextNode(point);
}
Expand Down
6 changes: 4 additions & 2 deletions include/viennals/lsMesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ template <class T = double> class Mesh {
std::vector<std::array<unsigned, 8>> hexas;
PointData<T> pointData;
PointData<T> cellData;
Vec3D<T> minimumExtent;
Vec3D<T> maximumExtent;
Vec3D<T> minimumExtent{};
Vec3D<T> maximumExtent{};

private:
// iterator typedef
Expand Down Expand Up @@ -272,6 +272,8 @@ template <class T = double> class Mesh {
hexas.clear();
pointData.clear();
cellData.clear();
minimumExtent = Vec3D<T>{};
maximumExtent = Vec3D<T>{};
}

void print() {
Expand Down
3 changes: 2 additions & 1 deletion include/viennals/lsPointData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <lsPreCompileMacros.hpp>

#include <cstdint>
#include <cstring>
#include <utility>
#include <vector>

Expand Down Expand Up @@ -385,7 +386,7 @@ class PointData {
std::istream &deserialize(std::istream &stream) {
char identifier[11];
stream.read(identifier, 11);
if (std::string(identifier).compare(0, 11, "lsPointData")) {
if (std::memcmp(identifier, "lsPointData", 11) != 0) {
Logger::getInstance()
.addError("Reading PointData from stream failed. Header could "
"not be found.")
Expand Down
Loading
Loading