Electromagnetic Template Library (EMTL)
Loading...
Searching...
No Matches
emYeeRectBlockBase< iterate_order_t, data_structure_t > Class Template Reference

Mesh block for Yee orhtogonal mesh. More...

#include <yee.h>

Inheritance diagram for emYeeRectBlockBase< iterate_order_t, data_structure_t >:
Collaboration diagram for emYeeRectBlockBase< iterate_order_t, data_structure_t >:

Classes

class  contour_it_base
 Class for iterating contours. More...
 

Public Types

typedef Box region_t
 Synonym for enclosing region classname.
 

Public Member Functions

 emYeeRectBlockBase ()
 Default constructor for pre-initialized object to allow for post-inits.
 
Vector_3 get_position (indtype ind, int &ftype, Vector_3 &fdir) const
 Gets the position, fieldtype and direction of a data with given index.
 
template<int Dir = 0, class interp_form_tt , typename fix_stack_t >
std::pair< size_t, size_t > fill_interp_value_async (fix_stack_t &fix_stack, const interp_form_tt *entry, int depth, int action, const emtype *src, const emtype *src_vec, emtype *dest, emtype *dest_vec)
 vectorized form does nothing, direct and indirect copies work the same way
 
emInterpolation create_interpolation (const Vector_3 &pos, const Vector_3 &dir, int fieldtype)
 Old interpolation form.
 
template<class interp_arg_tt >
interp_arg_tt::interp_form_t create_interpolation (const interp_arg_tt &arg, std::vector< interp_arg_tt > *nonlocal=NULL, bool all_nonlocal=false)
 Returns the coefficients of field interpolation.
 
int get_out_data_max_count () const
 Gets the maximal possible number of output points for a contour.
 
template<typename contour_it_t >
int get_out_data_index (const contour_it_t &cnti, indtype *ind, valtype *coeff, int check=0) const
 Gets the data index and coefficients of output (central) updated data points as distributed from contour center.
 
int get_inp_data_max_count () const
 Gets the maximal possible number of inputs points for one edge of a contour.
 
template<typename contour_it_t >
int get_edge_count (const contour_it_t &cnti) const
 Gets the number of edges for the given contour.
 
template<typename contour_it_t >
int get_inp_data_index (const contour_it_t &cnti, int edgenum, indtype *ind, valtype *coeff, int check=0) const
 Gets the data index and coefficients of input (edge) data points to contribute to each edge center.
 
int mark_all_unused ()
 Mark all contours as unused (the fileds will not be updated by Step).
 
int mark_all_used (Vector_3 *vmin=NULL, Vector_3 *vmax=NULL)
 Mark all contours as used.
 
template<typename contour_it_t >
int mark_cnt_used (const contour_it_t &cnti, int border=0)
 Mark the contour as used (for optimization purposes).
 
virtual int commit_marking ()
 Commits the marked contours to match iterator range.
 
int join_markings ()
 Joins local thread marking range with global range (for multithreaded processing).
 
int auto_marking (Vector_3 *vmin, Vector_3 *vmax)
 Mark all contours in vmin to vmax box used.
 
size_t GetDataSize () const
 
emtype * GetDataPtr ()
 Gets data pointer associated with the mesh block.
 
int SetDataPtr (EmtypePtr_t _ptr)
 Sets the pointer and clears values.
 
int Reset ()
 Clears all buffers.
 
template<class contour_it_t , class contour_table_t >
indtype put_medium (const contour_it_t &it, valtype dt, contour_table_t &table)
 Records the media data from table for a contour given by.
 
template<class fix_stack_t >
int StepC (int field, fix_stack_t &fl=fix_stack_t())
 Performs non-optimized contour-based explicit timestep.
 
template<class fix_stack_t , typename contour_it_t >
void StepContour (const contour_it_t &cnt, fix_stack_t &fl=fix_stack_t())
 Performs explicit timestep for one single contour.
 
int set_avx_axis (int axis)
 Sets the axis that will be used for (AVX/SSE) vectorization, 0=x, 1=y, 2=z, -1 = automatic setting (usually largest dimension)
Vectorization works better for dimensions with uniform geometry (less object boundaries).
 
int get_transfer_flags () const
 
virtual int get_first_updated_field () const
 Gets the first field to be updated in a bulk loop.
 
virtual int set_first_updated_field (int _first_updated_field)
 Sets the first field to update.
 
template<typename contour_it_t >
Box get_cell_bounding_box (const contour_it_t &cnti) const
 Bounding box for current yee cell.
 
template<typename contour_it_t >
Box get_vec_cell_bounding_box (const contour_it_t &cnti) const
 Bounding box for vector cell that includes current iterator.
 
- Public Member Functions inherited from base_yee_struc_t
int adjust_dimensions (int *N, const iVector_3 &extra_cells, int *bc=NULL, valtype *courantf=NULL)
 Changes dimensions, resolution and boundary conditions according to requirements of the Block.
 
iVector_3 get_cell_cluster () const
 
int init (const Box &B, const indtype *ndim, int wf_)
 Init override to initialize additional data.
 
void unpack_ind (indtype ind, int &ftype, int &dir, indtype &ix, indtype &iy, indtype &iz) const
 Indexing the value.
 
indtype pack_ind (int ftype, int dir, indtype ix, indtype iy, indtype iz) const
 Packs component indicies to integer.
 
grid_tget_field_grid (int ftype, int dir)
 Gets interpolation grid for each filed type and direction. The grids normally can not be used for accessing field data.
 
const grid_tget_field_grid (int ftype, int dir) const
 Gets interpolation grid for each filed type and direction.
 
virtual size_t packed_size () const
 
virtual size_t data_size () const
 
int set_fix_storage (emFixStorage *fs)
 Sets a pointer for fix storage for contour fixes.
 
template<class contour_it >
int set_contour_fix (const contour_it &cnti, int fix_flags, ptrdiff_t shift)
 Sets fix flags and shift from fix storage begin for a specific contour cnti.
 
template<class fix_stack_t >
void apply_fixes_before (fix_stack_t &fix_stack, indtype oind, emtype *out) const
 Base data does not support contour fixes.
 
template<class fix_stack_t >
void apply_fixes_after (fix_stack_t &fix_stack, indtype oind, emtype *out) const
 Base data does not support contour fixes.
 
virtual int get_sync_hsteps () const
 Number of mesh steps per field (half steps) mesh block is performing between synchronization, i.e.
 
int get_perm_sign () const
 Returns permutation sign if the coords are flipped: 1 = even (cycle), -1 = odd.
 
Vector_3 get_dx (bool int_order=false) const
 Gets space steps.
 
template<typename contour_it_t >
Box get_vec_cell_bounding_box_extent (const contour_it_t &cnti) const
 Bounding box for current yee cell.
 
- Public Member Functions inherited from emComponent
emDump * GetEmDumper ()
 This function insures that the returned dumper is of true emDumper type.
 

Public Attributes

EmtypePtr_t ptr
 main (aligned) data pointer
 
indtype ustart [6][3]
 Grid box internal area (border excluded) limits for each field type and direction, default is [1, N-2].
 
Vector_3 dx
 space increments
 
Vector_3 dx2
 space increments divided by 2
 

Protected Member Functions

Vector_3 get_position (indtype ix, indtype iy, indtype iz, int cdir, int ftype, Vector_3 &fdir) const
 Data position via 3 indicies, and contour ftype.
 
template<typename contour_it_t >
int get_inp_data_index_unpacked (const contour_it_t &cnti, int edgenum, indtype *ind) const
 Gets the data index and coefficients of input (edge) data points to contribute to each edge center.
 
- Protected Member Functions inherited from base_yee_struc_t
int StepO (int field)
 performs (optimized) explicit timestep
 
int StepV (int field)
 performs vectorizable explicit timestep
 
indtype get_start_ind (int field, int dir) const
 Gets starting index of the mesh of certain field and dir. All other mesh indicies for (field,dir) are then calculated by adding pack_ind(ix,iy,iz).
 
void set_arr (emtype *sptr)
 Assigns external pointer for data array.
 
template<class contour_it >
indtype put_media_type (const contour_it &cnti, valtype dt, emtype perm, emtype loss)
 Records the media data for a contour given by.
 

Protected Attributes

int dhalo_left [3] = { 1,1,1 }
 data halos for blocks with no builtin PBCs.
 
int force_halos = 0
 forcing halo inclusion from both sides of the mesh. Works for axes with no builtin PBCs.
 
indtype mstart [6][3]
 Commited local memory range for all grids.
 
indtype estart [6][3]
 marking for grid box iterator limits for each field type and direction, default is [1, N-2].
 
indtype _start [6][3]
 marking for grid box memory limits for each field type and direction, default is [1, N-2].
 
indtype istart [6][3]
 marking grid box internal area (external border excluded) limits for each field type and direction, default is [1, N-2]
 
indtype astart [6][3]
 marking for interpolation area (internal border included)
 
Vector_3 origin
 Origin point of main grid.
 
Box rbox
 Bounding region [origin+dx/4, origin+nx*dx-dx/4], where nx is dimension supplied in constructor.
 
int first_updated_field
 grids for different field types
 
int builtin_pbc
 Bit flags specifying that periodic boudary conditions are intrinsically built in for this mesh block (in the Step procedue).
 
int builtin_transfers
 If not zero, means that all transfers (both for boundaries and MPI) are intrinsically built in for this mesh block (in the Step procedue).
 
- Protected Attributes inherited from base_yee_struc_t
int wf
 media coefficients for vectorized main loop
 
int mpi_domains
 Number of domains in DomainDecomposition.
 
iVector_3 decomp_recommendation
 Recommendation for DomainDecomposition layout.
 
indtype SZ4
 Slice sizes.
 
int topthreads
 number of threads for processing
 

Additional Inherited Members

- Static Public Member Functions inherited from base_yee_struc_t
static constexpr int get_fix_aggregate_size ()
 

Detailed Description

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
class emYeeRectBlockBase< iterate_order_t, data_structure_t >

Mesh block for Yee orhtogonal mesh.

This block class is conforming to emtMeshBlock model.

Member Function Documentation

◆ auto_marking()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
int emYeeRectBlockBase< iterate_order_t, data_structure_t >::auto_marking ( Vector_3 *  vmin,
Vector_3 *  vmax 
)

Mark all contours in vmin to vmax box used.

This is an analytical repacement for geometry analysis.

◆ commit_marking()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
virtual int emYeeRectBlockBase< iterate_order_t, data_structure_t >::commit_marking ( )
virtual

Commits the marked contours to match iterator range.

Iterator ranges become conformant to the markings made so far.

Reimplemented in emEJRectBlock.

◆ create_interpolation()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
template<class interp_arg_tt >
interp_arg_tt::interp_form_t emYeeRectBlockBase< iterate_order_t, data_structure_t >::create_interpolation ( const interp_arg_tt &  arg,
std::vector< interp_arg_tt > *  nonlocal = NULL,
bool  all_nonlocal = false 
)

Returns the coefficients of field interpolation.

Adds non-local (unresolved) requests to nonlocal (if it is not NULL).

◆ get_first_updated_field()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
virtual int emYeeRectBlockBase< iterate_order_t, data_structure_t >::get_first_updated_field ( ) const
inlinevirtual

Gets the first field to be updated in a bulk loop.

0 means E is updated first, 1 means H is updated first.

◆ get_inp_data_index()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
template<typename contour_it_t >
int emYeeRectBlockBase< iterate_order_t, data_structure_t >::get_inp_data_index ( const contour_it_t &  cnti,
int  edgenum,
indtype *  ind,
valtype *  coeff,
int  check = 0 
) const

Gets the data index and coefficients of input (edge) data points to contribute to each edge center.

It is assumed that the pointers have space at least for get_out_data_max_count() entries. If check==1, performs data index memory range validity check.

Returns
the actual number of indicies

◆ get_out_data_index()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
template<typename contour_it_t >
int emYeeRectBlockBase< iterate_order_t, data_structure_t >::get_out_data_index ( const contour_it_t &  cnti,
indtype *  ind,
valtype *  coeff,
int  check = 0 
) const

Gets the data index and coefficients of output (central) updated data points as distributed from contour center.

Puts the indicies and coefficients into corresponding arrayes provided. It is assumed that the pointers have space at least for get_out_data_max_count() entries. If check==1 performs data index memory range validity check.

Returns
the actual number of indicies.

◆ get_transfer_flags()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
int emYeeRectBlockBase< iterate_order_t, data_structure_t >::get_transfer_flags ( ) const
inline
Returns
flags specifying which pafrt of MPI/border transfers is built in. Currently: !0 - all builtin, 0 - all must be managed externally by a fix (defined within method_bulk).

◆ GetDataSize()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
size_t emYeeRectBlockBase< iterate_order_t, data_structure_t >::GetDataSize ( ) const
inline
Returns
field mesh size that needs to be allocated.

◆ mark_all_used()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
int emYeeRectBlockBase< iterate_order_t, data_structure_t >::mark_all_used ( Vector_3 *  vmin = NULL,
Vector_3 *  vmax = NULL 
)

Mark all contours as used.

If vmin and vmax are specified, take them as a bounding box.

◆ mark_cnt_used()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
template<typename contour_it_t >
int emYeeRectBlockBase< iterate_order_t, data_structure_t >::mark_cnt_used ( const contour_it_t &  cnti,
int  border = 0 
)

Mark the contour as used (for optimization purposes).

for the Yee block this will extend the used box. border: 0=completely internal, 1 = some input outside, 2= output outside, but some input inside border=1,2 contours may be excluded from processing by Step, but are iterated by contour iterator the processing of border contours must be managed externally.

◆ put_medium()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
template<class contour_it_t , class contour_table_t >
indtype emYeeRectBlockBase< iterate_order_t, data_structure_t >::put_medium ( const contour_it_t &  it,
valtype  dt,
contour_table_t &  table 
)
inline

Records the media data from table for a contour given by.

  • it.

◆ set_avx_axis()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
int emYeeRectBlockBase< iterate_order_t, data_structure_t >::set_avx_axis ( int  axis)
inline

Sets the axis that will be used for (AVX/SSE) vectorization, 0=x, 1=y, 2=z, -1 = automatic setting (usually largest dimension)
Vectorization works better for dimensions with uniform geometry (less object boundaries).

Returns
>0 on success.
-1 incompatible setting.
0 feature is not supported.

◆ set_first_updated_field()

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
virtual int emYeeRectBlockBase< iterate_order_t, data_structure_t >::set_first_updated_field ( int  _first_updated_field)
inlinevirtual

Sets the first field to update.

It may fail with warning if the data structure doesn't support update reordering. 0 means E is updated first, 1 means H is updated first.

Member Data Documentation

◆ builtin_pbc

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
int emYeeRectBlockBase< iterate_order_t, data_structure_t >::builtin_pbc
protected

Bit flags specifying that periodic boudary conditions are intrinsically built in for this mesh block (in the Step procedue).


bits set: 0x1 - x, 0x2 -y, 0x4 -z

◆ first_updated_field

template<class iterate_order_t = simple_array_order_t, class data_structure_t = base_yee_struc_t>
int emYeeRectBlockBase< iterate_order_t, data_structure_t >::first_updated_field
protected

grids for different field types

Index arrays for temporary interpolation. The first field to update in cases when it can be changed. If the block doesn't support reordering, this value is ignored. 0 means E is updated first, 1 means H is updated first.


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