FEMSuite
Public Member Functions | Protected Attributes | List of all members
Yee Class Reference

summary>This class models a Yee grid More...

#include <Yee.h>

Inheritance diagram for Yee:
Inheritance graph
[legend]
Collaboration diagram for Yee:
Collaboration graph
[legend]

Public Member Functions

HField GetH (const TimeBoardIndex timeBoard, const Address addr) const
 
void SetH (const TimeBoardIndex timeBoardBase, const Address addr, const HField &newValue)
 remarks>Recall that H(timeBoardBase) = H(t + 1/2)
 
HField SumH (const TimeBoardIndex timeBoard, const Address addr)
 
HField GetPreviousSpatialH (const TimeBoardIndex timeBoard, const Address addr, const size_t dimensionToDecrement) const
 
EField GetE (const TimeBoardIndex timeBoard, const Address addr) const
 
EField SumE (const TimeBoardIndex timeBoard, const Address addr)
 
void SetE (const TimeBoardIndex timeBoardBase, const Address addr, const EField &newValue)
 
EField GetPreviousSpatialE (const TimeBoardIndex timeBoard, const Address addr, const size_t dimensionToDecrement) const
 
DField GetD (const TimeBoardIndex timeBoard, const Address addr) const
 
DField SumD (const TimeBoardIndex timeBoard, const Address addr)
 
void SetD (const TimeBoardIndex timeBoardBase, const Address Addr, const DField &newValue)
 
CurlE CurlEFromB (const TimeBoardIndex timeBoardIndex, const Address addr)
 Calculates the curl of the E - Field at a given addres( nAddr ) at a given time index( timeBoardIndex ). This is based on : VxE = -dB / dt; the relation between the curl of the Electric field and the time derivative of the magnetic field. More...
 
CurlE CurlEFromE (const TimeBoardIndex timeBoardIndex, const Address addr)
 Calculates the curl of the E - Field at a given addres( nAddr ) at a given time index( timeBoardIndex ) This is based on the interinsic definition of a curl : VxE = (dEz / dy - dEy / dz).ax + (dEx / dz - dEz / dx).ay + (dEy / dx - dEx / dy).az More...
 
CurlE CurlE_Ez (const TimeBoardIndex timeBoardIndex, const Address addr)
 
CurlH CurlHFromD (const TimeBoardIndex timeBoardIndex, const Address addr)
 Calculates the curl of the H - Field at a given addres( addr ) at a given time index( timeBoardIndex ) This is based on : Curl(H) = dD / dt More...
 
CurlH CurlHFromH (const TimeBoardIndex timeBoardIndex, const Address addr)
 Calculates the curl of the H - Field at a given addres( nAddr ) at a given time index( timeBoardIndex ) This is based on the interinsic definition of a curl : VxE = (dEz / dy - dEy / dz).ax + (dEx / dz - dEz / dx).ay + (dEy / dx - dEx / dy).az More...
 
bool IsInsidePML (const GridIndex &gridIndex) const
 Determines if a given grid index is inside the perfectly matched layer More...
 
bool IsInsidePML (const Point< Spatial > &point) const
 Determines if a given point is inside the perfectly matched layer More...
 
PMLWidth GetPMLWidth (const size_t dimension) const override
 Returns the width of the perfectly matched layer. More...
 
bool IsInsideInnerPML (const GridIndex &gridIndex, const size_t dimension) const
 A more detailed version of IsInsidePml, determines if a given dimension of a given grid index is inside the inner end of the Perfectly Matched Layer More...
 
bool IsInsideOuterPML (const GridIndex &gridIndex, const size_t dimension) const
 A more detailed version of IsInsidePml, determines if a given dimension of a given grid index is inside the outer end of the Perfectly Matched Layer More...
 
void EnterNewTimeBoard ()
 
TimeBoardIndex GetCurrentTimeBoardIndex () const
 
TimeBoardIndex GetPreviousTimeBoardIndex (const unsigned int rollback) const
 
void CalculateTimeStep ()
 
Time GetTimeStep () const
 
Time GetCurrentTime () const
 
void SetCurrentTime (const Time currentTime)
 
Time Tic ()
 Starts a timer More...
 
Time Toc (const Time tic)
 Ends a timer More...
 
size_t GetEffectiveDimension (const char whichField) const
 Reads which dimension to map the X value of a 2d array into, which converting 3d to 2d arrays. More...
 
Field Force3D (const Field &fIn, const char whichField) const
 Forces a 2d field into a 3d field in accordance with with the current simulation mode More...
 
Field RecoverShape (const Field &fIn, const char whichField) const
 Does the opposite of Force3D More...
 
Field Reshape (const Field &, size_t dimension) const
 
void CalculateSpatialSteps ()
 Calculates the dimension of every voxel in the problem space More...
 
DimensionArray< Spatial > GetSpatialSteps () const override
 Retreives the calculated dimensions of every voxel in the problem space More...
 
void CalculateSpatialExtents ()
 Calculates the limits of the problem space More...
 
DimensionArray< PointExtentsGetSpatialExtents () const override
 Retreives the calculated dimensions of every voxel in the problem space More...
 
YeeUpdateHelperGetUpdateHelper () const
 
void Load ()
 Loading a simulation More...
 
void Run ()
 Running the simulation More...
 
Time GetSimulationTime () const
 
void SetSimulationTime (const Time simulationTime)
 
SimulationMode GetSimulationMode () const
 
Sim3DMode Get3dSimulationMode () const
 
bool IsIn2DMode () const
 Whether the simulation mode is in 2D. More...
 
 Yee (const Yee &)=delete
 
- Public Member Functions inherited from Grid
template<class S , typename... Args>
std::shared_ptr< S > AddSource (Args...args)
 Creates a new source instance More...
 
GridIndex ToGridIndex (const Address address) const
 
GridIndex ToGridIndex (const Point< Spatial > &point) const
 
Point< Spatial > ToPoint (GridIndex gridIndex) const
 
Address ToAddress (const GridIndex &gridIndex) const
 
virtual std::shared_ptr< BoundaryGetBoundaryById (const BoundaryId id)
 
Returns
Boundary given a boundary id

 
virtual std::shared_ptr< BoundaryGetBoundaryByAddress (const Address address)
 
Returns
Boundary given an address

 
BoundaryId GetBoundaryId (const Address address)
 
Returns
Boundary Id given an address

 
template<class B >
std::shared_ptr< BoundaryAddBoundary ()
 Creates a new boundary instance More...
 
std::vector< std::shared_ptr< Boundary > > & GetBoundaries ()
 Retrieves all boundaries More...
 
Spatial GetLowestLength (const size_t dimension) const
 
Returns
Lowest length in a specific dimension

 
Spatial GetHighestLength (const size_t dimension) const
 
Returns
Highest length in a specific dimension

 
DimensionArray< Spatial > GetHighestLengths () const
 
Returns
Highest lengths for all dimensions

 
unsigned int GetSize (const size_t dimension) const
 
Returns
Grid size for a given dimension

 
DimensionArray< size_t > GetSizes () const
 
Returns
All grid sizes

 
size_t GetSizeProduct ()
 
Returns
trace/prod GetGridSizes

 
void SetSizes (const GridIndex &sizes)
 Sets all grid sizes More...
 
void SetSizes (const DimensionArray< Spatial > &)
 Sets all grid sizes from a spatial array. More...
 

Protected Attributes

Time m_TimeStep
 How many seconds between successive iterations. More...
 
Time m_CurrentTime
 Current simulation time. More...
 
DimensionArray< Spatial > m_SpatialSteps
 Defines the spatial steps in all three directions More...
 
Point m_MinPoint
 
Point m_MaxPoint
 
DimensionArray< PointExtentsm_PointExtents
 
- Protected Attributes inherited from Grid
std::vector< std::shared_ptr< Source > > m_Sources
 Stores all sources More...
 
std::vector< std::shared_ptr< Boundary > > m_Boundaries
 Stores all boundaries More...
 
std::vector< BoundaryId > m_BoundaryAddressMap
 Associates boundaries with addresses More...
 
DimensionArray< size_t > m_Sizes
 Holds all sizes More...
 

Detailed Description

summary>This class models a Yee grid

Member Function Documentation

void Yee::CalculateSpatialExtents ( )

Calculates the limits of the problem space

void Yee::CalculateSpatialSteps ( )

Calculates the dimension of every voxel in the problem space

A range based step may be beneficial to incorporate stretched problem spaces

CurlE Yee::CurlEFromB ( const TimeBoardIndex  timeBoardIndex,
const Address  addr 
)

Calculates the curl of the E - Field at a given addres( nAddr ) at a given time index( timeBoardIndex ). This is based on : VxE = -dB / dt; the relation between the curl of the Electric field and the time derivative of the magnetic field.

CurlE Yee::CurlEFromE ( const TimeBoardIndex  timeBoardIndex,
const Address  addr 
)

Calculates the curl of the E - Field at a given addres( nAddr ) at a given time index( timeBoardIndex ) This is based on the interinsic definition of a curl : VxE = (dEz / dy - dEy / dz).ax + (dEx / dz - dEz / dx).ay + (dEy / dx - dEx / dy).az

CurlH Yee::CurlHFromD ( const TimeBoardIndex  timeBoardIndex,
const Address  addr 
)

Calculates the curl of the H - Field at a given addres( addr ) at a given time index( timeBoardIndex ) This is based on : Curl(H) = dD / dt

CurlH Yee::CurlHFromH ( const TimeBoardIndex  timeBoardIndex,
const Address  addr 
)

Calculates the curl of the H - Field at a given addres( nAddr ) at a given time index( timeBoardIndex ) This is based on the interinsic definition of a curl : VxE = (dEz / dy - dEy / dz).ax + (dEx / dz - dEz / dx).ay + (dEy / dx - dEx / dy).az

Field Yee::Force3D ( const Field fIn,
const char  whichField 
) const

Forces a 2d field into a 3d field in accordance with with the current simulation mode

size_t Yee::GetEffectiveDimension ( const char  whichField) const

Reads which dimension to map the X value of a 2d array into, which converting 3d to 2d arrays.

HField Yee::GetH ( const TimeBoardIndex  timeBoard,
const Address  addr 
) const

Recall that H(timeBoardBase) = H(t + 1/2)

PMLWidth Yee::GetPMLWidth ( const size_t  dimension) const
inlineoverridevirtual

Returns the width of the perfectly matched layer.

Implements Grid.

DimensionArray<PointExtents> Yee::GetSpatialExtents ( ) const
inlineoverridevirtual

Retreives the calculated dimensions of every voxel in the problem space

Implements Grid.

DimensionArray< Spatial > Yee::GetSpatialSteps ( ) const
inlineoverridevirtual

Retreives the calculated dimensions of every voxel in the problem space

Implements Grid.

bool Yee::IsIn2DMode ( ) const
inline

Whether the simulation mode is in 2D.

bool Yee::IsInsideInnerPML ( const GridIndex gridIndex,
const size_t  dimension 
) const

A more detailed version of IsInsidePml, determines if a given dimension of a given grid index is inside the inner end of the Perfectly Matched Layer

bool Yee::IsInsideOuterPML ( const GridIndex gridIndex,
const size_t  dimension 
) const

A more detailed version of IsInsidePml, determines if a given dimension of a given grid index is inside the outer end of the Perfectly Matched Layer

bool Yee::IsInsidePML ( const GridIndex gridIndex) const

Determines if a given grid index is inside the perfectly matched layer

Parameters
Grid IndexGrid index to check
Returns
True if given gridindex is inside the perfectly matched layer, false otherwise
bool Yee::IsInsidePML ( const Point< Spatial > &  point) const

Determines if a given point is inside the perfectly matched layer

Parameters
PointPoint to check
Returns
True if point is inside the perfectly matched layer, false otherwise
void Yee::Load ( )

Loading a simulation

Field Yee::RecoverShape ( const Field fIn,
const char  whichField 
) const

Does the opposite of Force3D

void Yee::Run ( )

Running the simulation

Time Yee::Tic ( )
inline

Starts a timer

Time Yee::Toc ( const Time  tic)
inline

Ends a timer

Member Data Documentation

Time Yee::m_CurrentTime
protected

Current simulation time.

DimensionArray< Spatial > Yee::m_SpatialSteps
protected

Defines the spatial steps in all three directions

Time Yee::m_TimeStep
protected

How many seconds between successive iterations.


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