Intrepid
Public Member Functions | Protected Attributes | Related Functions
Intrepid::FieldContainer< Scalar, ArrayTypeId > Class Template Reference

Implementation of a templated lexicographical container for a multi-indexed scalar quantity. FieldContainer object stores a multi-indexed scalar value using the lexicographical index ordering: the rightmost index changes first and the leftmost index changes last. FieldContainer can be viewed as a dynamic multidimensional array whose values can be accessed in two ways: by their multi-index or by their enumeration, using an overloaded [] operator. The enumeration of a value gives the sequential order of the multi-indexed value in the container. The number of indices, i.e., the rank of the container is unlimited. For containers with ranks up to 5 many of the methods are optimized for faster execution. An overloaded () operator is also provided for such low-rank containers to allow element access by multi-index without having to create an auxiliary array for the multi-index. More...

#include <Intrepid_FieldContainer.hpp>

List of all members.

Public Member Functions

 ~FieldContainer ()
 Default destructor.
 FieldContainer ()
 Default constructor.
 FieldContainer (const FieldContainer &right)
 Copy constructor.
 FieldContainer (const int dim0)
 Creates a rank-1 FieldContainer with the specified dimension, initialized by 0.
 FieldContainer (const int dim0, const int dim1)
 Creates a rank-2 FieldContainer with the specified dimensions, initialized by 0.
 FieldContainer (const int dim0, const int dim1, const int dim2)
 Creates a rank-3 FieldContainer with the specified dimensions, initialized by 0.
 FieldContainer (const int dim0, const int dim1, const int dim2, const int dim3)
 Creates a rank-4 FieldContainer with the specified dimensions, initialized by 0.
 FieldContainer (const int dim0, const int dim1, const int dim2, const int dim3, const int dim4)
 Creates a rank-5 FieldContainer with the specified dimensions, initialized by 0.
 FieldContainer (const Teuchos::Array< int > &dimensions)
 Creates a FieldContainer of arbitrary rank,, initialized by 0, using dimensions specified in an array. The size of the input array implicitely defines the rank of the container and its capacity is defined by the specified dimensions.
 FieldContainer (const Teuchos::Array< int > &dimensions, const Teuchos::ArrayView< Scalar > &data)
 Creates a FieldContainer of arbitrary rank, using dimensions specified in the dimensions array, and fills it by deep-copying data from a Teuchos::ArrayView array (which implicitly doubles as Teuchos::ArrayRCP or Teuchos::Array). If the input data array is a Teuchos::ArrayRCP, then '()' should be appended to it when calling this function. This forces direct conversion to a Teuchos::ArrayView, and prevents the call to the shallow-copy constructor that takes a Teuchos::ArrayRCP.
 FieldContainer (const Teuchos::Array< int > &dimensions, const Teuchos::ArrayRCP< Scalar > &data)
 Creates a FieldContainer of arbitrary rank, using dimensions specified in the dimensions array, and wraps (shallow-copies) the data pointed to by the input Teuchos::ArrayRCP array. If a deep copy is desired instead, one can force the use of the constructor that takes Teuchos::ArrayView by appending () to the input Teuchos::ArrayRCP parameter. This forces direct conversion to a Teuchos::ArrayView.
 FieldContainer (const Teuchos::Array< int > &dimensions, Scalar *data, const bool deep_copy=false, const bool owns_mem=false)
 Creates a FieldContainer of arbitrary rank, using dimensions specified in the dimensions array, and either wraps (shallow-copies) Scalar* data, or deep-copies it, based on the value of the parameter deep_copy. Memory management through FieldContainer, via its Teuchos::ArrayRCP data member, can be enabled.
 FieldContainer (const shards::Array< Scalar, shards::NaturalOrder > &data, const bool deep_copy=false, const bool owns_mem=false)
 Creates a FieldContainer either as a wrapper of the shards::Array<Scalar,shards::NaturalOrder> array data, or as its deep copy, based on the value of the parameter deep_copy. Memory management through FieldContainer, via its Teuchos::ArrayRCP data member, can be enabled.
int rank () const
 Return rank of the FieldContainer = number of indices used to tag the multi-indexed value.
int size () const
 Returns size of the FieldContainer defined as the product of its dimensions.
template<class Vector >
void dimensions (Vector &dimensions) const
 Returns array with the dimensions of the container.
int dimension (const int whichDim) const
 Returns the specified dimension.
int getEnumeration (const int i0) const
 Returns enumeration of a value (its order relative to the container), based on its multi-index, for rank-1 containers.
int getEnumeration (const int i0, const int i1) const
 Returns enumeration of a value (its order relative to the container), based on its multi-index, for rank-2 containers.
int getEnumeration (const int i0, const int i1, const int i2) const
 Returns enumeration of a value (its order relative to the container), based on its multi-index, for rank-3 containers.
int getEnumeration (const int i0, const int i1, const int i2, const int i3) const
 Returns enumeration of a value (its order relative to the container), based on its multi-index, for rank-4 containers.
int getEnumeration (const int i0, const int i1, const int i2, const int i3, const int i4) const
 Returns enumeration of a value (its order relative to the container), based on its multi-index, for rank-5 containers.
int getEnumeration (const Teuchos::Array< int > &multiIndex) const
 Returns enumeration of a value (its order relative to the container), based on its multi-index, for containers of arbitrary rank.
void getMultiIndex (int &i0, const int valueEnum) const
 Returns the multi-index of a value, based on its enumeration, as a list, for rank-1 containers.
void getMultiIndex (int &i0, int &i1, const int valueEnum) const
 Returns the multi-index of a value, based on its enumeration, as a list, for rank-2 containers.
void getMultiIndex (int &i0, int &i1, int &i2, const int valueEnum) const
 Returns the multi-index of a value, based on its enumeration, as a list, for rank-3 containers.
void getMultiIndex (int &i0, int &i1, int &i2, int &i3, const int valueEnum) const
 Returns the multi-index of a value, based on its enumeration, as a list, for rank-4 containers.
void getMultiIndex (int &i0, int &i1, int &i2, int &i3, int &i4, const int valueEnum) const
 Returns the multi-index of a value, based on its enumeration, as a list, for rank-5 containers.
template<class Vector >
void getMultiIndex (Vector &multiIndex, const int valueEnum) const
 Returns the multi-index of a value, based on its enumeration, as a vector, for containers of arbitrary rank. The template argument must support the following subset of std::vector interface:
void clear ()
 Clears FieldContainer to trivial container (one with rank = 0 and size = 0)
void resize (const int dim0)
 Resizes FieldContainer to a rank-1 container with the specified dimension, initialized by 0.
void resize (const int dim0, const int dim1)
 Resizes FieldContainer to a rank-2 container with specified dimensions, initialized by 0.
void resize (const int dim0, const int dim1, const int dim2)
 Resizes FieldContainer to a rank-3 container with specified dimensions, initialized by 0.
void resize (const int dim0, const int dim1, const int dim2, const int dim3)
 Resizes FieldContainer to a rank-4 container with specified dimensions, initialized by 0.
void resize (const int dim0, const int dim1, const int dim2, const int dim3, const int dim4)
 Resizes FieldContainer to a rank-5 container with specified dimensions, initialized by 0.
void resize (const Teuchos::Array< int > &newDimensions)
 Resizes FieldContainer to arbitrary rank container, initialized by 0, with dimensions specified in the input array. The size of this array implicitely defined the rank of the FieldContainer.
void resize (const FieldContainer< Scalar, ArrayTypeId > &anotherContainer)
 Resizes FieldContainer to have the same rank and dimensions as another FieldContainer, and initializes by 0.
void resize (const int numPoints, const int numFields, const EFunctionSpace spaceType, const EOperator operatorType, const int spaceDim)
 Resizes FieldContainer to a container whose rank depends on the specified field and operator types and the space dimension, initialized by 0. The admissible combinations of these arguments, the rank of the resulitng container and its dimensions are summarized in the following table:
void initialize (const Scalar value=0)
 Initializes a field container by assigning value to all its elements.
Scalar getValue (const Teuchos::Array< int > &multiIndex) const
 Retrieve value by its multi-index. To retrieve it by enumeration use the overloaded [].
void setValue (const Scalar dataValue, const Teuchos::Array< int > &multiIndex)
 Assign value by its multi-index.
void setValue (const Scalar dataValue, const int order)
 Assign value by its enumeration (order relative to the FieldContainer)
void setValues (const Teuchos::ArrayView< Scalar > &dataArray)
 Fills an existing FieldContainer with Scalars stored in a Teuchos::Array without changing rank and dimensions of the container. Size of the input array must match the size of the container.
void setValues (const Scalar *dataPtr, const int numData)
 Fills an existing FieldContainer with Scalars referenced by dataPtr without changing rank and dimensions of the container. Number of data must match the size of the container.
Teuchos::ArrayRCP< Scalar > getData ()
 Exposes data of FieldContainer, data can be modified.
Teuchos::ArrayRCP< const Scalar > getData () const
 Exposes data of FieldContainer, data cannot be modified.
const Scalar & operator() (const int i0) const
 Overloaded () operators for rank-1 containers. Data cannot be modified.
Scalar & operator() (const int i0)
 Overloaded () operators for rank-1 containers. Data can be modified.
const Scalar & operator() (const int i0, const int i1) const
 Overloaded () operators for rank-2 containers. Data cannot be modified.
Scalar & operator() (const int i0, const int i1)
 Overloaded () operators for rank-2 containers. Data can be modified.
const Scalar & operator() (const int i0, const int i1, const int i2) const
 Overloaded () operator for rank-3 containers. Data cannot be modified.
Scalar & operator() (const int i0, const int i1, const int i2)
 Overloaded () operator for rank-3 containers. Data can be modified.
const Scalar & operator() (const int i0, const int i1, const int i2, const int i3) const
 Overloaded () operator for rank-4 containers. Data cannot be modified.
Scalar & operator() (const int i0, const int i1, const int i2, const int i3)
 Overloaded () operator for rank-4 containers. Data can be modified.
const Scalar & operator() (const int i0, const int i1, const int i2, const int i3, const int i4) const
 Overloaded () operator for rank-5 containers. Data cannot be modified.
Scalar & operator() (const int i0, const int i1, const int i2, const int i3, const int i4)
 Overloaded () operator for rank-5 containers. Data can be modified.
const Scalar & operator[] (const int address) const
 Overloaded [] operator. Returns value based on its enumeration. Data cannot be modified.
Scalar & operator[] (const int address)
 Overloaded [] operator. Returns value based on its enumeration. Data can be modified.
FieldContaineroperator= (const FieldContainer &right)
 Assignment operator *this = right.

Protected Attributes

Teuchos::ArrayRCP< Scalar > data_
 Array to store the multi-indexed quantity.
Teuchos::Array< int > dimensions_
 Array to store dimensions (dimensions) for the multi-indices. Admissible range (dimension) for the k-th index is 0 <= i_k < dimensions_[k]. Size of this array defines the rank of the multi-indexed quantity, i.e., the number of its indices.
int dim0_
 1st dimension of the array
int dim1_
 2nd dimension of the array
int dim2_
 3rd dimension of the array
int dim3_
 4th dimension of the array
int dim4_
 5th dimension of the array

Related Functions

(Note that these are not member functions.)

template<class Scalar , int ArrayTypeId>
std::ostream & operator<< (std::ostream &os, const FieldContainer< Scalar, ArrayTypeId > &container)

Detailed Description

template<class Scalar, int ArrayTypeId = 0>
class Intrepid::FieldContainer< Scalar, ArrayTypeId >

Implementation of a templated lexicographical container for a multi-indexed scalar quantity. FieldContainer object stores a multi-indexed scalar value using the lexicographical index ordering: the rightmost index changes first and the leftmost index changes last. FieldContainer can be viewed as a dynamic multidimensional array whose values can be accessed in two ways: by their multi-index or by their enumeration, using an overloaded [] operator. The enumeration of a value gives the sequential order of the multi-indexed value in the container. The number of indices, i.e., the rank of the container is unlimited. For containers with ranks up to 5 many of the methods are optimized for faster execution. An overloaded () operator is also provided for such low-rank containers to allow element access by multi-index without having to create an auxiliary array for the multi-index.

Definition at line 64 of file Intrepid_FieldContainer.hpp.


Constructor & Destructor Documentation

template<class Scalar , int ArrayTypeId>
Intrepid::FieldContainer< Scalar, ArrayTypeId >::FieldContainer ( const int  dim0)

Creates a rank-1 FieldContainer with the specified dimension, initialized by 0.

Parameters:
dim0[in] - dimension for the only index

Definition at line 66 of file Intrepid_FieldContainerDef.hpp.

References Intrepid::FieldContainer< Scalar, ArrayTypeId >::data_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim0_, and Intrepid::FieldContainer< Scalar, ArrayTypeId >::dimensions_.

template<class Scalar , int ArrayTypeId>
Intrepid::FieldContainer< Scalar, ArrayTypeId >::FieldContainer ( const int  dim0,
const int  dim1 
)

Creates a rank-2 FieldContainer with the specified dimensions, initialized by 0.

Parameters:
dim0[in] - dimension for the 1st index
dim1[in] - dimension for the 2nd index

Definition at line 83 of file Intrepid_FieldContainerDef.hpp.

References Intrepid::FieldContainer< Scalar, ArrayTypeId >::data_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim0_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim1_, and Intrepid::FieldContainer< Scalar, ArrayTypeId >::dimensions_.

template<class Scalar , int ArrayTypeId>
Intrepid::FieldContainer< Scalar, ArrayTypeId >::FieldContainer ( const int  dim0,
const int  dim1,
const int  dim2 
)

Creates a rank-3 FieldContainer with the specified dimensions, initialized by 0.

Parameters:
dim0[in] - dimension for the 1st index
dim1[in] - dimension for the 2nd index
dim2[in] - dimension for the 3rd index

Definition at line 104 of file Intrepid_FieldContainerDef.hpp.

References Intrepid::FieldContainer< Scalar, ArrayTypeId >::data_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim0_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim1_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim2_, and Intrepid::FieldContainer< Scalar, ArrayTypeId >::dimensions_.

template<class Scalar , int ArrayTypeId>
Intrepid::FieldContainer< Scalar, ArrayTypeId >::FieldContainer ( const int  dim0,
const int  dim1,
const int  dim2,
const int  dim3 
)

Creates a rank-4 FieldContainer with the specified dimensions, initialized by 0.

Parameters:
dim0[in] - dimension for the 1st index
dim1[in] - dimension for the 2nd index
dim2[in] - dimension for the 3rd index
dim3[in] - dimension for the 4th index

Definition at line 126 of file Intrepid_FieldContainerDef.hpp.

References Intrepid::FieldContainer< Scalar, ArrayTypeId >::data_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim0_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim1_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim2_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim3_, and Intrepid::FieldContainer< Scalar, ArrayTypeId >::dimensions_.

template<class Scalar , int ArrayTypeId>
Intrepid::FieldContainer< Scalar, ArrayTypeId >::FieldContainer ( const int  dim0,
const int  dim1,
const int  dim2,
const int  dim3,
const int  dim4 
)

Creates a rank-5 FieldContainer with the specified dimensions, initialized by 0.

Parameters:
dim0[in] - dimension for the 1st index
dim1[in] - dimension for the 2nd index
dim2[in] - dimension for the 3rd index
dim3[in] - dimension for the 4th index
dim4[in] - dimension for the 5th index

Definition at line 152 of file Intrepid_FieldContainerDef.hpp.

References Intrepid::FieldContainer< Scalar, ArrayTypeId >::data_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim0_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim1_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim2_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim3_, Intrepid::FieldContainer< Scalar, ArrayTypeId >::dim4_, and Intrepid::FieldContainer< Scalar, ArrayTypeId >::dimensions_.

template<class Scalar , int ArrayTypeId>
Intrepid::FieldContainer< Scalar, ArrayTypeId >::FieldContainer ( const Teuchos::Array< int > &  dimensions)

Creates a FieldContainer of arbitrary rank,, initialized by 0, using dimensions specified in an array. The size of the input array implicitely defines the rank of the container and its capacity is defined by the specified dimensions.

Parameters:
dimensions[in]- array with container dimensions

Definition at line 182 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar, int ArrayTypeId>
Intrepid::FieldContainer< Scalar, ArrayTypeId >::FieldContainer ( const Teuchos::Array< int > &  dimensions,
const Teuchos::ArrayView< Scalar > &  data 
)

Creates a FieldContainer of arbitrary rank, using dimensions specified in the dimensions array, and fills it by deep-copying data from a Teuchos::ArrayView array (which implicitly doubles as Teuchos::ArrayRCP or Teuchos::Array). If the input data array is a Teuchos::ArrayRCP, then '()' should be appended to it when calling this function. This forces direct conversion to a Teuchos::ArrayView, and prevents the call to the shallow-copy constructor that takes a Teuchos::ArrayRCP.

Parameters:
dimensions[in]- array with container dimensions
data[in]- array with container values

Definition at line 248 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar, int ArrayTypeId>
Intrepid::FieldContainer< Scalar, ArrayTypeId >::FieldContainer ( const Teuchos::Array< int > &  dimensions,
const Teuchos::ArrayRCP< Scalar > &  data 
)

Creates a FieldContainer of arbitrary rank, using dimensions specified in the dimensions array, and wraps (shallow-copies) the data pointed to by the input Teuchos::ArrayRCP array. If a deep copy is desired instead, one can force the use of the constructor that takes Teuchos::ArrayView by appending () to the input Teuchos::ArrayRCP parameter. This forces direct conversion to a Teuchos::ArrayView.

Parameters:
dimensions[in]- array with container dimensions
data[in]- array with container values

Definition at line 320 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar, int ArrayTypeId>
Intrepid::FieldContainer< Scalar, ArrayTypeId >::FieldContainer ( const Teuchos::Array< int > &  dimensions,
Scalar *  data,
const bool  deep_copy = false,
const bool  owns_mem = false 
)

Creates a FieldContainer of arbitrary rank, using dimensions specified in the dimensions array, and either wraps (shallow-copies) Scalar* data, or deep-copies it, based on the value of the parameter deep_copy. Memory management through FieldContainer, via its Teuchos::ArrayRCP data member, can be enabled.

Parameters:
dimensions[in]- array with container dimensions
data[in]- array with container values
deep_copy[in]- if true, then deep-copy, otherwise shallow-copy; default: false
owns_mem[in]- if true, the field container will manage memory; default: false

Definition at line 392 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar, int ArrayTypeId>
Intrepid::FieldContainer< Scalar, ArrayTypeId >::FieldContainer ( const shards::Array< Scalar, shards::NaturalOrder > &  data,
const bool  deep_copy = false,
const bool  owns_mem = false 
)

Creates a FieldContainer either as a wrapper of the shards::Array<Scalar,shards::NaturalOrder> array data, or as its deep copy, based on the value of the parameter deep_copy. Memory management through FieldContainer, via its Teuchos::ArrayRCP data member, can be enabled.

Parameters:
data[in]- array with container values
deep_copy[in]- if true, then deep-copy, otherwise shallow-copy; default: false
owns_mem[in]- if true, the field container will manage memory; default: false

Definition at line 465 of file Intrepid_FieldContainerDef.hpp.


Member Function Documentation

template<class Scalar , int ArrayTypeId>
int Intrepid::FieldContainer< Scalar, ArrayTypeId >::dimension ( const int  whichDim) const [inline]

Returns the specified dimension.

Parameters:
whichDim[in] - order of the dimension we want to get

Definition at line 625 of file Intrepid_FieldContainerDef.hpp.

Referenced by Intrepid::CellTools< Scalar >::mapToReferenceFrame().

template<class Scalar , int ArrayTypeId>
int Intrepid::FieldContainer< Scalar, ArrayTypeId >::getEnumeration ( const int  i0,
const int  i1,
const int  i2,
const int  i3 
) const [inline]

Returns enumeration of a value (its order relative to the container), based on its multi-index, for rank-4 containers.

Parameters:
i0[in] - 1st index
i1[in] - 2nd index
i2[in] - 3rd index
i3[in] - 4th index

Definition at line 686 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
int Intrepid::FieldContainer< Scalar, ArrayTypeId >::getEnumeration ( const int  i0,
const int  i1,
const int  i2,
const int  i3,
const int  i4 
) const [inline]

Returns enumeration of a value (its order relative to the container), based on its multi-index, for rank-5 containers.

Parameters:
i0[in] - 1st index
i1[in] - 2nd index
i2[in] - 3rd index
i3[in] - 4th index
i4[in] - 5th index

Definition at line 708 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
int Intrepid::FieldContainer< Scalar, ArrayTypeId >::getEnumeration ( const int  i0) const [inline]

Returns enumeration of a value (its order relative to the container), based on its multi-index, for rank-1 containers.

Parameters:
i0[in] - 1st index

Definition at line 638 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
int Intrepid::FieldContainer< Scalar, ArrayTypeId >::getEnumeration ( const Teuchos::Array< int > &  multiIndex) const

Returns enumeration of a value (its order relative to the container), based on its multi-index, for containers of arbitrary rank.

Parameters:
multiIndex[in] - array representing a multi-index

Definition at line 734 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
int Intrepid::FieldContainer< Scalar, ArrayTypeId >::getEnumeration ( const int  i0,
const int  i1 
) const [inline]

Returns enumeration of a value (its order relative to the container), based on its multi-index, for rank-2 containers.

Parameters:
i0[in] - 1st index
i1[in] - 2nd index

Definition at line 651 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
int Intrepid::FieldContainer< Scalar, ArrayTypeId >::getEnumeration ( const int  i0,
const int  i1,
const int  i2 
) const [inline]

Returns enumeration of a value (its order relative to the container), based on its multi-index, for rank-3 containers.

Parameters:
i0[in] - 1st index
i1[in] - 2nd index
i2[in] - 3rd index

Definition at line 667 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
template<class Vector >
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::getMultiIndex ( Vector &  multiIndex,
const int  valueEnum 
) const

Returns the multi-index of a value, based on its enumeration, as a vector, for containers of arbitrary rank. The template argument must support the following subset of std::vector interface:

  • Vector.size()
  • Vector.resize()
  • Vector[]
Parameters:
multiIndex[out] - vector containg multi-index of the specified enumeration
valueEnum[in] - enumeration of the value (its order relative to the container)

Definition at line 966 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::getMultiIndex ( int &  i0,
const int  valueEnum 
) const

Returns the multi-index of a value, based on its enumeration, as a list, for rank-1 containers.

Parameters:
i0[out] - 1st index
valueEnum[in] - enumeration of the value (its order relative to the container)

Definition at line 830 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::getMultiIndex ( int &  i0,
int &  i1,
const int  valueEnum 
) const

Returns the multi-index of a value, based on its enumeration, as a list, for rank-2 containers.

Parameters:
i0[out] - 1st index
i1[out] - 2nd index
valueEnum[in] - enumeration of the value (its order relative to the container)

Definition at line 846 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::getMultiIndex ( int &  i0,
int &  i1,
int &  i2,
const int  valueEnum 
) const

Returns the multi-index of a value, based on its enumeration, as a list, for rank-3 containers.

Parameters:
i0[out] - 1st index
i1[out] - 2nd index
i2[out] - 3rd index
valueEnum[in] - enumeration of the value (its order relative to the container)

Definition at line 865 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::getMultiIndex ( int &  i0,
int &  i1,
int &  i2,
int &  i3,
const int  valueEnum 
) const

Returns the multi-index of a value, based on its enumeration, as a list, for rank-4 containers.

Parameters:
i0[out] - 1st index
i1[out] - 2nd index
i2[out] - 3rd index
i3[out] - 4th index
valueEnum[in] - enumeration of the value (its order relative to the container)

Definition at line 893 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::getMultiIndex ( int &  i0,
int &  i1,
int &  i2,
int &  i3,
int &  i4,
const int  valueEnum 
) const

Returns the multi-index of a value, based on its enumeration, as a list, for rank-5 containers.

Parameters:
i0[out] - 1st index
i1[out] - 2nd index
i2[out] - 3rd index
i3[out] - 4th index
i4[out] - 5th index
valueEnum[in] - enumeration of the value (its order relative to the container)

Definition at line 927 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
Scalar Intrepid::FieldContainer< Scalar, ArrayTypeId >::getValue ( const Teuchos::Array< int > &  multiIndex) const [inline]

Retrieve value by its multi-index. To retrieve it by enumeration use the overloaded [].

Parameters:
multiIndex[in] - array containing multi-index of the desired value

Definition at line 1338 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
Scalar & Intrepid::FieldContainer< Scalar, ArrayTypeId >::operator() ( const int  i0,
const int  i1,
const int  i2 
) [inline]

Overloaded () operator for rank-3 containers. Data can be modified.

Parameters:
i0[in] - 1st index
i1[in] - 2nd index
i2[in] - 3rd index

Definition at line 1465 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
const Scalar & Intrepid::FieldContainer< Scalar, ArrayTypeId >::operator() ( const int  i0) const [inline]

Overloaded () operators for rank-1 containers. Data cannot be modified.

Parameters:
i0[in] - 1st index

Definition at line 1387 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
Scalar & Intrepid::FieldContainer< Scalar, ArrayTypeId >::operator() ( const int  i0) [inline]

Overloaded () operators for rank-1 containers. Data can be modified.

Parameters:
i0[in] - 1st index

Definition at line 1400 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
Scalar & Intrepid::FieldContainer< Scalar, ArrayTypeId >::operator() ( const int  i0,
const int  i1,
const int  i2,
const int  i3,
const int  i4 
) [inline]

Overloaded () operator for rank-5 containers. Data can be modified.

Parameters:
i0[in] - 1st index
i1[in] - 2nd index
i2[in] - 3rd index
i3[in] - 4th index
i4[in] - 5th index

Definition at line 1551 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
const Scalar & Intrepid::FieldContainer< Scalar, ArrayTypeId >::operator() ( const int  i0,
const int  i1 
) const [inline]

Overloaded () operators for rank-2 containers. Data cannot be modified.

Parameters:
i0[in] - 1st index
i1[in] - 2nd index

Definition at line 1414 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
const Scalar & Intrepid::FieldContainer< Scalar, ArrayTypeId >::operator() ( const int  i0,
const int  i1,
const int  i2 
) const [inline]

Overloaded () operator for rank-3 containers. Data cannot be modified.

Parameters:
i0[in] - 1st index
i1[in] - 2nd index
i2[in] - 3rd index

Definition at line 1447 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
Scalar & Intrepid::FieldContainer< Scalar, ArrayTypeId >::operator() ( const int  i0,
const int  i1,
const int  i2,
const int  i3 
) [inline]

Overloaded () operator for rank-4 containers. Data can be modified.

Parameters:
i0[in] - 1st index
i1[in] - 2nd index
i2[in] - 3rd index
i3[in] - 4th index

Definition at line 1506 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
const Scalar & Intrepid::FieldContainer< Scalar, ArrayTypeId >::operator() ( const int  i0,
const int  i1,
const int  i2,
const int  i3 
) const [inline]

Overloaded () operator for rank-4 containers. Data cannot be modified.

Parameters:
i0[in] - 1st index
i1[in] - 2nd index
i2[in] - 3rd index
i3[in] - 4th index

Definition at line 1485 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
const Scalar & Intrepid::FieldContainer< Scalar, ArrayTypeId >::operator() ( const int  i0,
const int  i1,
const int  i2,
const int  i3,
const int  i4 
) const [inline]

Overloaded () operator for rank-5 containers. Data cannot be modified.

Parameters:
i0[in] - 1st index
i1[in] - 2nd index
i2[in] - 3rd index
i3[in] - 4th index
i4[in] - 5th index

Definition at line 1528 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
Scalar & Intrepid::FieldContainer< Scalar, ArrayTypeId >::operator() ( const int  i0,
const int  i1 
) [inline]

Overloaded () operators for rank-2 containers. Data can be modified.

Parameters:
i0[in] - 1st index
i1[in] - 2nd index

Definition at line 1430 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::resize ( const int  dim0,
const int  dim1,
const int  dim2,
const int  dim3 
) [inline]

Resizes FieldContainer to a rank-4 container with specified dimensions, initialized by 0.

Parameters:
dim0[in] - dimension for the 1st index
dim1[in] - dimension for the 2nd index
dim2[in] - dimension for the 3rd index
dim3[in] - dimension for the 4th index

Definition at line 1147 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::resize ( const int  dim0,
const int  dim1,
const int  dim2,
const int  dim3,
const int  dim4 
) [inline]

Resizes FieldContainer to a rank-5 container with specified dimensions, initialized by 0.

Parameters:
dim0[in] - dimension for the 1st index
dim1[in] - dimension for the 2nd index
dim2[in] - dimension for the 3rd index
dim3[in] - dimension for the 4th index
dim4[in] - dimension for the 5th index

Definition at line 1167 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar, int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::resize ( const int  numPoints,
const int  numFields,
const EFunctionSpace  spaceType,
const EOperator  operatorType,
const int  spaceDim 
)

Resizes FieldContainer to a container whose rank depends on the specified field and operator types and the space dimension, initialized by 0. The admissible combinations of these arguments, the rank of the resulitng container and its dimensions are summarized in the following table:

      |--------------------|-------------------|-------------------|-------------------|
      |operator/field rank |       rank 0      | rank 1 2D/3D      | rank 2 2D/3D      |
      |--------------------|-------------------|-------------------|-------------------|
      |       VALUE        | (P,F)             | (P,F,D)           | (P,F,D,D)         |
      |--------------------|-------------------|-------------------|-------------------|
      |     GRAD, D1       | (P,F,D)           | (P,F,D,D)         | (P,F,D,D,D)       |
      |--------------------|-------------------|-------------------|-------------------|
      |        CURL        | (P,F,D) (undef3D) | (P,F)/(P,F,D)     | (P,F,D)/(P,F,D,D) |
      |--------------------|-------------------|-------------------|-------------------|
      |        DIV         | (P,F,D) (only 1D) | (P,F)             | (P,F,D)           |
      |--------------------|-------------------|-------------------|-------------------|
      |    D1,D2,..,D10    | (P,F,K)           | (P,F,D,K)         | (P,F,D,D,K)       |
      |--------------------|-------------------|-------------------|-------------------|
      
      |------|----------------------|---------------------------|
      |      |         Index        |         Dimension         |
      |------|----------------------|---------------------------|
      |   P  |         point        |  0 <= P < numPoints       |
      |   F  |         field        |  0 <= F < numFields       |
      |   D  |   field coordinate   |  0 <= D < spaceDim        |
      |   K  |   enumeration of Dk  |  0 <= K < DkCardinality   |
      |------|----------------------|---------------------------|
      
Remarks:
  • Enumeration of Dk (derivatives of total order k) follows the lexicographical order of the partial derivatives; see getDkEnumeration() for details.
Parameters:
numPoints[in] - number of evaluation points
numFields[in] - number of fields that will be evaluated
spaceType[in] - type of the function space whose basis will be evaluated
operatorType[in] - type of the operator that will be applied to the basis
spaceDim[in] - dimension of the ambient space

Definition at line 1244 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::resize ( const int  dim0) [inline]
template<class Scalar , int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::resize ( const int  dim0,
const int  dim1,
const int  dim2 
) [inline]

Resizes FieldContainer to a rank-3 container with specified dimensions, initialized by 0.

Parameters:
dim0[in] - dimension for the 1st index
dim1[in] - dimension for the 2nd index
dim2[in] - dimension for the 3rd index

Definition at line 1129 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar , int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::resize ( const Teuchos::Array< int > &  newDimensions)

Resizes FieldContainer to arbitrary rank container, initialized by 0, with dimensions specified in the input array. The size of this array implicitely defined the rank of the FieldContainer.

Parameters:
newDimensions[in]- new upper values for index ranges

Definition at line 1030 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar, int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::resize ( const FieldContainer< Scalar, ArrayTypeId > &  anotherContainer) [inline]

Resizes FieldContainer to have the same rank and dimensions as another FieldContainer, and initializes by 0.

Parameters:
anotherContainer[in]- a FieldContainer

Definition at line 1189 of file Intrepid_FieldContainerDef.hpp.

References Intrepid::FieldContainer< Scalar, ArrayTypeId >::dimensions().

template<class Scalar , int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::resize ( const int  dim0,
const int  dim1 
) [inline]

Resizes FieldContainer to a rank-2 container with specified dimensions, initialized by 0.

Parameters:
dim0[in] - dimension for the 1st index
dim1[in] - dimension for the 2nd index

Definition at line 1113 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar, int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::setValue ( const Scalar  dataValue,
const Teuchos::Array< int > &  multiIndex 
) [inline]

Assign value by its multi-index.

Parameters:
dataValue[in] - value to be assigned
multiIndex[in] - multi-index of the value

Definition at line 1345 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar, int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::setValue ( const Scalar  dataValue,
const int  order 
) [inline]

Assign value by its enumeration (order relative to the FieldContainer)

Parameters:
dataValue[in] - value to be assigned
order[in] - enumeration of the value

Definition at line 1353 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar, int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::setValues ( const Teuchos::ArrayView< Scalar > &  dataArray)

Fills an existing FieldContainer with Scalars stored in a Teuchos::Array without changing rank and dimensions of the container. Size of the input array must match the size of the container.

Parameters:
dataArray[in]- new values

Definition at line 1361 of file Intrepid_FieldContainerDef.hpp.

template<class Scalar, int ArrayTypeId>
void Intrepid::FieldContainer< Scalar, ArrayTypeId >::setValues ( const Scalar *  dataPtr,
const int  numData 
)

Fills an existing FieldContainer with Scalars referenced by dataPtr without changing rank and dimensions of the container. Number of data must match the size of the container.

Parameters:
dataPtr[in] - new values
numData[in] - number of values

Definition at line 1373 of file Intrepid_FieldContainerDef.hpp.


Friends And Related Function Documentation

template<class Scalar , int ArrayTypeId>
std::ostream & operator<< ( std::ostream &  os,
const FieldContainer< Scalar, ArrayTypeId > &  container 
) [related]

Outputs a formated stream with FieldContainer data. For debugging purposes.

Definition at line 1626 of file Intrepid_FieldContainerDef.hpp.


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