Intrepid
Public Types | Public Member Functions | Protected Types | Protected Attributes | Related Functions | List of all members
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>

Public Types

typedef Scalar scalar_type
 The template parameter of this class; the type of objects stored.
 

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. More...
 
 FieldContainer (const int dim0, const int dim1)
 Creates a rank-2 FieldContainer with the specified dimensions, initialized by 0. More...
 
 FieldContainer (const int dim0, const int dim1, const int dim2)
 Creates a rank-3 FieldContainer with the specified dimensions, initialized by 0. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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: More...
 
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. More...
 
void resize (const int dim0, const int dim1)
 Resizes FieldContainer to a rank-2 container with specified dimensions, initialized by 0. More...
 
void resize (const int dim0, const int dim1, const int dim2)
 Resizes FieldContainer to a rank-3 container with specified dimensions, initialized by 0. More...
 
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. More...
 
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. More...
 
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. More...
 
void resize (const FieldContainer< Scalar, ArrayTypeId > &anotherContainer)
 Resizes FieldContainer to have the same rank and dimensions as another FieldContainer, and initializes by 0. More...
 
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: More...
 
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 []. More...
 
void setValue (const Scalar dataValue, const Teuchos::Array< int > &multiIndex)
 Assign value by its multi-index. More...
 
void setValue (const Scalar dataValue, const int order)
 Assign value by its enumeration (order relative to the FieldContainer) More...
 
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. More...
 
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. More...
 
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. More...
 
Scalar & operator() (const int i0)
 Overloaded () operators for rank-1 containers. Data can be modified. More...
 
const Scalar & operator() (const int i0, const int i1) const
 Overloaded () operators for rank-2 containers. Data cannot be modified. More...
 
Scalar & operator() (const int i0, const int i1)
 Overloaded () operators for rank-2 containers. Data can be modified. More...
 
const Scalar & operator() (const int i0, const int i1, const int i2) const
 Overloaded () operator for rank-3 containers. Data cannot be modified. More...
 
Scalar & operator() (const int i0, const int i1, const int i2)
 Overloaded () operator for rank-3 containers. Data can be modified. More...
 
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. More...
 
Scalar & operator() (const int i0, const int i1, const int i2, const int i3)
 Overloaded () operator for rank-4 containers. Data can be modified. More...
 
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. More...
 
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. More...
 
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 Types

typedef Teuchos::ArrayRCP
< Scalar >::iterator 
data_ptr_t
 

Protected Attributes

Teuchos::ArrayRCP< Scalar > data_
 Array to store the multi-indexed quantity.
 
data_ptr_t data_ptr_
 
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 78 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 81 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 99 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 121 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 146 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 175 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 208 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 275 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 348 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 421 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 496 of file Intrepid_FieldContainerDef.hpp.

Member Function Documentation

template<class Scalar , int ArrayTypeId>
int Intrepid::FieldContainer< Scalar, ArrayTypeId >::dimension ( const int  whichDim) const
inline
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 671 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 684 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 700 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
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 719 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 741 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 767 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 863 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 879 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 898 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 926 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 960 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 999 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 1383 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 1434 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 1447 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 1461 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 1477 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 1494 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 1512 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 1532 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 1553 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 1575 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 1598 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 
)
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 1152 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 
)
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 1169 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 1188 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 1209 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 1066 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 1232 of file Intrepid_FieldContainerDef.hpp.

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

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 1288 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 1390 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 1398 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 1406 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 1419 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 1674 of file Intrepid_FieldContainerDef.hpp.


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