49 #ifndef INTREPID_FIELDCONTAINER_HPP
50 #define INTREPID_FIELDCONTAINER_HPP
52 #include "Intrepid_ConfigDefs.hpp"
55 #include "Teuchos_Array.hpp"
56 #include "Teuchos_ArrayRCP.hpp"
57 #include "Teuchos_ArrayView.hpp"
58 #include "Shards_Array.hpp"
59 #include "Teuchos_RCP.hpp"
60 #include "Teuchos_BLAS.hpp"
61 #include "Teuchos_oblackholestream.hpp"
62 #include "Teuchos_Assert.hpp"
77 template<
class Scalar,
int ArrayTypeId=0>
87 Teuchos::ArrayRCP<Scalar>
data_;
89 typedef typename Teuchos::ArrayRCP<Scalar>::iterator data_ptr_t;
126 data_ptr_ = Teuchos::NullIteratorTraits<data_ptr_t>::getNull();
212 const Teuchos::ArrayView<Scalar>& data);
226 const Teuchos::ArrayRCP<Scalar>& data);
242 const bool deep_copy =
false,
243 const bool owns_mem =
false);
255 FieldContainer(
const shards::Array<Scalar,shards::NaturalOrder>& data,
256 const bool deep_copy =
false,
257 const bool owns_mem =
false);
280 template<
class Vector>
366 const int valueEnum)
const;
378 const int valueEnum)
const;
392 const int valueEnum)
const;
408 const int valueEnum)
const;
426 const int valueEnum)
const;
439 template<
class Vector>
441 const int valueEnum)
const;
459 void resize(
const int dim0);
467 void resize(
const int dim0,
477 void resize(
const int dim0,
489 void resize(
const int dim0,
503 void resize(
const int dim0,
515 void resize(
const Teuchos::Array<int>& newDimensions);
564 void resize(
const int numPoints,
566 const EFunctionSpace spaceType,
567 const EOperator operatorType,
586 Scalar
getValue(
const Teuchos::Array<int>& multiIndex)
const;
594 void setValue(
const Scalar dataValue,
595 const Teuchos::Array<int>& multiIndex);
603 void setValue(
const Scalar dataValue,
612 void setValues(
const Teuchos::ArrayView<Scalar>& dataArray);
634 Teuchos::ArrayRCP<const Scalar>
getData()
const {
747 const Scalar &
operator [] (
const int address)
const;
772 template<
class Scalar,
int ArrayTypeId>
773 std::ostream& operator << (std::ostream& os, const FieldContainer<Scalar, ArrayTypeId>& container);
922 #if defined(Intrepid_SHOW_DEPRECATED_WARNINGS)
924 #warning "The Intrepid package is deprecated"
int size() const
Returns size of the FieldContainer defined as the product of its dimensions.
const Scalar & operator[](const int address) const
Overloaded [] operator. Returns value based on its enumeration. Data cannot be modified.
FieldContainer & operator=(const FieldContainer &right)
Assignment operator *this = right.
Scalar scalar_type
The template parameter of this class; the type of objects stored.
int dim3_
4th dimension of the array
Teuchos::Array< int > dimensions_
Array to store dimensions (dimensions) for the multi-indices. Admissible range (dimension) for the k-...
void clear()
Clears FieldContainer to trivial container (one with rank = 0 and size = 0)
int dim1_
2nd dimension of the array
int dimension(const int whichDim) const
Returns the specified dimension.
int dim2_
3rd dimension of the array
Teuchos::ArrayRCP< Scalar > data_
Array to store the multi-indexed quantity.
Contains definitions of custom data types in Intrepid.
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...
int rank() const
Return rank of the FieldContainer = number of indices used to tag the multi-indexed value...
int getEnumeration(const int i0) const
Returns enumeration of a value (its order relative to the container), based on its multi-index...
const Scalar & operator()(const int i0) const
Overloaded () operators for rank-1 containers. Data cannot be modified.
void setValue(const Scalar dataValue, const Teuchos::Array< int > &multiIndex)
Assign value by its multi-index.
void setValues(const Teuchos::ArrayView< Scalar > &dataArray)
Fills an existing FieldContainer with Scalars stored in a Teuchos::Array without changing rank and di...
~FieldContainer()
Default destructor.
Implementation of a templated lexicographical container for a multi-indexed scalar quantity...
void resize(const int dim0)
Resizes FieldContainer to a rank-1 container with the specified dimension, initialized by 0...
FieldContainer()
Default constructor.
void initialize(const Scalar value=0)
Initializes a field container by assigning value to all its elements.
Teuchos::ArrayRCP< const Scalar > getData() const
Exposes data of FieldContainer, data cannot be modified.
Teuchos::ArrayRCP< Scalar > getData()
Exposes data of FieldContainer, data can be modified.
int dim0_
1st dimension of the array
Definition file for utility class to provide multidimensional containers.
int dim4_
5th dimension of the array
Scalar getValue(const Teuchos::Array< int > &multiIndex) const
Retrieve value by its multi-index. To retrieve it by enumeration use the overloaded []...
void dimensions(Vector &dimensions) const
Returns array with the dimensions of the container.