Electromagnetic Template Library (EMTL)
Loading...
Searching...
No Matches
emFixDispersion Class Reference

Correction set for Drude-Lorentz items. More...

#include <dispersion.h>

Inheritance diagram for emFixDispersion:
Collaboration diagram for emFixDispersion:

Public Member Functions

template<class block_t >
int record (block_t *block, const typename block_t::contour_it &cnti, emMedium **meds, int meds_num, valtype *fr, valtype &Ca, valtype &Cb)
 Record fix corresponding to the given contour.
 
void join_parallel ()
 Joins local copies of data we used in parallel initialization into global original data.
 
std::array< size_t, 3 > & skip_fix (emFixStorage &fs, std::ptrdiff_t &fix_ind) const
 Jumps through all fix data, return could be used for correct_fix The right way is probably wrap all in data class that reads or writes itself as a whole We call this function only while correcting fix data during parallel initialization.
 
void correct_fix_before (emFixStorage &fs, std::ptrdiff_t &fix_ind) const
 If no actions required this function jumps through all fix data Here we have to correct indices of contour solvers in cntsolvers array.
 
void release_init_resources ()
 Releasing all the rest local threads data we used in parallel initialization.
 

Protected Attributes

emtype * ptr
 reference on the E field array
 
valtype dt
 time step
 
refvector< emDispersionSolverslvs0
 ADE scheme implementation for one medium.
 
refvector< emDispersionFraqSolverslvs1
 ADE scheme implementation for linear combination of media.
 
refvector< pack_t< indtype, indtype >::data > inds [2]
 indices for E fields in ptr array where fix is applied using slvs0 and slvs1
 

Detailed Description

Correction set for Drude-Lorentz items.

Work with this class assumes 3 stages:

  1. Initialization with reference on E field array and time step dt. 2 Recording contours and media which need to be treated with fix (function record). Function record returns coefficients Ca and Cb which are used in basic FDTD update equation E=Ca*E+Cb*rotH, which is performed outside.
  2. Functions step_before and step_after.

Reference on the object emFixDispersion is stored in method.

Member Function Documentation

◆ correct_fix_before()

void emFixDispersion::correct_fix_before ( emFixStorage fs,
std::ptrdiff_t &  fix_ind 
) const
inline

If no actions required this function jumps through all fix data Here we have to correct indices of contour solvers in cntsolvers array.

So we use LocalPointer remap to correct them. Each thread corrects it's own portion of fix data, the same portion it had written before.

◆ join_parallel()

void emFixDispersion::join_parallel ( )
inline

Joins local copies of data we used in parallel initialization into global original data.

Except for cntsolvers, we just delete all the local data. To store remapping array for correcting fix data we use another local pointer remap. This function should not be called in nonparallel case.

◆ record()

template<class block_t >
int emFixDispersion::record ( block_t *  block,
const typename block_t::contour_it &  cnti,
emMedium **  meds,
int  meds_num,
valtype *  fr,
valtype &  Ca,
valtype &  Cb 
)

Record fix corresponding to the given contour.

meds_num of dispersive media stored in **meds participate in this fix. fr are fill fraction of dispersive medium (in the contour area). Ca, Cb are coefficients in the basic dielectric FDTD update.

Parameters
blockmesh which manages E fields array
cntiiterator on the given contour
medsreference on dispersive media array
meds_numnumber of disperive media
frfill fractions of dispersive media (in the contour area)
Cacoefficients in the basic dielectric FDTD update
Cbcoefficients in the basic dielectric FDTD update

◆ release_init_resources()

void emFixDispersion::release_init_resources ( )
inline

Releasing all the rest local threads data we used in parallel initialization.

Here all that left is only remap local pointer. All other local data was released in join_parallel.

◆ skip_fix()

std::array< size_t, 3 > & emFixDispersion::skip_fix ( emFixStorage fs,
std::ptrdiff_t &  fix_ind 
) const
inline

Jumps through all fix data, return could be used for correct_fix The right way is probably wrap all in data class that reads or writes itself as a whole We call this function only while correcting fix data during parallel initialization.

The return type is the reference to the data we want to correct.

Member Data Documentation

◆ inds

refvector<pack_t<indtype, indtype>::data> emFixDispersion::inds[2]
protected

indices for E fields in ptr array where fix is applied using slvs0 and slvs1

this vector is used at the recording stage to find if some medium was already recorded


The documentation for this class was generated from the following file: