Skip to content

Commit

Permalink
DirectionalEtching visibility with Python wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
tobre1 committed Nov 21, 2024
1 parent 4503414 commit d45d078
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/stackEtching/stackEtching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) {

ps::Vec3D<NumericType> direction = {0., -1., 0.};
auto model = ps::SmartPointer<ps::DirectionalEtching<NumericType, D>>::New(
direction, 1., 0.);
direction, 1., 0., true, ps::Material::Mask);

// process setup
ps::Process<NumericType, D> process;
Expand Down
2 changes: 1 addition & 1 deletion include/viennaps/models/psDirectionalEtching.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class DirectionalEtching : public ProcessModel<NumericType, D> {
DirectionalEtching(const Vec3D<NumericType> &direction,
const NumericType directionalVelocity,
const NumericType isotropicVelocity,
const bool useVisibilities = false,
const bool useVisibilities,
const std::vector<Material> maskMaterials) {
// default surface model
auto surfModel = SmartPointer<SurfaceModel<NumericType>>::New();
Expand Down
5 changes: 3 additions & 2 deletions include/viennaps/psProcess.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,10 @@ template <typename NumericType, int D> class Process {
viennals::CalculateVisibilities<NumericType, D>(
domain->getLevelSets().back())
.apply();
model->getVelocityField()->setVisibilities(
domain->getLevelSets().back()->getPointData().getScalarData(
auto visibilities = SmartPointer<std::vector<NumericType>>::New(
*domain->getLevelSets().back()->getPointData().getScalarData(
"Visibilities"));
model->getVelocityField()->setVisibilities(visibilities);
}

auto rates = SmartPointer<viennals::PointData<NumericType>>::New();
Expand Down
8 changes: 5 additions & 3 deletions python/pyWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,15 +844,17 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) {
SmartPointer<DirectionalEtching<T, D>>>(
module, "DirectionalEtching", processModel)
.def(pybind11::init<const std::array<T, 3> &, const T, const T,
const Material>(),
const bool, const Material>(),
pybind11::arg("direction"),
pybind11::arg("directionalVelocity") = 1.,
pybind11::arg("isotropicVelocity") = 0.,
pybind11::arg("useVisibilities") = false,
pybind11::arg("maskMaterial") = Material::None)
.def(pybind11::init<const std::array<T, 3> &, const T, const T,
const std::vector<Material>>(),
const bool, const std::vector<Material>>(),
pybind11::arg("direction"), pybind11::arg("directionalVelocity"),
pybind11::arg("isotropicVelocity"), pybind11::arg("maskMaterial"));
pybind11::arg("isotropicVelocity"), pybind11::arg("useVisibilities"),
pybind11::arg("maskMaterial"));

// Sphere Distribution
pybind11::class_<SphereDistribution<T, D>,
Expand Down
4 changes: 2 additions & 2 deletions tests/directionalEtch/directionalEtch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ template <class NumericType, int D> void RunTest() {
Vec3D<NumericType> direction{0., 0., 0.};
direction[D - 1] = -1.;
auto model = SmartPointer<DirectionalEtching<NumericType, D>>::New(
direction, 1., 0., Material::Mask);
direction, 1., 0., false, Material::Mask);

VC_TEST_ASSERT(model->getSurfaceModel());
VC_TEST_ASSERT(model->getVelocityField());
Expand All @@ -45,7 +45,7 @@ template <class NumericType, int D> void RunTest() {
Vec3D<NumericType> direction{0., 0., 0.};
direction[D - 1] = -1.;
auto model = SmartPointer<DirectionalEtching<NumericType, D>>::New(
direction, 1., 0., maskMaterials);
direction, 1., 0., true, maskMaterials);

VC_TEST_ASSERT(model->getSurfaceModel());
VC_TEST_ASSERT(model->getVelocityField());
Expand Down

0 comments on commit d45d078

Please sign in to comment.