Skip to content

Commit

Permalink
Added individual rates/masks in single process
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Nov 22, 2024
1 parent ac62472 commit 19c95f9
Show file tree
Hide file tree
Showing 806 changed files with 266,442 additions and 123 deletions.
97 changes: 97 additions & 0 deletions examples/boschProcess/boschProcessCombinedEmulate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
from argparse import ArgumentParser

# parse config file name and simulation dimension
parser = ArgumentParser(
prog="boschProcessEmulate",
description="Run a Bosch process on a trench geometry.",
)
parser.add_argument("-D", "-DIM", dest="dim", type=int, default=2)
parser.add_argument("filename")
args = parser.parse_args()

# switch between 2D and 3D mode
if args.dim == 2:
print("Running 2D simulation.")
import viennaps2d as vps
else:
print("Running 3D simulation.")
import viennaps3d as vps

params = vps.ReadConfigFile(args.filename)
vps.Logger.setLogLevel(vps.LogLevel.INFO)

geometry = vps.Domain()
vps.MakeTrench(
domain=geometry,
gridDelta=params["gridDelta"],
xExtent=params["xExtent"],
yExtent=params["yExtent"],
trenchWidth=params["trenchWidth"],
trenchDepth=params["maskHeight"],
taperingAngle=0.0,
baseHeight=0.0,
periodicBoundary=False,
makeMask=True,
material=vps.Material.Si,
).apply()

direction = [0.0, 0.0, 0.0]
direction[vps.D - 1] = -1.0

depoModel = vps.IsotropicProcess(params["depositionThickness"])

# Define directional rate
etchDir = vps.RateSet(
direction=direction,
directionalVelocity=params["ionRate"],
isotropicVelocity=0.0,
maskMaterials=[vps.Material.Mask]
)

# Define isotropic rate
etchIso = vps.RateSet(
direction=direction,
directionalVelocity=0.0,
isotropicVelocity=params["neutralRate"],
maskMaterials=[vps.Material.Mask, vps.Material.Polymer]
)

# List of rate sets
etchRatesSet = [etchDir, etchIso]

# Create the DirectionalEtching process with multiple rate sets
etchModel = vps.DirectionalEtching(rateSets=etchRatesSet)

numCycles = 4 #int(params["numCycles"])
n = 0

geometry.saveSurfaceMesh("boschProcessC_{}".format(n))
geometry.saveVolumeMesh(f"boschProcessC_{n}")
n += 1

vps.Process(geometry, etchModel, params["etchTime"]).apply()
geometry.saveSurfaceMesh("boschProcessC_{}".format(n))
geometry.saveVolumeMesh(f"boschProcessC_{n}")
n += 1

for i in range(numCycles):
# Deposit a layer of polymer
geometry.duplicateTopLevelSet(vps.Material.Polymer)
vps.Process(geometry, depoModel, 1.).apply()
geometry.saveSurfaceMesh("boschProcessC_{}".format(n))
geometry.saveVolumeMesh(f"boschProcessC_{n}")
n += 1

# Etch the trench
vps.Process(geometry, etchModel, params["etchTime"]).apply()
geometry.saveSurfaceMesh("boschProcessC_{}".format(n))
geometry.saveVolumeMesh(f"boschProcessC_{n}")
n += 1

# Ash the polymer
geometry.removeTopLevelSet()
geometry.saveSurfaceMesh("boschProcessC_{}".format(n))
geometry.saveVolumeMesh(f"boschProcessC_{n}")
n += 1

geometry.saveVolumeMesh("finalC")
30 changes: 19 additions & 11 deletions examples/boschProcess/boschProcessEmulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,27 @@
direction[vps.D - 1] = -1.0

depoModel = vps.IsotropicProcess(params["depositionThickness"])
depoRemoval = vps.DirectionalEtching(
direction,
params["depositionThickness"] + params["gridDelta"] / 2.0,
0.0,
vps.Material.Mask,

# Define directional rate
etchDir = vps.RateSet(
direction=direction,
directionalVelocity=params["depositionThickness"] + params["gridDelta"] / 2.0,
isotropicVelocity=0.0,
maskMaterials=[vps.Material.Mask]
)
etchModel = vps.DirectionalEtching(
direction,
params["ionRate"],
params["neutralRate"],
[vps.Material.Mask, vps.Material.Polymer],

# Define isotropic rate
etchIso = vps.RateSet(
direction=direction,
directionalVelocity=params["ionRate"],
isotropicVelocity=params["neutralRate"],
maskMaterials=[vps.Material.Mask, vps.Material.Polymer]
)

depoRemoval = vps.DirectionalEtching(rateSets=[etchDir])

etchModel = vps.DirectionalEtching(rateSets=[etchIso])

numCycles = int(params["numCycles"])
n = 0

Expand Down Expand Up @@ -85,4 +93,4 @@
geometry.saveSurfaceMesh("boschProcess_{}".format(n))
n += 1

geometry.saveVolumeMesh("final")
geometry.saveVolumeMesh("final")
Binary file added examples/boschProcess/output/output.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0012.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0013.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0014.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0015.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0016.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0017.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0018.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0019.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0020.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0021.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0022.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0023.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/boschProcess/output2/example2.0024.png
Binary file added examples/boschProcess/output2/example2.0025.png
Binary file added examples/boschProcess/output2/example2.0026.png
Binary file added examples/boschProcess/output2/example2.0027.png
Binary file added examples/boschProcess/output2/example2.0028.png
Binary file added examples/boschProcess/output2/example2.0029.png
Binary file added examples/boschProcess/output2/example2.0030.png
Binary file added examples/boschProcess/output2/example2.0031.png
Binary file added examples/boschProcess/output2/example2.0032.png
Binary file added examples/boschProcess/output2/example2.0033.png
Binary file added examples/boschProcess/output2/example2.0034.png
Binary file added examples/boschProcess/output2/example2.0035.png
Binary file added examples/boschProcess/output2/example2.0036.png
Binary file added examples/boschProcess/output2/example2.0037.png
Binary file added examples/boschProcess/output2/example2.0038.png
Binary file added examples/boschProcess/output2/example2.0039.png
Binary file added examples/boschProcess/output2/example2.0040.png
Binary file added examples/boschProcess/output2/example2.0041.png
Binary file added examples/boschProcess/output2/example2.0042.png
Binary file added examples/boschProcess/output2/example2.0043.png
Binary file added examples/boschProcess/output2/output2.gif
214 changes: 118 additions & 96 deletions include/viennaps/models/psDirectionalEtching.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,130 +4,152 @@
#include "../psProcessModel.hpp"

#include <vcVectorUtil.hpp>
#include <vector>
#include <algorithm>

namespace viennaps {

using namespace viennacore;

namespace impl {

template <class NumericType, int D>
struct RateSet {
Vec3D<NumericType> direction;
NumericType directionalVelocity;
NumericType isotropicVelocity;
std::vector<int> maskMaterials;

RateSet(const Vec3D<NumericType>& dir,
NumericType dirVel,
NumericType isoVel,
const std::vector<int>& masks)
: direction(dir), directionalVelocity(dirVel),
isotropicVelocity(isoVel), maskMaterials(masks) {}
};

template <class NumericType, int D>
class DirectionalEtchVelocityField : public VelocityField<NumericType> {
const Vec3D<NumericType> direction_;
const NumericType directionalVelocity_;
const NumericType isotropicVelocity_;
const std::vector<int> maskMaterials_;
const bool useVisibilities_;
const std::vector<RateSet<NumericType, D>> rateSets_;
const bool useVisibilities_;

public:
DirectionalEtchVelocityField(Vec3D<NumericType> direction,
const NumericType directionalVelocity,
const NumericType isotropicVelocity,
const std::vector<int> &mask,
const bool useVisibilities)
: direction_(direction), directionalVelocity_(directionalVelocity),
isotropicVelocity_(isotropicVelocity), maskMaterials_(mask),
useVisibilities_(useVisibilities) {}

NumericType getScalarVelocity(const Vec3D<NumericType> &coordinate,
int material,
const Vec3D<NumericType> &normalVector,
unsigned long pointId) override {
if (isMaskMaterial(material)) {
return 0.;
} else {
return -isotropicVelocity_;
DirectionalEtchVelocityField(const std::vector<RateSet<NumericType, D>>& rateSets,
const bool useVisibilities)
: rateSets_(rateSets), useVisibilities_(useVisibilities) {}

NumericType getScalarVelocity(const Vec3D<NumericType>& coordinate,
int material,
const Vec3D<NumericType>& normalVector,
unsigned long pointId) override {
NumericType scalarVelocity = 0.0;

for (const auto& rateSet : rateSets_) {
if (isMaskMaterial(material, rateSet.maskMaterials)) {
continue; // Skip this rate set if material is masked
}
// Accumulate isotropic velocities
scalarVelocity -= rateSet.isotropicVelocity;
}

return scalarVelocity;
}
}

Vec3D<NumericType> getVectorVelocity(const Vec3D<NumericType> &coordinate,
int material,
const Vec3D<NumericType> &normalVector,
unsigned long pointId) override {
if (isMaskMaterial(material)) {
return {0.};
} else if (useVisibilities_ && this->visibilities_->at(pointId) == 0.) {
return {0.};
} else {
return direction_ * directionalVelocity_;

Vec3D<NumericType> getVectorVelocity(const Vec3D<NumericType>& coordinate,
int material,
const Vec3D<NumericType>& normalVector,
unsigned long pointId) override {
Vec3D<NumericType> vectorVelocity = {0.0, 0.0, 0.0};

for (const auto& rateSet : rateSets_) {
if (isMaskMaterial(material, rateSet.maskMaterials)) {
continue; // Skip this rate set if material is masked
}
if (useVisibilities_ && this->visibilities_->at(pointId) == 0.) {
continue; // Skip if visibility check fails
}
// Accumulate directional velocities
vectorVelocity = vectorVelocity + rateSet.direction * rateSet.directionalVelocity;
}

return vectorVelocity;
}
}

// the translation field should be disabled when using a surface model
// which only depends on an analytic velocity field
int getTranslationFieldOptions() const override { return 0; }
// The translation field should be disabled when using a surface model
// which only depends on an analytic velocity field
int getTranslationFieldOptions() const override { return 0; }

bool useVisibilities() const override { return useVisibilities_; }
bool useVisibilities() const override { return useVisibilities_; }

private:
bool isMaskMaterial(const int material) const {
for (const auto &mat : maskMaterials_) {
if (material == mat)
return true;
bool isMaskMaterial(const int material, const std::vector<int>& maskMaterials) const {
return std::find(maskMaterials.begin(), maskMaterials.end(), material) != maskMaterials.end();
}
return false;
}
};

} // namespace impl

/// Directional etching with one masking material.
/// Directional etching with multiple rate sets and masking materials.
template <typename NumericType, int D>
class DirectionalEtching : public ProcessModel<NumericType, D> {
public:
DirectionalEtching(const Vec3D<NumericType> &direction,
const NumericType directionalVelocity = 1.,
const NumericType isotropicVelocity = 0.,
const Material mask = Material::Mask)
: direction_(direction), directionalVelocity_(directionalVelocity),
isotropicVelocity_(isotropicVelocity) {
if (mask != Material::None)
maskMaterials_.push_back(static_cast<int>(mask));
initialize(direction_, directionalVelocity_, isotropicVelocity_, true,
maskMaterials_);
}

DirectionalEtching(const Vec3D<NumericType> &direction,
const NumericType directionalVelocity,
const NumericType isotropicVelocity,
const std::vector<Material> maskMaterials)
: direction_(direction), directionalVelocity_(directionalVelocity),
isotropicVelocity_(isotropicVelocity) {
for (const auto &mat : maskMaterials) {
maskMaterials_.push_back(static_cast<int>(mat));
struct RateSet {
Vec3D<NumericType> direction;
NumericType directionalVelocity;
NumericType isotropicVelocity;
std::vector<Material> maskMaterials;

RateSet(const Vec3D<NumericType>& dir,
NumericType dirVel,
NumericType isoVel,
const std::vector<Material>& masks)
: direction(dir), directionalVelocity(dirVel),
isotropicVelocity(isoVel), maskMaterials(masks) {}
};

/// Constructor accepting multiple rate sets
DirectionalEtching(const std::vector<RateSet>& rateSets,
const bool useVisibilities = true)
: useVisibilities_(useVisibilities) {
// Convert RateSet materials from Material enum to int
for (const auto& rs : rateSets) {
std::vector<int> maskInts;
for (const auto& mat : rs.maskMaterials) {
maskInts.push_back(static_cast<int>(mat));
}
impl::RateSet<NumericType, D> internalRateSet(
rs.direction,
rs.directionalVelocity,
rs.isotropicVelocity,
maskInts
);
rateSets_.push_back(internalRateSet);
}
initialize();
}
initialize(direction_, directionalVelocity_, isotropicVelocity_, true,
maskMaterials_);
}

void disableVisibilityCheck() {
initialize(direction_, directionalVelocity_, isotropicVelocity_, false,
maskMaterials_);
}
void disableVisibilityCheck() {
useVisibilities_ = false;
initialize();
}

private:
void initialize(const Vec3D<NumericType> &direction,
const NumericType directionalVelocity,
const NumericType isotropicVelocity,
const bool useVisibilities,
const std::vector<int> &maskMaterials) {
// default surface model
auto surfModel = SmartPointer<SurfaceModel<NumericType>>::New();

// velocity field
auto velField =
SmartPointer<impl::DirectionalEtchVelocityField<NumericType, D>>::New(
direction, directionalVelocity, isotropicVelocity, maskMaterials,
useVisibilities);

this->setSurfaceModel(surfModel);
this->setVelocityField(velField);
this->setProcessName("DirectionalEtching");
}
void initialize() {
// Default surface model
auto surfModel = SmartPointer<SurfaceModel<NumericType>>::New();

// Velocity field with multiple rate sets
auto velField =
SmartPointer<impl::DirectionalEtchVelocityField<NumericType, D>>::New(
rateSets_, useVisibilities_);

this->setSurfaceModel(surfModel);
this->setVelocityField(velField);
this->setProcessName("DirectionalEtching");
}

private:
Vec3D<NumericType> direction_;
NumericType directionalVelocity_;
NumericType isotropicVelocity_;
std::vector<int> maskMaterials_;
std::vector<impl::RateSet<NumericType, D>> rateSets_;
bool useVisibilities_;
};

} // namespace viennaps
Loading

0 comments on commit 19c95f9

Please sign in to comment.