Electromagnetic Template Library (EMTL)
Loading...
Searching...
No Matches
Object of experiment (uiPyExperiment)

'uiPyExperiment` is a class for setting and conducting FDTD numerical experiments.

The simulation domain is set with the uiExperiment function::Set Internal Space(). In this case, the FDTD grid size for each direction is calculated as the simulation domain size divided by the grid step. The grid step can be set explicitly with the uiExperiment function::SetResolution(). Conversely, the uiExperiment function::SetResolutionN() explicitly sets the grid size, i.e., the number of steps along the grid in each direction.

Some data for calculation is packed in EMTL, the maximum possible memory size in bytes that may be needed for calculation can be calculated as the full grid size multiplied by 64 (for the EMTL version with double precision).

When setting up the simulation domain, the following is advisable:

  • at least 10-20 time steps should fit into the characteristic wavelength;
  • the size of the object must be at least 2-5 spatial steps;
  • the Courant factor should be approximately 0.5;
  • the size of the memory required for the calculation does not exceed the available RAM.

Important members and methods of the class:

  • this->SetMainBlockTypeId(int type) - ????.
  • this->SetInternalSpace(const Vector_3 &p1_, const Vector_3 &p2_) - sets the location of the internal computing volume (excluding PMLs and the space needed to calculate the inclined drop). The form of the computational volume is a paralleliped. Its opposite angles are given in the argument. Along the axes, you can set the zero size by lowering the dimension of the problem.
  • this->SetResolution(valtype dx, valtype dy, valtype dz, valtype courant_=-1) - set the grid pitch for each axis and the Courant factor.
  • this->SetInternalMeshSize(int nx=-1, int ny=-1, int nz=-1, valtype courant_=-1) - set the number of grid steps along each axis (for internal volume) and the Courant factor.
  • this->SetCourant(valtype courant_=0.5) - sets the Courant factor.
  • this->SetCourant(valtype courant_=0.5) - sets the Courant factor.
  • this->SetBC(int bc_x, int bc_y, int bc_z) - set boundary conditions for the corresponding axes. (The following values are possible: BC_PER (intermittent), BC_PML (absorbing), BC_REFL (reflecting). In the case of an oblique fall of k, periodic boundaries not parallel to k are used for itrative notation. Default boundary conditions: periodic in x- and y- and PML in z-directions.)
  • this->AddTFSFPlane(valtype dx, valtype dy, valtype dz, valtype dir=1.f) - create a source in the form of a flat TF/SF interface (TF is where the wave goes).
  • this->AddTFSFPlane(const Vector_3 &n, const Vector_3 &pos) - create a source in the form of a flat TF/SF interface this plane is defined by a point and a normal.
  • this->AddTFSFBox(const Vector_3 &v0, const Vector_3 &v1) - Create a source with a radiating surface defined by a cube.
  • this->SetSignal(emImpulse *impulse, int managed=1, int srcid=-1) - set the waveform for the source.
  • this->SetFarField(int sph_rank, int time_max, int tile_sz=16, const char *path="") - includes the calculation of the far field in the time domain sph_rank - the rank of the grid in directions based on the partition of the pentakisdodecahedron.
  • this->SetFarFieldBasis(Vector_3 n_theta, Vector_3 n_phi) - sets the spherical coordinate system in which all postprocessing will be performed.
  • this->Analyze(int an=0x2, const std::string &lbl="", int nobl=0) - starts processing the results.
  • this->DumpMedium(const char *fname, const emMedium &med) - output to a file named 'fname' of the dielectric constant of the material 'med'.
  • `this->Calculate(valtype t1, valtype t2) - starts calculation with duration t2, time t1 is fictitious.