chord Class Reference

This class represents a chord in a polar coordinate system. More...

#include <chord.h>

Inheritance diagram for chord:
integrablechord nanomagn::group edge nanomagn::exchange fmm

List of all members.

Public Member Functions

 chord (double rs, double rf, double fs, double ff)
 Makes a chord with specified polar coordinates of endpoints.
 chord (const chord &c0, const chord &c1, const chord &c2, const chord &c3)
 Makes a chord, representing diagonal of the specified rectangle.
 chord (const std::vector< int > &idx, const std::vector< chord > &chords)
 Makes a chord, representing diagonal of the rectangle.
 chord (const chord &another, double p)
 Makes a chord, consisting of a specified part of another chord.
bool isVertical () const
 Tells if this chord is "vertical" (at constant polar angle).
bool isHorizontal () const
 Tells if this chord is "horizontal" (at constant radial coordinate).
double getRS () const
 Gives the value of radial coordinate at the edge start.
double getRF () const
 Gives the value of radial coordinate at the edge end.
double getFS () const
 Gives the value of polar angle at the edge start.
double getFF () const
 Gives the value of polar angle at the edge end.
dcmplx getS () const
 Gives start of the chord as a complex number.
dcmplx getF () const
 Gives end of the chord as a complex number.
dcmplx getCenter (const conftrans &ct) const
 Gives the center of the chord as a complex number.
dcmplx getRandom (const conftrans &ct, MTRand &mt) const
 Gives a random point inside a rectangle with a diagonal, given by this chord.
double getRadius (const conftrans &CT) const
 Gives the radius of the group, assuming that it is a diagonal of the rectangle.
double getIntR (double p) const
 Calculates angular coordinate of an intermediate point along the chord, given parametrically.
double getIntF (double p) const
 Calculates radial coordinate of an intermediate point along the chord, given parametrically.
dcmplx getIntZ (double p) const
 Calculates intermediate point along the chord, given parametrically.
dcmplx getIntZJac (double p) const
 Calculates the Jacobian of the parametrization, employed by getIntZ.
double getVHLength () const
 Calculates the chord length as a zero-based chord.
double getLength () const
 Calculates the chord length.
chord & shiftS (double amt)
 Shifts the start of the chord by the specified amount. The amount is either angular or radial coordinate, depending on whether the chord is horizontal of vertical.
chord & shiftF (double amt)
 Shifts the end of the chord by the specified amount. The amount is either angular or radial coordinate, depending on whether the chord is horizontal of vertical.
const chord shiftedS (double amt) const
 Returns another chord, whose start is shifted by the specified amount. The amount is either angular or radial coordinate, depending on whether the chord is horizontal of vertical.
const chord shiftedF (double amt) const
 Returns another chord, whose end is shifted by the specified amount. The amount is aither angular or radial coordinate, depending on whether the chord is horizontal of vertical.
bool equal (const chord &another) const
 Tests if this chord is equal to another. The equality is tested by tolerantly comparing coordinates of endpoints.
void printChord () const
 Prints chord to stdout.
virtual int getStorage ()
 Returns the amount of RAM, occupied by this object.
 ~chord ()
 Frees resources, associated with the chord.

Detailed Description

This class represents a chord in a polar coordinate system.

Author:
Konstantin L. Metlov <metlov@kinetic.ac.donetsk.ua>

Constructor & Destructor Documentation

chord::chord ( double  rs,
double  rf,
double  fs,
double  ff 
)

Makes a chord with specified polar coordinates of endpoints.

Parameters:
rs value of the radius vector at the chord start, must be <=1;
rf value of the radius vector at the chord end, must be <=1;
fs value of the polar angle at the chord start (radians).
ff value of the polar angle at the chord end (radians).

Referenced by chord(), shiftedF(), and shiftedS().

chord::chord ( const chord &  c0,
const chord &  c1,
const chord &  c2,
const chord &  c3 
)

Makes a chord, representing diagonal of the specified rectangle.

Parameters:
c0 left chord of the rectangle
c1 top chord of the rectangle
c2 right chord of the rectangle
c3 bottom chord of the rectangle

References isHorizontal(), and isVertical().

chord::chord ( const std::vector< int > &  idx,
const std::vector< chord > &  chords 
)

Makes a chord, representing diagonal of the rectangle.

Here the rectagle is represented by vetor of 4 indices into array of chords.

Parameters:
idx four element vector of indices.
chords array of chords.

References chord().

chord::chord ( const chord &  another,
double  p = 1.0 
)

Makes a chord, consisting of a specified part of another chord.

Parameters:
another another chord.
p part specification.

References getIntF(), getIntR(), isHorizontal(), and isVertical().


Member Function Documentation

bool chord::equal ( const chord &  another  )  const

Tests if this chord is equal to another. The equality is tested by tolerantly comparing coordinates of endpoints.

Parameters:
another another chord to compare with.
dcmplx chord::getCenter ( const conftrans &  ct  )  const [inline]

Gives the center of the chord as a complex number.

Parameters:
ct is the conformal transform to use.
Returns:
center of the chord

References conftrans::T().

Referenced by nanomagn::group::group().

dcmplx chord::getF (  )  const [inline]

Gives end of the chord as a complex number.

Returns:
end of the chord

Referenced by getRadius().

double chord::getFF (  )  const [inline]

Gives the value of polar angle at the edge end.

Returns:
final value of the polar angle

Referenced by sideenergyintegrand::eval(), fmm::fillCharges(), and nanomagn::mesh::printMesh().

double chord::getFS (  )  const [inline]

Gives the value of polar angle at the edge start.

Returns:
starting value of the polar angle

Referenced by sideenergyintegrand::eval(), fmm::fillCharges(), and nanomagn::mesh::printMesh().

double chord::getIntF ( double  p  )  const [inline]

Calculates radial coordinate of an intermediate point along the chord, given parametrically.

Currently implemented parametrization corresponds to simultaneous linear interpolation in r and f. The parametrization might change in future, but the contract is that it is smooth, the range of parameter is the same, and that Jacobian is also provided by the function getIntZJac().

Parameters:
p specifies the point |p|<=1 (p=-1.0 is the chord start, p=1.0 is the chord end)
Returns:
radial coordinate of the intermediate point.

Referenced by chord(), and getIntZ().

double chord::getIntR ( double  p  )  const [inline]

Calculates angular coordinate of an intermediate point along the chord, given parametrically.

Currently implemented parametrization corresponds to simultaneous linear interpolation in r and f. The parametrization might change in future, but the contract is that it is smooth, the range of parameter is the same, and that Jacobian is also provided by the function getIntZJac().

Parameters:
p specifies the point |p|<=1 (p=-1.0 is the chord start, p=1.0 is the chord end)
Returns:
polar angle of the intermediate point.

Referenced by chord(), and getIntZ().

dcmplx chord::getIntZ ( double  p  )  const

Calculates intermediate point along the chord, given parametrically.

Currently implemented parametrization corresponds to simultaneous linear interpolation in r and f. The parametrization might change in future, but the contract is that it is smooth, the range of parameter is the same, and that Jacobian is also provided by the function getIntZJac().

Parameters:
p specifies the point |p|<=1 (p=-1.0 is the chord start, p=1.0 is the chord end)
Returns:
a complex point on the chord, correspondinting to the given value of p.

References getIntF(), and getIntR().

dcmplx chord::getIntZJac ( double  p  )  const

Calculates the Jacobian of the parametrization, employed by getIntZ.

Parameters:
p specifies the point |p|<=1 (p=-1.0 is the chord start, p=1.0 is the chord end)
Returns:
Jacobian at a point, specified by the value of p.
double chord::getLength (  )  const [inline]

Calculates the chord length.

Returns:
chord length.

References isHorizontal(), and isVertical().

double chord::getRadius ( const conftrans &  CT  )  const

Gives the radius of the group, assuming that it is a diagonal of the rectangle.

Parameters:
CT is the conformal transform to use.

References getF(), getS(), and conftrans::T().

Referenced by nanomagn::group::group().

dcmplx chord::getRandom ( const conftrans &  ct,
MTRand &  mt 
) const [inline]

Gives a random point inside a rectangle with a diagonal, given by this chord.

Parameters:
ct is the conformal transform to use.
mt is the random number generator to use.
Returns:
Random point in rectangle, having this chord as diagonal

References conftrans::T().

double chord::getRF (  )  const [inline]

Gives the value of radial coordinate at the edge end.

Returns:
final value of radial coordinate

Referenced by edge::isOuterBoundary(), nanomagn::mesh::printMesh(), and sideenergyintegrand::sideenergyintegrand().

double chord::getRS (  )  const [inline]

Gives the value of radial coordinate at the edge start.

Returns:
starting value of radial coordinate

Referenced by edge::getLength(), edge::isOuterBoundary(), nanomagn::mesh::printMesh(), and sideenergyintegrand::sideenergyintegrand().

dcmplx chord::getS (  )  const [inline]

Gives start of the chord as a complex number.

Returns:
start of the chord

Referenced by getRadius().

int chord::getStorage (  )  [virtual]

Returns the amount of RAM, occupied by this object.

Returns:
amount of RAM in bytes.

Reimplemented in edge, and integrablechord.

double chord::getVHLength (  )  const [inline]

Calculates the chord length as a zero-based chord.

Returns:
chord length.

References isHorizontal(), and isVertical().

Referenced by edge::breakInHalves(), and edge::getLength().

bool chord::isHorizontal (  )  const [inline]

Tells if this chord is "horizontal" (at constant radial coordinate).

Returns:
"true" if the chord is "horizontal".

Referenced by chord(), edge::getLength(), getLength(), getVHLength(), shiftedF(), shiftedS(), shiftF(), and shiftS().

bool chord::isVertical (  )  const [inline]

Tells if this chord is "vertical" (at constant polar angle).

Returns:
"true" if the chord is "vertical".

Referenced by chord(), getLength(), getVHLength(), printChord(), shiftedF(), shiftedS(), shiftF(), and shiftS().

const chord chord::shiftedF ( double  amt  )  const [inline]

Returns another chord, whose end is shifted by the specified amount. The amount is aither angular or radial coordinate, depending on whether the chord is horizontal of vertical.

Parameters:
amt is the amount.
Returns:
new chord.

References chord(), isHorizontal(), and isVertical().

const chord chord::shiftedS ( double  amt  )  const [inline]

Returns another chord, whose start is shifted by the specified amount. The amount is either angular or radial coordinate, depending on whether the chord is horizontal of vertical.

Parameters:
amt is the amount.
Returns:
new chord.

References chord(), isHorizontal(), and isVertical().

Referenced by edge::breakInHalves().

chord & chord::shiftF ( double  amt  ) 

Shifts the end of the chord by the specified amount. The amount is either angular or radial coordinate, depending on whether the chord is horizontal of vertical.

Parameters:
amt is the amount.
Returns:
this chord.

References isHorizontal(), and isVertical().

chord & chord::shiftS ( double  amt  ) 

Shifts the start of the chord by the specified amount. The amount is either angular or radial coordinate, depending on whether the chord is horizontal of vertical.

Parameters:
amt is the amount.
Returns:
this chord.

References isHorizontal(), and isVertical().


The documentation for this class was generated from the following files:
Generated on Mon Oct 8 18:26:44 2012 for nanomagnFMM by  doxygen 1.6.3