-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#include <geometries/psMakeTrench.hpp> | ||
#include <psUtils.hpp> | ||
|
||
// #include <psProcess.hpp> | ||
// #include <pscuProcess.hpp> | ||
#include <curtIndexMap.hpp> | ||
#include <curtTracer.hpp> | ||
#include <pscuProcessPipelines.hpp> | ||
|
||
using namespace viennaps; | ||
|
||
int main(int argc, char **argv) { | ||
|
||
omp_set_num_threads(16); | ||
constexpr int D = 3; | ||
using NumericType = float; | ||
|
||
gpu::Context context; | ||
gpu::CreateContext(context); | ||
Logger::setLogLevel(LogLevel::DEBUG); | ||
|
||
const NumericType gridDelta = 1.; | ||
const NumericType extent = 100.; | ||
const NumericType trenchWidth = 15.; | ||
const NumericType spacing = 20.; | ||
const NumericType maskHeight = 40.; | ||
|
||
const NumericType time = 3.; | ||
const NumericType sticking = 1.0; | ||
const NumericType exponent = 1000; | ||
const int raysPerPoint = 3000; | ||
|
||
auto domain = SmartPointer<Domain<NumericType, D>>::New(); | ||
MakeTrench<NumericType, D>(domain, gridDelta, extent, extent, trenchWidth, | ||
maskHeight, 0., 0., false, true, Material::Si) | ||
.apply(); | ||
domain->saveSurfaceMesh("trench_initial.vtp"); | ||
|
||
gpu::Particle<NumericType> particle{.name = "SingleParticle", | ||
.sticking = sticking, | ||
.cosineExponent = exponent}; | ||
particle.dataLabels.push_back("flux"); | ||
|
||
gpu::Tracer<NumericType, D> rayTrace(context, domain); | ||
rayTrace.setPipeline(embedded_SingleParticle_pipeline); | ||
rayTrace.setNumberOfRaysPerPoint(raysPerPoint); | ||
rayTrace.setUseRandomSeed(false); | ||
rayTrace.setPeriodicBoundary(false); | ||
rayTrace.insertNextParticle(particle); | ||
auto numRates = rayTrace.prepareParticlePrograms(); | ||
auto fluxesIndexMap = gpu::IndexMap(rayTrace.getParticles()); | ||
|
||
rayTrace.updateSurface(); // also creates mesh | ||
auto numElements = rayTrace.getNumberOfElements(); | ||
|
||
rayTrace.apply(); | ||
|
||
auto mesh = rayTrace.getSurfaceMesh(); | ||
std::vector<NumericType> flux(numElements); | ||
rayTrace.getFlux(flux.data(), 0, 0); | ||
|
||
mesh->getCellData().insertNextScalarData(flux, "flux"); | ||
|
||
viennals::VTKWriter<NumericType>(mesh, "trench_flux.vtp").apply(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters