PLaSK library
|
Solver performing calculations in 2D Cartesian space using effective index method. More...
#include <solvers/optical/effective/efm.hpp>
Classes | |
struct | FieldR |
struct | FieldZ |
struct | MatrixR |
struct | MatrixZ |
struct | Mode |
Details of the computed mode. More... | |
Public Types | |
enum | Emission { TOP , BOTTOM } |
Direction of the possible emission. More... | |
enum | Determinant { DETERMINANT_INWARDS , DETERMINANT_OUTWARDS , DETERMINANT_FULL } |
Radial determinant modes. More... | |
Public Types inherited from plask::SolverWithMesh< Geometry2DCylindrical, RectangularMesh< 2 > > | |
typedef RectangularMesh< 2 > | MeshType |
Type of the mesh for this solver. | |
Public Types inherited from plask::SolverOver< SpaceT > | |
typedef SpaceT | SpaceType |
of the space for this solver | |
Public Member Functions | |
dcomplex | freqv (dcomplex lam) |
Convert wavelength to the frequency parameter. | |
dcomplex | lambda (dcomplex freq) |
Convert frequency parameter to the wavelength. | |
int | getStripe () const |
Return the main stripe number. | |
void | setStripe (int stripe) |
Set stripe for computations. | |
double | getStripeR () const |
Get position of the main stripe. | |
void | setStripeR (double r=0.) |
Set position of the main stripe. | |
void | useAllStripes () |
Use all stripes. | |
dcomplex | getDeltaNeff (double r) |
Return radial effective index part at specified position. | |
dcomplex | getNNg (double r) |
Return effective index at specified position. | |
EffectiveFrequencyCyl (const std::string &name="") | |
virtual | ~EffectiveFrequencyCyl () |
std::string | getClassName () const override |
Get name of solver. | |
std::string | getClassDescription () const override |
Get a description of this solver. | |
void | loadConfiguration (plask::XMLReader &reader, plask::Manager &manager) override |
Load configuration from given source . | |
Emission | getEmission () const |
Get emission direction. | |
void | setEmission (Emission emis) |
Set emission direction. | |
void | setSimpleMesh () |
Set the simple mesh based on the geometry bounding boxes. | |
void | setHorizontalMesh (shared_ptr< MeshAxis > meshx) |
Set up the horizontal mesh. | |
bool | getAsymptotic () const |
Get asymptotic flag. | |
void | setAsymptotic (bool value) |
Set asymptotic flag. | |
size_t | findMode (dcomplex lambda, int m=0) |
Find the mode around the specified effective wavelength. | |
std::vector< size_t > | findModes (plask::dcomplex lambda1=0., plask::dcomplex lambda2=0., int m=0, size_t resteps=256, size_t imsteps=64, dcomplex eps=dcomplex(1e-6, 1e-9)) |
Find the modes within the specified range. | |
dcomplex | getVertDeterminant (dcomplex vlambda) |
Compute vectical modal determinant. | |
dcomplex | getDeterminant (dcomplex lambda, int m=0) |
Compute modal determinant for the whole matrix. | |
size_t | setMode (dcomplex clambda, int m=0) |
Set particular value of the effective wavelength, e.g. | |
size_t | setMode (double lambda, double loss, int m=0) |
Set particular value of the effective wavelength, e.g. | |
void | clearModes () |
Clear computed modes. | |
double | getTotalAbsorption (Mode &mode) |
Return total amount of energy absorbed by the matter in a unit time. | |
double | getTotalAbsorption (size_t num) |
Return total amount of energy absorbed by the matter in a unit time. | |
double | getGainIntegral (Mode &mode) |
Return total amount of energy generated in the gain region in a unit time. | |
double | getGainIntegral (size_t num) |
Return total amount of energy absorbed by the matter in a unit time. | |
Public Member Functions inherited from plask::SolverWithMesh< Geometry2DCylindrical, RectangularMesh< 2 > > | |
SolverWithMesh (const std::string &name="") | |
~SolverWithMesh () | |
void | loadConfiguration (XMLReader &source, Manager &manager) override |
Load configuration from given source . | |
void | parseStandardConfiguration (XMLReader &source, Manager &manager, const std::string &expected_msg="solver configuration element") |
virtual void | onMeshChange (const typename MeshT::Event &PLASK_UNUSED(evt)) |
This method is called just after the mesh has been changed. | |
void | onGeometryChange (const Geometry::Event &PLASK_UNUSED(evt)) override |
This method is called when the geometry is changed. | |
RectangularMesh< 2 > & | meshRef () const |
Get current module mesh. | |
shared_ptr< RectangularMesh< 2 > > | getMesh () const |
Get current solver mesh. | |
void | setMesh (const shared_ptr< RectangularMesh< 2 > > &mesh) |
Set new mesh for the solver. | |
void | setMesh (shared_ptr< MeshGeneratorD< MeshT::DIM > > generator) |
Set new mesh got from generator. | |
Public Member Functions inherited from plask::SolverOver< SpaceT > | |
SolverOver (const std::string &name="") | |
~SolverOver () | |
void | parseStandardConfiguration (XMLReader &source, Manager &manager, const std::string &expected_msg="solver configuration element") |
virtual void | onGeometryChange (const Geometry::Event &) |
This method is called when the geometry is changed. | |
shared_ptr< SpaceT > | getGeometry () const |
Get current solver geometry space. | |
void | setGeometry (const shared_ptr< SpaceT > &geometry) |
Set new geometry for the solver. | |
Public Member Functions inherited from plask::Solver | |
bool | initCalculation () |
This should be called on beginning of each calculation method to ensure that solver will be initialized. | |
Solver (const std::string &name="") | |
Construct uninitialized solver. | |
virtual | ~Solver () |
Virtual destructor (for subclassing). Do nothing. | |
void | parseStandardConfiguration (XMLReader &source, Manager &manager, const std::string &expected_msg="solver configuration element") |
Load standard configuration (geometry, mesh) tags from source . | |
bool | isInitialized () |
Check if solver is already initialized. | |
void | invalidate () |
This method should be and is called if something important was changed: calculation space, mesh, etc. | |
std::string | getId () const |
Get solver id. | |
std::string | getName () const |
template<typename ArgT = double, typename ValT = double> | |
DataLog< ArgT, ValT > | dataLog (const std::string &chart_name, const std::string &axis_arg_name, const std::string &axis_val_name) |
template<typename ArgT = double, typename ValT = double> | |
DataLog< ArgT, ValT > | dataLog (const std::string &axis_arg_name, const std::string &axis_val_name) |
template<typename ... Args> | |
void | writelog (LogLevel level, std::string msg, Args &&... params) const |
Log a message for this solver. | |
Public Attributes | |
Determinant | determinant |
Radial determinant mode. | |
RootDigger::Params | root |
Parameters for horizontal root digger. | |
RootDigger::Params | stripe_root |
Parameters for vertical root diggers. | |
double | perr |
Allowed relative power integral precision. | |
dcomplex | k0 |
Current value of reference normalized frequency (1/µm) | |
dcomplex | vlam |
'Vertical wavelength' used as a helper for searching vertical modes | |
std::vector< Mode > | modes |
Computed modes. | |
ReceiverFor< Temperature, Geometry2DCylindrical > | inTemperature |
Receiver for the temperature. | |
ReceiverFor< Gain, Geometry2DCylindrical > | inGain |
Receiver for the gain. | |
ReceiverFor< CarriersConcentration, Geometry2DCylindrical > | inCarriersConcentration |
Receiver for the carriers concentration. | |
ProviderFor< ModeWavelength >::Delegate | outWavelength |
Provider for computed resonant wavelength. | |
ProviderFor< ModeLoss >::Delegate | outLoss |
Provider for computed modal extinction. | |
ProviderFor< ModeLightMagnitude, Geometry2DCylindrical >::Delegate | outLightMagnitude |
Provider of optical field. | |
ProviderFor< ModeLightE, Geometry2DCylindrical >::Delegate | outLightE |
Provider of optical field. | |
ProviderFor< RefractiveIndex, Geometry2DCylindrical >::Delegate | outRefractiveIndex |
Provider of refractive index. | |
ProviderFor< Heat, Geometry2DCylindrical >::Delegate | outHeat |
Provider of the heat absorbed/generated by the light. | |
Protected Member Functions | |
void | onInputChange (ReceiverBase &, ReceiverBase::ChangeReason) |
Slot called when gain has changed. | |
void | onInitialize () override |
Initialize the solver. | |
void | onInvalidate () override |
Invalidate the data. | |
void | updateCache () |
Update refractive index cache. | |
void | stageOne () |
Fist stage of computations Perform vertical computations. | |
dcomplex | detS1 (const dcomplex &v, const std::vector< dcomplex, aligned_allocator< dcomplex > > &NR, const std::vector< dcomplex, aligned_allocator< dcomplex > > &NG, std::vector< FieldZ > *saveto=nullptr) |
Return S matrix determinant for one stripe. | |
void | computeStripeNNg (size_t stripe, bool save_integrals=false) |
Compute stripe averaged n ng. | |
double | integrateBessel (Mode &mode) |
Integrate horizontal field. | |
void | computeBessel (size_t i, dcomplex v, const Mode &mode, dcomplex *J1, dcomplex *H1, dcomplex *J2, dcomplex *H2) |
Compute Bessel functions. | |
dcomplex | detS (const plask::dcomplex &lam, Mode &mode, bool save=false) |
Return S matrix determinant for the whole structure. | |
size_t | getMainStripe () |
Obtain main stripe. | |
size_t | insertMode (const Mode &mode) |
Insert mode to the list or return the index of the exiting one. | |
size_t | nmodes () const |
Return number of found modes. | |
double | getWavelength (size_t n) |
Return mode wavelength. | |
double | getModalLoss (size_t n) |
Return mode modal loss. | |
const LazyData< double > | getLightMagnitude (std::size_t num, const shared_ptr< const MeshD< 2 > > &dst_mesh, InterpolationMethod=INTERPOLATION_DEFAULT) |
Method computing the distribution of light intensity. | |
const LazyData< Vec< 3, dcomplex > > | getElectricField (std::size_t num, const shared_ptr< const plask::MeshD< 2 > > &dst_mesh, plask::InterpolationMethod=INTERPOLATION_DEFAULT) |
Method computing the distribution of the light electric field. | |
const LazyData< dcomplex > | getRefractiveIndex (RefractiveIndex::EnumType component, const shared_ptr< const MeshD< 2 > > &dst_mesh, dcomplex lam, InterpolationMethod=INTERPOLATION_DEFAULT) |
Get used refractive index. | |
const LazyData< double > | getHeat (const shared_ptr< const MeshD< 2 > > &dst_mesh, InterpolationMethod method=INTERPOLATION_DEFAULT) |
Get generated/absorbed heat. | |
Protected Member Functions inherited from plask::SolverOver< SpaceT > | |
template<typename Boundary , typename ConditionT > | |
void | readBoundaryConditions (Manager &manager, XMLReader &reader, BoundaryConditions< Boundary, ConditionT > &dest) |
Read boundary conditions using information about the geometry of this solver. | |
Protected Attributes | |
DataLog< dcomplex, dcomplex > | log_value |
Logger for char_val. | |
size_t | rsize |
Last element of horizontal mesh to consider. | |
size_t | zbegin |
First element of vertical mesh to consider. | |
size_t | zsize |
Last element of vertical mesh to consider. | |
std::vector< std::vector< dcomplex, aligned_allocator< dcomplex > > > | nrCache |
Cached refractive indices. | |
std::vector< std::vector< dcomplex, aligned_allocator< dcomplex > > > | ngCache |
Cached group indices. | |
std::vector< FieldZ > | zfields |
Computed vertical fields. | |
std::vector< double, aligned_allocator< double > > | zintegrals |
Vertical field confinement weights. | |
std::vector< dcomplex, aligned_allocator< dcomplex > > | veffs |
Computed effective frequencies for each stripe. | |
std::vector< dcomplex, aligned_allocator< dcomplex > > | nng |
Computed weighted indices for each stripe. | |
dcomplex | old_k0 |
Old value of k0 to detect changes. | |
Emission | emission |
Direction of laser emission. | |
int | rstripe |
Stripe number to use for vertical computations. | |
bool | need_gain |
Do we need to compute gain. | |
bool | cache_outdated |
Indicator that we need to recompute the effective indices. | |
bool | have_veffs |
Indicator if we have veffs foe the current cache. | |
bool | asymptotic |
Indicator if we want an asymptotic lateral solution in the outermost layer. | |
Protected Attributes inherited from plask::SolverWithMesh< Geometry2DCylindrical, RectangularMesh< 2 > > | |
shared_ptr< RectangularMesh< 2 > > | mesh |
Mesh over which the calculations are performed. | |
boost::signals2::connection | mesh_signal_connection |
Connection of mesh to onMeshChange method, see http://www.boost.org/doc/libs/1_55_0/doc/html/signals2/tutorial.html#idp204830936. | |
Protected Attributes inherited from plask::SolverOver< SpaceT > | |
shared_ptr< SpaceT > | geometry |
Space in which the calculations are performed. | |
Protected Attributes inherited from plask::Solver | |
bool | initialized |
true only if solver is initialized | |
Friends | |
struct | RootDigger |
Solver performing calculations in 2D Cartesian space using effective index method.
plask::optical::effective::EffectiveFrequencyCyl::EffectiveFrequencyCyl | ( | const std::string & | name = "" | ) |
|
inlinevirtual |
|
inline |
|
protected |
size_t plask::optical::effective::EffectiveFrequencyCyl::findMode | ( | dcomplex | lambda, |
int | m = 0 |
||
) |
Find the mode around the specified effective wavelength.
This method remembers the determined mode, for retrieval of the field profiles.
lambda | initial wavelength close to the solution |
m | number of the LP_mn mode describing angular dependence |
std::vector< size_t > plask::optical::effective::EffectiveFrequencyCyl::findModes | ( | plask::dcomplex | lambda1 = 0. , |
plask::dcomplex | lambda2 = 0. , |
||
int | m = 0 , |
||
size_t | resteps = 256 , |
||
size_t | imsteps = 64 , |
||
dcomplex | eps = dcomplex(1e-6, 1e-9) |
||
) |
Find the modes within the specified range.
This method does not remember the determined modes!
lambda1 | one corner of the range to browse |
lambda2 | another corner of the range to browse |
m | number of the LP_mn mode describing angular dependence |
resteps | minimum number of steps to check function value on real contour |
imsteps | minimum number of steps to check function value on imaginary contour |
eps | approximate error for integrals |
|
inline |
|
inline |
|
inlineoverridevirtual |
Get a description of this solver.
Reimplemented from plask::Solver.
|
inlineoverridevirtual |
|
inline |
|
inline |
|
protected |
|
inline |
double plask::optical::effective::EffectiveFrequencyCyl::getGainIntegral | ( | size_t | num | ) |
|
protected |
|
protected |
|
inlineprotected |
|
inlineprotected |
|
inline |
|
protected |
|
inline |
|
inline |
double plask::optical::effective::EffectiveFrequencyCyl::getTotalAbsorption | ( | size_t | num | ) |
|
inline |
|
inlineprotected |
|
inline |
|
overridevirtual |
Load configuration from given source
.
XML reader (source
) point to opening of this
solver tag and after return from this method should point to this solver closing tag.
source | source of configuration |
manager | manager from which information about geometry, meshes, materials, and so on can be get if needed |
Reimplemented from plask::Solver.
|
inlineprotected |
|
overrideprotectedvirtual |
|
inlineprotected |
|
overrideprotectedvirtual |
size_t plask::optical::effective::EffectiveFrequencyCyl::setMode | ( | dcomplex | clambda, |
int | m = 0 |
||
) |
|
inline |
Set particular value of the effective wavelength, e.g.
to one of the values returned by findModes. If it is not proper mode, exception is throw.
lambda | wavelength of the mode |
loss | modal loss (as returned by outLoss) |
m | number of the LP_mn mode describing angular dependence |
|
inline |
|
protected |
|
protected |
|
inline |
|
friend |
|
protected |
|
protected |
Determinant plask::optical::effective::EffectiveFrequencyCyl::determinant |
|
protected |
|
protected |
ReceiverFor<CarriersConcentration, Geometry2DCylindrical> plask::optical::effective::EffectiveFrequencyCyl::inCarriersConcentration |
ReceiverFor<Gain, Geometry2DCylindrical> plask::optical::effective::EffectiveFrequencyCyl::inGain |
ReceiverFor<Temperature, Geometry2DCylindrical> plask::optical::effective::EffectiveFrequencyCyl::inTemperature |
dcomplex plask::optical::effective::EffectiveFrequencyCyl::k0 |
|
protected |
std::vector<Mode> plask::optical::effective::EffectiveFrequencyCyl::modes |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
ProviderFor<Heat,Geometry2DCylindrical>::Delegate plask::optical::effective::EffectiveFrequencyCyl::outHeat |
ProviderFor<ModeLightE,Geometry2DCylindrical>::Delegate plask::optical::effective::EffectiveFrequencyCyl::outLightE |
ProviderFor<ModeLightMagnitude,Geometry2DCylindrical>::Delegate plask::optical::effective::EffectiveFrequencyCyl::outLightMagnitude |
ProviderFor<ModeLoss>::Delegate plask::optical::effective::EffectiveFrequencyCyl::outLoss |
ProviderFor<RefractiveIndex,Geometry2DCylindrical>::Delegate plask::optical::effective::EffectiveFrequencyCyl::outRefractiveIndex |
ProviderFor<ModeWavelength>::Delegate plask::optical::effective::EffectiveFrequencyCyl::outWavelength |
double plask::optical::effective::EffectiveFrequencyCyl::perr |
RootDigger::Params plask::optical::effective::EffectiveFrequencyCyl::root |
|
protected |
|
protected |
RootDigger::Params plask::optical::effective::EffectiveFrequencyCyl::stripe_root |
|
protected |
dcomplex plask::optical::effective::EffectiveFrequencyCyl::vlam |
|
protected |
|
protected |
|
protected |
|
protected |