Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
SuperellipseGenerator Class Reference

#include <SuperellipseGenerator.hpp>

+ Collaboration diagram for SuperellipseGenerator:

Public Member Functions

 SuperellipseGenerator (unsigned numPoints=100, double ellipseExponent=1.0, double width=1.0, double height=1.0, double botLeftX=0.0, double botLeftY=0.0)
 
virtual ~SuperellipseGenerator ()
 
double GetTargetNodeSpacing ()
 
double GetHeightOfTopSurface ()
 
const std::vector< c_vector< double, 2 > > GetPointsAsVectors () const
 
const std::vector< ChastePoint< 2 > > GetPointsAsChastePoints () const
 

Private Attributes

double mTargetNodeSpacing
 
double mHeightOfTopSurface
 
std::vector< c_vector< double, 2 > > mPoints
 

Detailed Description

Class to generate roughly equally spaced points around a 2D superellipse. This shape is described by the equation (x/a)^n + (y/b)^n = 1, where n, a and b are positive numbers.

Definition at line 51 of file SuperellipseGenerator.hpp.

Constructor & Destructor Documentation

◆ SuperellipseGenerator()

SuperellipseGenerator::SuperellipseGenerator ( unsigned  numPoints = 100,
double  ellipseExponent = 1.0,
double  width = 1.0,
double  height = 1.0,
double  botLeftX = 0.0,
double  botLeftY = 0.0 
)

Constructor.

Default values of the input arguments produce a circle bounded by the unit square.

Parameters
numPointsThe number of points to generate around the circumference (defaults to 100)
ellipseExponentThe exponent of the superellipse (defaults to 1)
widthThe width of the superellipse (defaults to 1)
heightThe height of the superellipse (defaults to 1)
botLeftXThe x-coordinate of the bottom-left of the superellipse bounding box (defaults to 0)
botLeftYThe y-coordinate of the bottom-left of the superellipse bounding box (defaults to 0)

Definition at line 38 of file SuperellipseGenerator.cpp.

References mHeightOfTopSurface, mPoints, mTargetNodeSpacing, and NEVER_REACHED.

◆ ~SuperellipseGenerator()

SuperellipseGenerator::~SuperellipseGenerator ( )
virtual

Destructor.

Clears mPoints.

Definition at line 201 of file SuperellipseGenerator.cpp.

References mPoints.

Member Function Documentation

◆ GetHeightOfTopSurface()

double SuperellipseGenerator::GetHeightOfTopSurface ( )
Returns
mHeightOfTopSurface

Definition at line 211 of file SuperellipseGenerator.cpp.

References mHeightOfTopSurface.

◆ GetPointsAsChastePoints()

const std::vector< ChastePoint< 2 > > SuperellipseGenerator::GetPointsAsChastePoints ( ) const
Returns
mPoints as a vector of ChastePoint objects

Definition at line 221 of file SuperellipseGenerator.cpp.

References mPoints.

◆ GetPointsAsVectors()

const std::vector< c_vector< double, 2 > > SuperellipseGenerator::GetPointsAsVectors ( ) const
Returns
mPoints

Definition at line 216 of file SuperellipseGenerator.cpp.

References mPoints.

◆ GetTargetNodeSpacing()

double SuperellipseGenerator::GetTargetNodeSpacing ( )
Returns
mPoints

Definition at line 206 of file SuperellipseGenerator.cpp.

References mTargetNodeSpacing.

Member Data Documentation

◆ mHeightOfTopSurface

double SuperellipseGenerator::mHeightOfTopSurface
private

The height at which the point of maximal curvature is achieved in the top right-hand corner of the superellipse.

If the superellipse exponent is 1.0 this definition does not make sense and we choose 80% of the height of the cell.

Definition at line 65 of file SuperellipseGenerator.hpp.

Referenced by SuperellipseGenerator(), and GetHeightOfTopSurface().

◆ mPoints

std::vector<c_vector<double, 2> > SuperellipseGenerator::mPoints
private

Vector to store the points.

Definition at line 68 of file SuperellipseGenerator.hpp.

Referenced by SuperellipseGenerator(), ~SuperellipseGenerator(), GetPointsAsChastePoints(), and GetPointsAsVectors().

◆ mTargetNodeSpacing

double SuperellipseGenerator::mTargetNodeSpacing
private

The target spacing between points.

Definition at line 56 of file SuperellipseGenerator.hpp.

Referenced by SuperellipseGenerator(), and GetTargetNodeSpacing().


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