afl::Field Class Reference

#include <field.h>

Inheritance diagram for afl::Field:

afl::CompositeField afl::Field_1 afl::Field_2 afl::Field_3 afl::Field_4 List of all members.

Public Types

typedef Iterator iterator

Public Member Functions

virtual ~Field ()
virtual void interpolation (Interpolator *interpolator)
virtual void interpolation (interp_t method)=0
virtual void interpolation (const std::string &function)
virtual void boundary (Boundary *boundary) throw (exc::GeometryException)
virtual void derivator (Derivator *derivator)
virtual void integrator (Integrator *integrator)
virtual void addBoundarySegment (const Point &p1, const Point &p2)
virtual void addBoundarySegment (const Field *f)
virtual void toXML (std::ostream &doc, const std::string &componentsDir, const std::string &baseURI, bool allInline) const
virtual Value get (const Point &x) const =0
virtual Derivative jacobian (const Point &x) const =0
virtual Point gradient (const Point &x) const =0
virtual data_t divergence (const Point &x) const =0
virtual data_t laplacian (const Point &x) const =0
virtual Point curl (const Point &x) const
virtual Value integral (const Simplex &s) const =0
virtual void set (const Point &x, const Value &value)=0
virtual void set (const Point &x, const Value &value, const Derivative &dvalue)=0
virtual iterator begin () const
virtual iterator end () const
virtual void erase (const iterator &pt)
virtual bool hasDerivative () const
virtual size_t size () const
virtual size_t getDimension () const =0
virtual const BoundarygetBoundary () const
virtual Point getBoundingBoxMin () const =0
virtual Point getBoundingBoxMax () const =0
virtual void resetBoundary ()
virtual const std::string & getName () const
virtual const ddf::GeometrygetValueGeometry () const
virtual std::string getValueTypeStr () const
virtual troolean locate (const Point &p) const
virtual Fieldclone () const =0
void setDirichletCondition (const Field *value)
void setDirichletCondition (const Value &value)
bool hasDirichletCondition () const
Value getDirichlet (const Point &p) const
void setNeumannCondition (const Field *deriv)
void setNeumannCondition (const Value &value)
bool hasNeumannCondition () const
Value getNeumann (const Point &p) const
const ddf::PropertySetgetNumericData () const

Protected Member Functions

 Field (const std::string &name, ddf::PropertySet *pset)

Protected Attributes

ddf::PropertySet_pset
std::string _name
Interpolator_interpolator
Boundary_boundary
Derivator_derivator
Integrator_integrator
const Field_dirichlet
const Field_neumann

Detailed Description

class Field Represents an abstract field in any dimension


Member Typedef Documentation

typedef Iterator afl::Field::iterator
 

Internal types:


Constructor & Destructor Documentation

afl::Field::Field const std::string &  name,
ddf::PropertySet pset
[protected]
 

constructs a blank field

Parameters:
name the name of the field
pset the ddf property set that the field will use.

virtual afl::Field::~Field  )  [virtual]
 

destroys the object


Member Function Documentation

virtual void afl::Field::addBoundarySegment const Field f  )  [virtual]
 

adds a segment of boundary to the field. The segment is defined by a field of one dimension lower than the field itself and the value type of the field is a vector with as many dimensions as the field. If the new segment is completely inside another segment it becomes a "hole" or an "island" in that segment depending on the existing segment's type. If the parametric field is not closed it will be closed with a straight hyper-plane

Parameters:
f the parameter field thad defines the segment
Exceptions:
exc::GeometryException if the hypercube has no volume
exc::InvalidArgumentException if the hyprcube partially overlaps an existing segment.
exc::InvalidArgumentException if the field f is not of the right dimension and type for this field. Note that there is no appropriate boundary field for 1D fields.

Reimplemented in afl::CompositeField, and afl::Field_1.

virtual void afl::Field::addBoundarySegment const Point p1,
const Point p2
[virtual]
 

adds a hypercube segment of boundary to the field. The cube is defined by two opposite points in space. If the new segment is completely inside another segment it becomes a "hole" or an "island" in that segment depending on the type of the existing segment.

Parameters:
p1 one corner of the hypercube
p2 the opposite corner of the hypercube
Exceptions:
exc::GeometryException if the hypercube has no volume
exc::InvalidArgumentException if the hyprcube partially overlaps an existing segment.

Reimplemented in afl::CompositeField.

virtual iterator afl::Field::begin  )  const [virtual]
 

Returns:
a constant iterator to the first set point of data

virtual void afl::Field::boundary Boundary boundary  )  throw (exc::GeometryException) [virtual]
 

sets the boundary for the field

Parameters:
boundary the new boundary for the field
Exceptions:
ddf::GeometryException if the boundary is not right for the field.

virtual Field* afl::Field::clone  )  const [pure virtual]
 

Returns:
a deep copy of this field

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

virtual Point afl::Field::curl const Point x  )  const [virtual]
 

Returns:
the approximated curl at a point.
Parameters:
x the point to evaluate the derivative at.
Exceptions:
exc::IllegalOperationException iff the field type is not 3D vector or the field is not a 3D field.
Todo:
convert the return type to Vector

Reimplemented in afl::CompositeField, and afl::Field_3.

virtual void afl::Field::derivator Derivator derivator  )  [virtual]
 

sets the derivator for the field, deletes the old one if it exists

Parameters:
derivator the new derivator object

virtual data_t afl::Field::divergence const Point x  )  const [pure virtual]
 

Returns:
the approximated divergence at a point.
Parameters:
x the point to evaluate the derivative at.
Exceptions:
exc::IllegalOperationException iff the field type is not a vector of the same magnitude as the field.

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

virtual iterator afl::Field::end  )  const [virtual]
 

Returns:
a constant iterator to the one past the last set point of data

virtual void afl::Field::erase const iterator pt  )  [virtual]
 

removes a point of know data from the set if one exists at that point
note that after the erase pt will point to the next known point

Parameters:
pt an iterator pointing at a particular known point

virtual Value afl::Field::get const Point x  )  const [pure virtual]
 

evaluates the field at a point

Parameters:
x the point to evaluate the field at
Returns:
the interpolated value at point x.

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

virtual const Boundary* afl::Field::getBoundary  )  const [virtual]
 

Returns:
the field's boundary

virtual Point afl::Field::getBoundingBoxMax  )  const [pure virtual]
 

Returns:
the maximums corner of the bounding hyper-box around the field. This the corner with the maximal values on all axes of the point
Exceptions:
exc::IllegalOperationException if the field is describe analytically and no boundary is set.

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

virtual Point afl::Field::getBoundingBoxMin  )  const [pure virtual]
 

Returns:
the minimums corner of the bounding hyper-box around the field. This the corner with the minimal values on all axes of the point
Exceptions:
exc::IllegalOperationException if the field is describe analytically and no boundary is set.

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

virtual size_t afl::Field::getDimension  )  const [pure virtual]
 

Returns:
the number of dimensions in the field. Note that this may be different to the number of dimensions of whatever is stored in the field. For example a 3D scalar field will return 3 and not 1.

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

Value afl::Field::getDirichlet const Point p  )  const
 

Returns:
the Dirichlet boundary condition for the field at point p
Parameters:
p the point to evaluate the boundary condition at

virtual const std::string& afl::Field::getName  )  const [inline, virtual]
 

Returns:
the name of the field

Reimplemented in afl::CompositeField.

Value afl::Field::getNeumann const Point p  )  const
 

Returns:
the Neumann boundary condition for the field at point p
Parameters:
p the point to evaluate the boundary condition at

const ddf::PropertySet* afl::Field::getNumericData  )  const [inline]
 

Returns:
the numeric data of the field

virtual const ddf::Geometry* afl::Field::getValueGeometry  )  const [virtual]
 

@return the ddf geometry of the values stored in this field

Reimplemented in afl::CompositeField.

virtual std::string afl::Field::getValueTypeStr  )  const [virtual]
 

Returns:
the value type of the field. Possible return values are: "scalar", "vector2D", "vector3D", "tensor2D" or "tensor3D"

virtual Point afl::Field::gradient const Point x  )  const [pure virtual]
 

Returns:
the approximated gradient at a point.
Parameters:
x the point to evaluate the derivative at.
Exceptions:
exc::IllegalOperationException iff the field type is not scalar
Todo:
convert the return type to Vector

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

virtual bool afl::Field::hasDerivative  )  const [virtual]
 

Returns:
false if the field is empty or has no derivative information true if the field is not empty and has a derivative

bool afl::Field::hasDirichletCondition  )  const
 

indicates whether a Dirichlet boundary condition was set or not

Returns:
true iff a Dirichlet boundary condition is set for this field

bool afl::Field::hasNeumannCondition  )  const
 

indicates whether a Neumann boundary condition was set or not

Returns:
true iff a Neumann boundary condition is set for this field

virtual Value afl::Field::integral const Simplex s  )  const [pure virtual]
 

provides the integral of the field over a simplex. It is possible to take any integral over multiple simplexes. In the future there may be a function that uses BSP trees to take the integral over multiple simplices at ones at much better than linear rate.

Parameters:
s the simplex to integrate over. The returned Value object has the same shape as the value of the field and each aspect of the value is integrated separately.
Returns:
the approximate integration of the field over a simplex.
Exceptions:
exc::InvalidArgumentException if the simplex has the wrong dimension for the field.

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

virtual void afl::Field::integrator Integrator integrator  )  [virtual]
 

sets the integrator for the field (replaces an old one if it exsts)

Parameters:
integrator the new integrator object for this field

virtual void afl::Field::interpolation const std::string &  function  )  [virtual]
 

creates a new basis function interpolator from a function

Parameters:
function the function in Ui and Ksii that describes the interpolation
Exceptions:
ddf::ParseException if function is not a valid formula
ddf::IllegalOperationException if the field is a composite

Reimplemented in afl::CompositeField.

virtual void afl::Field::interpolation interp_t  method  )  [pure virtual]
 

sets the interpolation method to use in the field

Parameters:
method the interpolation method to use. valid values are:
  • afl:I_LINEAR - use the C0 Lagrange linear interpolation method
  • afl::I_QUADRATIC - use the Lagrange quadratic interpolation method. This interpolation is at least C0, but is C1 at every alternate node.
  • afl::I_CUBIC - use the C1 Hermite cubic interpolation method (requires a derivative property be set before the call to interpolation)
Exceptions:
InvalidArgumentException if derivative information is required but is not present or if another interpolation method is specified.
ddf::IllegalOperationException if the field is a composite

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

virtual void afl::Field::interpolation Interpolator interpolator  )  [virtual]
 

sets the interpolation method to use in the field

Parameters:
interpolator the interpolator to start using. No checks will be applied to verify the data is appropriate for the interpolator.
Exceptions:
ddf::GeometryException if the interpolator is not compatible with the dimension of the field.
ddf::IllegalOperationException if the field is a composite

Reimplemented in afl::CompositeField.

virtual Derivative afl::Field::jacobian const Point x  )  const [pure virtual]
 

Returns:
the approximated Jacobian at a point.
Parameters:
x the point to evaluate the derivative at.

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

virtual data_t afl::Field::laplacian const Point x  )  const [pure virtual]
 

Returns:
the approximated Laplacian at a point.
Parameters:
x the point to evaluate the derivative at.
Exceptions:
exc::IllegalOperationException iff the field type is not a scalar

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

virtual troolean afl::Field::locate const Point p  )  const [virtual]
 

Parameters:
p The point to locate
Returns:
`outside' if the point is outside the domain, `boundary' if it is on the boundary or 'inside' if it is inside the domain.

virtual void afl::Field::resetBoundary  )  [virtual]
 

resets the boundary to an infinite boundary again. Boundary conditions are not changed but the boundary can now be redefined from scratch

virtual void afl::Field::set const Point x,
const Value value,
const Derivative dvalue
[pure virtual]
 

adds a new data point to the field. The interpolation has to guarantee that field would go through this point. If a point is exists in the field, this point would overwrite it.
note that if the field is empty and this is the first set() call to it, then the field will store the field's derivative from now on. It doesn't mean that the derivative has to be used though.

Parameters:
x the location of the new point
value the value of the property at point x
dvalue the derivative of the field at point x
Exceptions:
exc::InvalidArgumentException if the field doesn't store derivatives.

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

virtual void afl::Field::set const Point x,
const Value value
[pure virtual]
 

adds a new data point to the field. The interpolation has to guarantee that field would go through this point. If a point is exists in the field, this point would overwrite it.

Parameters:
x the location of the new point
value the value of the property at point x
Exceptions:
exc::InvalidArgumentException if the field stores derivatives.

Implemented in afl::CompositeField, afl::Field_1, afl::Field_2, afl::Field_3, and afl::Field_4.

void afl::Field::setDirichletCondition const Value value  ) 
 

sets the value expression of a scalar field's boundary

Parameters:
value the value of the field at the boundary
Exceptions:
exc::InvalidArgumentException if the value type of the field is not scalar

void afl::Field::setDirichletCondition const Field value  ) 
 

sets the value of the field at the boundary

Parameters:
value the value expression of the field at the boundary
Exceptions:
exc::InvalidArgumentException if the value type and dimension of the boundary condition don't correspond to the field's value type and dimension

void afl::Field::setNeumannCondition const Value value  ) 
 

sets the Neumann boundary condition for the field

Parameters:
value the derivative of the field at the boundary in the direction normal to the boundary
Exceptions:
exc::InvalidArgumentException if the value type of the field is not scalar

void afl::Field::setNeumannCondition const Field deriv  ) 
 

sets the derivative of the boundary field on the boundary

Parameters:
deriv the derivative of the field at the boundary
Exceptions:
exc::InvalidArgumentException if the value type of the boundary condition doesn't correspond to the field's value type or if its dimension doesn't correspond to the field's dimension.

virtual size_t afl::Field::size  )  const [virtual]
 

Returns:
the number of points that define the field

virtual void afl::Field::toXML std::ostream &  doc,
const std::string &  componentsDir,
const std::string &  baseURI,
bool  allInline
const [virtual]
 

represents the field as an FRL document

Parameters:
doc the output stream that the xml will be appended to
componentsDir the path of a directory to store component files in
baseURI a URI that refers to the directory in componentsDir
allInline will store all possible components inline if true, false means that all possible components should be stored in separate files.

Reimplemented in afl::CompositeField.


Member Data Documentation

Boundary* afl::Field::_boundary [protected]
 

the boundary of this field

Derivator* afl::Field::_derivator [protected]
 

the derivator assigned to this field

const Field* afl::Field::_dirichlet [protected]
 

a Dirichlet boundary condition

Integrator* afl::Field::_integrator [protected]
 

the integrator assigned to this field

Interpolator* afl::Field::_interpolator [protected]
 

the interpolator assigned to query this field

std::string afl::Field::_name [protected]
 

the name of the field

Reimplemented in afl::CompositeField.

const Field* afl::Field::_neumann [protected]
 

a Neumann boundary condition

ddf::PropertySet* afl::Field::_pset [protected]
 

Compositions:


The documentation for this class was generated from the following file:
Generated on Fri Dec 22 07:17:51 2006 for afl by  doxygen 1.4.6