Skip to content

Commit 07d883c

Browse files
authored
Minor fixes and ViennaLS version bump (#138)
* Use New member function * Bump ViennaLS version * Use gcc-12 also for ViennaLS build in GPU install scripts
1 parent d155e3f commit 07d883c

33 files changed

Lines changed: 118 additions & 140 deletions

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ CPMFindPackage(
115115

116116
CPMFindPackage(
117117
NAME ViennaLS
118-
VERSION 4.3.1
118+
VERSION 4.3.2
119119
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaLS"
120120
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON})
121121

examples/atomicLayerDeposition/atomicLayerDeposition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ template <typename T, int D> class MeasureProfile {
2626

2727
ResultType get() {
2828
ps::Planarize<T, D>(domain_, cutoffHeight_).apply();
29-
auto mesh = ps::SmartPointer<viennals::Mesh<T>>::New();
29+
auto mesh = viennals::Mesh<T>::New();
3030
ps::ToDiskMesh<T, D>(domain_, mesh).apply();
3131

3232
std::vector<T> height, position;

examples/atomicLayerDeposition/geometry.hpp

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -34,42 +34,37 @@ void makeHAR(SmartPointer<viennaps::Domain<NumericType, D>> domain,
3434
viennals::Domain<NumericType, D>::BoundaryType::INFINITE_BOUNDARY;
3535

3636
{
37-
auto substrate = SmartPointer<viennals::Domain<NumericType, D>>::New(
38-
bounds, boundaryCons, gridDelta);
37+
auto substrate =
38+
viennals::Domain<NumericType, D>::New(bounds, boundaryCons, gridDelta);
3939
NumericType normal[D] = {0.};
4040
NumericType origin[D] = {0.};
4141
normal[D - 1] = 1.;
4242
origin[D - 1] = openingDepth + gapHeight;
4343
viennals::MakeGeometry<NumericType, D>(
44-
substrate,
45-
SmartPointer<viennals::Plane<NumericType, D>>::New(origin, normal))
44+
substrate, viennals::Plane<NumericType, D>::New(origin, normal))
4645
.apply();
4746
domain->insertNextLevelSetAsMaterial(substrate, material);
4847
}
4948

5049
{
51-
auto vertBox =
52-
SmartPointer<viennals::Domain<NumericType, D>>::New(domain->getGrid());
50+
auto vertBox = viennals::Domain<NumericType, D>::New(domain->getGrid());
5351
NumericType minPoint[D] = {0., 0.};
5452
NumericType maxPoint[D] = {openingWidth,
5553
gapHeight + openingDepth + gridDelta};
5654
viennals::MakeGeometry<NumericType, D>(
57-
vertBox,
58-
SmartPointer<viennals::Box<NumericType, D>>::New(minPoint, maxPoint))
55+
vertBox, viennals::Box<NumericType, D>::New(minPoint, maxPoint))
5956
.apply();
6057

6158
domain->applyBooleanOperation(
6259
vertBox, viennals::BooleanOperationEnum::RELATIVE_COMPLEMENT);
6360
}
6461

6562
{
66-
auto horiBox =
67-
SmartPointer<viennals::Domain<NumericType, D>>::New(domain->getGrid());
63+
auto horiBox = viennals::Domain<NumericType, D>::New(domain->getGrid());
6864
NumericType minPoint[D] = {openingWidth - gridDelta, 0.};
6965
NumericType maxPoint[D] = {openingWidth + gapLength, gapHeight};
7066
viennals::MakeGeometry<NumericType, D>(
71-
horiBox,
72-
SmartPointer<viennals::Box<NumericType, D>>::New(minPoint, maxPoint))
67+
horiBox, viennals::Box<NumericType, D>::New(minPoint, maxPoint))
7368
.apply();
7469

7570
domain->applyBooleanOperation(
@@ -102,42 +97,37 @@ void makeT(SmartPointer<viennaps::Domain<NumericType, D>> domain,
10297
bounds[3] = openingDepth + gapHeight + gridDelta;
10398

10499
{
105-
auto substrate = SmartPointer<viennals::Domain<NumericType, D>>::New(
100+
auto substrate = viennals::Domain<NumericType, D>::New(
106101
bounds, boundaryCons, gridDelta);
107102
NumericType normal[D] = {0.};
108103
NumericType origin[D] = {0.};
109104
normal[D - 1] = 1.;
110105
origin[D - 1] = openingDepth + gapHeight;
111106
viennals::MakeGeometry<NumericType, D>(
112-
substrate,
113-
SmartPointer<viennals::Plane<NumericType, D>>::New(origin, normal))
107+
substrate, viennals::Plane<NumericType, D>::New(origin, normal))
114108
.apply();
115109
domain->insertNextLevelSetAsMaterial(substrate, material);
116110
}
117111

118112
{
119-
auto vertBox = SmartPointer<viennals::Domain<NumericType, D>>::New(
120-
domain->getGrid());
113+
auto vertBox = viennals::Domain<NumericType, D>::New(domain->getGrid());
121114
NumericType minPoint[D] = {-gridDelta, 0.};
122115
NumericType maxPoint[D] = {openingWidth / 2.,
123116
gapHeight + openingDepth + gridDelta};
124117
viennals::MakeGeometry<NumericType, D>(
125-
vertBox,
126-
SmartPointer<viennals::Box<NumericType, D>>::New(minPoint, maxPoint))
118+
vertBox, viennals::Box<NumericType, D>::New(minPoint, maxPoint))
127119
.apply();
128120

129121
domain->applyBooleanOperation(
130122
vertBox, viennals::BooleanOperationEnum::RELATIVE_COMPLEMENT);
131123
}
132124

133125
{
134-
auto horiBox = SmartPointer<viennals::Domain<NumericType, D>>::New(
135-
domain->getGrid());
126+
auto horiBox = viennals::Domain<NumericType, D>::New(domain->getGrid());
136127
NumericType minPoint[D] = {openingWidth / 2. - gridDelta, 0.};
137128
NumericType maxPoint[D] = {openingWidth / 2. + gapLength, gapHeight};
138129
viennals::MakeGeometry<NumericType, D>(
139-
horiBox,
140-
SmartPointer<viennals::Box<NumericType, D>>::New(minPoint, maxPoint))
130+
horiBox, viennals::Box<NumericType, D>::New(minPoint, maxPoint))
141131
.apply();
142132

143133
domain->applyBooleanOperation(
@@ -155,44 +145,39 @@ void makeT(SmartPointer<viennaps::Domain<NumericType, D>> domain,
155145
bounds[5] = openingDepth + gapHeight + gridDelta;
156146

157147
{
158-
auto substrate = SmartPointer<viennals::Domain<NumericType, D>>::New(
148+
auto substrate = viennals::Domain<NumericType, D>::New(
159149
bounds, boundaryCons, gridDelta);
160150
NumericType normal[D] = {0.};
161151
NumericType origin[D] = {0.};
162152
normal[D - 1] = 1.;
163153
origin[D - 1] = openingDepth + gapHeight;
164154
viennals::MakeGeometry<NumericType, D>(
165-
substrate,
166-
SmartPointer<viennals::Plane<NumericType, D>>::New(origin, normal))
155+
substrate, viennals::Plane<NumericType, D>::New(origin, normal))
167156
.apply();
168157
domain->insertNextLevelSetAsMaterial(substrate, material);
169158
}
170159

171160
{
172-
auto vertBox = SmartPointer<viennals::Domain<NumericType, D>>::New(
173-
domain->getGrid());
161+
auto vertBox = viennals::Domain<NumericType, D>::New(domain->getGrid());
174162
NumericType minPoint[D] = {-gridDelta, -gapWidth / 2., 0.};
175163
NumericType maxPoint[D] = {openingWidth / 2., gapWidth / 2.,
176164
gapHeight + openingDepth + gridDelta};
177165
viennals::MakeGeometry<NumericType, D>(
178-
vertBox,
179-
SmartPointer<viennals::Box<NumericType, D>>::New(minPoint, maxPoint))
166+
vertBox, viennals::Box<NumericType, D>::New(minPoint, maxPoint))
180167
.apply();
181168

182169
domain->applyBooleanOperation(
183170
vertBox, viennals::BooleanOperationEnum::RELATIVE_COMPLEMENT);
184171
}
185172

186173
{
187-
auto horiBox = SmartPointer<viennals::Domain<NumericType, D>>::New(
188-
domain->getGrid());
174+
auto horiBox = viennals::Domain<NumericType, D>::New(domain->getGrid());
189175
NumericType minPoint[D] = {openingWidth / 2. - gridDelta, -gapWidth / 2.,
190176
0.};
191177
NumericType maxPoint[D] = {openingWidth / 2. + gapLength, gapWidth / 2.,
192178
gapHeight};
193179
viennals::MakeGeometry<NumericType, D>(
194-
horiBox,
195-
SmartPointer<viennals::Box<NumericType, D>>::New(minPoint, maxPoint))
180+
horiBox, viennals::Box<NumericType, D>::New(minPoint, maxPoint))
196181
.apply();
197182

198183
domain->applyBooleanOperation(

examples/blazedGratingsEtching/blazedGratingsGeometry.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ auto GenerateMask(const NumericType bumpWidth, const NumericType bumpHeight,
2020

2121
MakePlane<NumericType, D>(domain, 0., Material::SiO2).apply();
2222

23-
auto mask =
24-
SmartPointer<viennals::Domain<NumericType, D>>::New(domain->getGrid());
23+
auto mask = viennals::Domain<NumericType, D>::New(domain->getGrid());
2524

2625
// parabolic masks
2726
const double offset = -xExtent / 2. + bumpSpacing + bumpWidth / 2.;
2827

29-
auto mesh = SmartPointer<viennals::Mesh<NumericType>>::New();
28+
auto mesh = viennals::Mesh<NumericType>::New();
3029

3130
constexpr int numNodes = 100;
3231
for (unsigned i = 0; i < numNodes; i++) {
@@ -40,8 +39,7 @@ auto GenerateMask(const NumericType bumpWidth, const NumericType bumpHeight,
4039
mesh->insertNextLine({numNodes - 1, 0});
4140

4241
for (int i = 0; i < numBumps; i++) {
43-
auto tip =
44-
SmartPointer<viennals::Domain<NumericType, D>>::New(domain->getGrid());
42+
auto tip = viennals::Domain<NumericType, D>::New(domain->getGrid());
4543
viennals::FromSurfaceMesh<NumericType, D>(tip, mesh).apply();
4644
viennals::TransformMesh<NumericType>(
4745
mesh, viennals::TransformEnum::TRANSLATION,

examples/exampleProcess/surfaceModel.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class SurfaceModel : public viennaps::SurfaceModel<NumericType> {
1111
void initializeCoverages(unsigned numGeometryPoints) override {
1212
std::vector<NumericType> someCoverages(numGeometryPoints, 0);
1313

14-
coverages = viennaps::SmartPointer<viennals::PointData<NumericType>>::New();
14+
coverages = viennals::PointData<NumericType>::New();
1515
coverages->insertNextScalarData(someCoverages, "coverages");
1616
}
1717

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Config file for a selective epitaxy example
22
# Domain
3-
gridDelta=0.72
3+
gridDelta=0.2
44
xExtent=40.0
55
yExtent=80.0
66

77
# Geometry
8-
finWidth=10.0
9-
finHeight=10.0
8+
finWidth=7.0
9+
finHeight=12.0
1010
finLength=60.0
11+
oxideHeight=3.0
1112

1213
# Process
13-
processTime=20.
14-
epitaxyRate=10.
14+
processTime=5.
15+
epitaxyRate=15.

examples/selectiveEpitaxy/selectiveEpitaxy.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#include <geometries/psMakePlane.hpp>
22
#include <models/psAnisotropicProcess.hpp>
33
#include <psProcess.hpp>
4-
#include <psUtil.hpp>
54

65
namespace ps = viennaps;
76
namespace ls = viennals;
87

98
int main(int argc, char *argv[]) {
109
using NumericType = double;
11-
constexpr int D = 3;
10+
constexpr int D = 2;
1211

1312
// Parse the parameters
1413
ps::util::Parameters params;
@@ -19,12 +18,10 @@ int main(int argc, char *argv[]) {
1918
return 1;
2019
}
2120

22-
auto geometry = ps::SmartPointer<ps::Domain<NumericType, D>>::New();
21+
auto geometry = ps::Domain<NumericType, D>::New(
22+
params.get("gridDelta"), params.get("xExtent"), params.get("yExtent"));
2323
// substrate
24-
ps::MakePlane<NumericType, D>(geometry, params.get("gridDelta"),
25-
params.get("xExtent"), params.get("yExtent"),
26-
0., false, ps::Material::Mask)
27-
.apply();
24+
ps::MakePlane<NumericType, D>(geometry, 0., ps::Material::Si, false).apply();
2825
// create fin on substrate
2926
{
3027
auto fin =
@@ -42,10 +39,13 @@ int main(int argc, char *argv[]) {
4239
ls::MakeGeometry<NumericType, D>(
4340
fin, ps::SmartPointer<ls::Box<NumericType, D>>::New(minPoint, maxPoint))
4441
.apply();
45-
geometry->insertNextLevelSetAsMaterial(fin, ps::Material::Si);
46-
geometry->saveSurfaceMesh("fin.vtp");
42+
geometry->applyBooleanOperation(fin, viennals::BooleanOperationEnum::UNION);
4743
}
4844

45+
ps::MakePlane<NumericType, D>(geometry, params.get("oxideHeight"),
46+
ps::Material::SiO2, true)
47+
.apply();
48+
4949
// copy top layer to capture deposition
5050
geometry->duplicateTopLevelSet(ps::Material::SiGe);
5151

examples/selectiveEpitaxy/selectiveEpitaxy.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,25 @@
1313
if args.dim == 2:
1414
print("Running 2D simulation.")
1515
import viennaps2d as vps
16-
import viennals2d as vls
1716
else:
1817
print("Running 3D simulation.")
1918
import viennaps3d as vps
20-
import viennals3d as vls
2119

2220
params = vps.ReadConfigFile(args.filename)
2321

24-
geometry = vps.Domain()
22+
geometry = vps.Domain(
23+
gridDelta=params["gridDelta"], xExtent=params["xExtent"], yExtent=params["yExtent"]
24+
)
2525
vps.MakePlane(
26-
domain=geometry,
27-
gridDelta=params["gridDelta"],
28-
xExtent=params["xExtent"],
29-
yExtent=params["yExtent"],
30-
height=0.0,
31-
periodicBoundary=False,
32-
material=vps.Material.Mask,
26+
domain=geometry, height=0.0, material=vps.Material.Si, addToExisting=False
3327
).apply()
3428

35-
fin = vls.Domain(geometry.getLevelSets()[-1])
29+
fin = vps.ls.Domain(geometry.getLevelSets()[-1])
3630

3731
if args.dim == 3:
38-
vls.MakeGeometry(
32+
vps.ls.MakeGeometry(
3933
fin,
40-
vls.Box(
34+
vps.ls.Box(
4135
[
4236
-params["finWidth"] / 2.0,
4337
-params["finLength"] / 2.0,
@@ -47,9 +41,9 @@
4741
),
4842
).apply()
4943
else:
50-
vls.MakeGeometry(
44+
vps.ls.MakeGeometry(
5145
fin,
52-
vls.Box(
46+
vps.ls.Box(
5347
[
5448
-params["finWidth"] / 2.0,
5549
-params["gridDelta"],
@@ -58,7 +52,16 @@
5852
),
5953
).apply()
6054

61-
geometry.insertNextLevelSetAsMaterial(fin, vps.Material.Si)
55+
geometry.applyBooleanOperation(fin, vps.ls.BooleanOperationEnum.UNION)
56+
57+
geometry.saveVolumeMesh("fin")
58+
59+
vps.MakePlane(
60+
domain=geometry,
61+
height=params["oxideHeight"],
62+
material=vps.Material.SiO2,
63+
addToExisting=True,
64+
).apply()
6265

6366
# copy top layer to capture deposition
6467
geometry.duplicateTopLevelSet(vps.Material.SiGe)
@@ -75,7 +78,7 @@
7578
process.setProcessModel(model)
7679
process.setProcessDuration(params["processTime"])
7780
process.setIntegrationScheme(
78-
vls.IntegrationSchemeEnum.STENCIL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER
81+
vps.ls.IntegrationSchemeEnum.STENCIL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER
7982
)
8083

8184
geometry.saveVolumeMesh("initial")

gpu/benchmark/CPU_Benchmark.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ int main() {
2424

2525
auto domain = MAKE_GEO<NumericType>();
2626

27-
auto mesh = SmartPointer<viennals::Mesh<NumericType>>::New();
27+
auto mesh = viennals::Mesh<NumericType>::New();
2828
viennals::ToDiskMesh<NumericType, D> mesher(mesh);
2929

3030
viennaray::Trace<NumericType, D> tracer;

gpu/benchmark/CPU_Benchmark_single.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ int main() {
2020

2121
auto domain = MAKE_GEO<NumericType>();
2222

23-
auto mesh = SmartPointer<viennals::Mesh<NumericType>>::New();
23+
auto mesh = viennals::Mesh<NumericType>::New();
2424
viennals::ToDiskMesh<NumericType, D> mesher(mesh);
2525

2626
viennaray::Trace<NumericType, D> tracer;

0 commit comments

Comments
 (0)