Operator: Get node coordinates in the given coordinate system

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
This commit is contained in:
Thorsten Liebig 2013-02-06 16:40:32 +01:00
parent 183ea9f776
commit b3ef0361b2
2 changed files with 10 additions and 0 deletions

View File

@ -187,6 +187,14 @@ bool Operator::GetYeeCoords(int ny, unsigned int pos[3], double* coords, bool du
return true;
}
bool Operator::GetNodeCoords(unsigned int pos[3], double* coords, bool dualMesh, CoordinateSystem c_system) const
{
for (int n=0;n<3;++n)
coords[n]=GetDiscLine(n,pos[n],dualMesh);
TransformCoordSystem(coords,coords,m_MeshType,c_system);
return true;
}
double Operator::GetEdgeLength(int n, const unsigned int* pos, bool dualMesh) const
{
return GetDiscDelta(n,pos[n],dualMesh)*gridDelta;

View File

@ -101,6 +101,8 @@ public:
//! Get the coordinates for a given node index and component, according to the yee-algorithm. Returns true if inside the FDTD domain.
virtual bool GetYeeCoords(int ny, unsigned int pos[3], double* coords, bool dualMesh) const;
virtual bool GetNodeCoords(unsigned int pos[3], double* coords, bool dualMesh=false, CoordinateSystem c_system=UNDEFINED_CS) const;
//! Get the node width for a given direction \a n and a given mesh position \a pos
virtual double GetNodeWidth(int ny, const unsigned int pos[3], bool dualMesh = false) const {return GetEdgeLength(ny,pos,!dualMesh);}
//! Get the node width for a given direction \a n and a given mesh position \a pos