afl::CompositeField Class Reference

#include <compositefield.h>

Inheritance diagram for afl::CompositeField:

afl::Field List of all members.

Public Member Functions

 CompositeField (const std::string &name, std::vector< std::string > &functions, std::vector< const Field * > fs, size_t columns=1)
virtual ~CompositeField ()
virtual void interpolation (Interpolator *interpolator)
virtual void interpolation (interp_t method)
virtual void interpolation (const std::string &function)
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
virtual Derivative jacobian (const Point &x) const
virtual Point gradient (const Point &x) const
virtual data_t divergence (const Point &x) const
virtual data_t laplacian (const Point &x) const
virtual Point curl (const Point &x) const
virtual void set (const Point &x, const Value &value)
virtual void set (const Point &x, const Value &value, const Derivative &dvalue)
virtual size_t getDimension () const
virtual const std::string & getName () const
virtual const ddf::GeometrygetValueGeometry () const
virtual Point getBoundingBoxMin () const
virtual Point getBoundingBoxMax () const
virtual Fieldclone () const
virtual Value integral (const Simplex &s) const
virtual const Fieldfind (const std::string &name) const

Protected Attributes

std::string _name
FnValue _fn
std::map< std::string, const
Field * > 
_components

Detailed Description

class CompositeField Represents a composition of one or more fields through a mathematical expression


Constructor & Destructor Documentation

afl::CompositeField::CompositeField const std::string &  name,
std::vector< std::string > &  functions,
std::vector< const Field * >  fs,
size_t  columns = 1
 

constructs a blank field

Parameters:
name the name of the field
functions the functions that produce a value
fs a vector of fields to wrap
columns the number of columns in the tensor matrix

virtual afl::CompositeField::~CompositeField  )  [virtual]
 

destroys the object


Member Function Documentation

virtual void afl::CompositeField::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:
ddf::GeometryException if the hypercube has no volume
ddf::InvalidArgumentException if the hyprcube partially overlaps an existing segment.
ddf::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 from afl::Field.

virtual void afl::CompositeField::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:
ddf::GeometryException if the hypercube has no volume
ddf::InvalidArgumentException if the hyprcube partially overlaps an existing segment.

Reimplemented from afl::Field.

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

Returns:
a deep copy of this field

Implements afl::Field.

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

Approximates the field derivative at a point.

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

Reimplemented from afl::Field.

virtual data_t afl::CompositeField::divergence const Point x  )  const [virtual]
 

Approximates the field derivative at a point.

Returns:
the approximated divergence at a point.
Parameters:
x the point to evaluate the derivative at.
Exceptions:
ddf::IllegalOperationException iff the field type is not a vector

Implements afl::Field.

virtual const Field* afl::CompositeField::find const std::string &  name  )  const [virtual]
 

Returns:
a field by that name if one exists
Exceptions:
ddf::ParseException if there is no field named name

virtual Value afl::CompositeField::get const Point x  )  const [virtual]
 

Evaluates the field at a point.

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

Implements afl::Field.

virtual Point afl::CompositeField::getBoundingBoxMax  )  const [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:
ddf::IllegalOperationException if the field is describe analytically and no boundary is set.

Implements afl::Field.

virtual Point afl::CompositeField::getBoundingBoxMin  )  const [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:
ddf::IllegalOperationException if the field is describe analytically and no boundary is set.

Implements afl::Field.

virtual size_t afl::CompositeField::getDimension  )  const [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.

Implements afl::Field.

virtual const std::string& afl::CompositeField::getName  )  const [virtual]
 

Returns:
the name of the field

Reimplemented from afl::Field.

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

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

Reimplemented from afl::Field.

virtual Point afl::CompositeField::gradient const Point x  )  const [virtual]
 

Approximates the field derivative at a point.

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

Implements afl::Field.

virtual Value afl::CompositeField::integral const Simplex s  )  const [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:
ddf::InvalidArgumentException if the simplex has the wrong dimension for the field.

Implements afl::Field.

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

Parameters:
function ignored
Exceptions:
ddf::IllegalOperationException always because composite fields don't take interpolators

Reimplemented from afl::Field.

virtual void afl::CompositeField::interpolation interp_t  method  )  [virtual]
 

Parameters:
method ignored
Exceptions:
ddf::IllegalOperationException always because composite fields don't take interpolators

Implements afl::Field.

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

Parameters:
interpolator ignored
Exceptions:
ddf::IllegalOperationException always because composite fields don't take interpolators

Reimplemented from afl::Field.

virtual Derivative afl::CompositeField::jacobian const Point x  )  const [virtual]
 

Approximates the field derivative at a point.

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

Implements afl::Field.

virtual data_t afl::CompositeField::laplacian const Point x  )  const [virtual]
 

Approximates the field derivative at a point.

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

Implements afl::Field.

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

throws an exception

Parameters:
x ignored
value ignored
dvalue ignored
Exceptions:
ddf::InvalidArgumentException always

Implements afl::Field.

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

throws an exception

Parameters:
x ignored
value ignored
Exceptions:
ddf::InvalidArgumentException always

Implements afl::Field.

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

represents the field as an FRL document

Parameters:
componentsDir the absolute path of a directory to store component files
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 from afl::Field.


Member Data Documentation

std::map<std::string, const Field*> afl::CompositeField::_components [protected]
 

a map from the component fields' names to the the fields

FnValue afl::CompositeField::_fn [protected]
 

the composition functions

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

the composite field's name

Reimplemented from afl::Field.


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