15 #ifndef SERIALBOX_CORE_FRONTEND_STELLA_DATAFIELDINFO_H 16 #define SERIALBOX_CORE_FRONTEND_STELLA_DATAFIELDINFO_H 37 DataFieldInfo(
const boost::shared_ptr<FieldMetainfoImpl>& fieldMetainfoImpl);
50 template <
typename TDataField>
51 void Init(
const TDataField& dataField) {
52 Init(dataField, dataField.name());
61 template <
typename TDataField>
62 void Init(
const TDataField& dataField, std::string
name) {
65 domain.
Init(dataField.calculationDomain().iSize(), dataField.calculationDomain().jSize(),
66 dataField.calculationDomain().kSize());
69 size.
Init(dataField.storage().allocatedSize().iSize(),
70 dataField.storage().allocatedSize().jSize(),
71 dataField.storage().allocatedSize().kSize());
75 boundary.
Init(dataField.boundary().iMinusOffset(), dataField.boundary().iPlusOffset(),
76 dataField.boundary().jMinusOffset(), dataField.boundary().jPlusOffset(),
77 dataField.boundary().kMinusOffset(), dataField.boundary().kPlusOffset());
80 const bool haloInI = !(size.
iSize() <= domain.
iSize());
81 const bool haloInJ = !(size.
jSize() <= domain.
jSize());
82 const bool haloInK = !(size.
kSize() <= domain.
kSize());
83 const int iMinus = haloInI ? -boundary.
iMinusOffset() : 0;
84 const int iPlus = haloInI ? boundary.
iPlusOffset() : 0;
85 const int jMinus = haloInJ ? -boundary.
jMinusOffset() : 0;
86 const int jPlus = haloInJ ? boundary.
jPlusOffset() : 0;
87 const int kMinus = haloInK ? -boundary.
kMinusOffset() : 0;
88 const int kPlus = haloInK ? boundary.
kPlusOffset() : 0;
91 Init(name, type_name<typename TDataField::ValueType>(),
sizeof(
typename TDataField::ValueType),
92 dataField.storage().rank(), size.
iSize(), size.
jSize(), size.
kSize(), 1, iMinus, iPlus,
93 jMinus, jPlus, kMinus, kPlus, 0, 0);
117 int kSize,
int lSize,
int iMinusHalo,
int iPlusHalo,
int jMinusHalo,
int jPlusHalo,
118 int kMinusHalo,
int kPlusHalo,
int lMinusHalo,
int lPlusHalo);
124 std::string
name()
const;
127 std::string
type()
const;
202 template <
typename ValueType>
203 void AddMetainfo(
const std::string& key,
const ValueType& value) {
217 void setImpl(
const boost::shared_ptr<FieldMetainfoImpl>& fieldMetainfoImpl);
220 boost::shared_ptr<FieldMetainfoImpl>&
getImpl();
221 const boost::shared_ptr<FieldMetainfoImpl>&
getImpl()
const;
224 boost::shared_ptr<FieldMetainfoImpl> fieldMetainfoImpl_;
boost::shared_ptr< FieldMetainfoImpl > & getImpl()
Get implementation pointer.
std::string name() const
The field name.
int iSize() const
The size of the field in i-direction, including the halo.
int kPlusHaloSize() const
The size of the halo in positive k-direction.
int kSize() const
The size of the field in k-direction, including the halo.
Information of a data-field.
int kMinusOffset() const
Offset in k-minus direction.
int lSize() const
The size of the field in l-direction, including the halo.
bool operator!=(const DataFieldInfo &other) const
Comparator operator.
int jSize() const
Size in j dimension.
bool operator==(const DataFieldInfo &other) const
Comparator operator.
int jPlusOffset() const
Offset in j-plus direction.
IJKSize size() const
The total storage of the field (calculation domain and boundary)
std::string type() const
The field scalar type.
const MetainfoSet & metainfo() const
Gives read-only access to the metainformation associated with the field.
int dataSize() const
The size of the field data in bytes is returned.
int kMinusHaloSize() const
The size of the halo in negative k-direction.
IJKSize calculationDomain() const
The calculation domain of the field.
Namespace of the STELLA frontend.
Namespace of the serialbox library.
void Init(const TDataField &dataField)
Initialize with field.
int lMinusHaloSize() const
The size of the halo in negative l-direction.
int jMinusOffset() const
Offset in j-minus direction.
int fieldLength() const
The number of bytes occupied by the field.
int lPlusHaloSize() const
The size of the halo in positive l-direction.
void AddMetainfo(const std::string &key, const ValueType &value)
Add new metainformation.
int jMinusHaloSize() const
The size of the halo in negative j-direction.
void Init(const int iMinusOffset, const int iPlusOffset, const int jMinusOffset, const int jPlusOffset, const int kMinusOffset, const int kPlusOffset)
Init the container.
int iMinusHaloSize() const
The size of the halo in negative i-direction.
int iPlusHaloSize() const
The size of the halo in positive i-direction.
void Init(const TDataField &dataField, std::string name)
Initializer with field and new name.
int kPlusOffset() const
Offset in k-plus direction.
int bytesPerElement() const
The dimension in bytes of a single element.
DataFieldInfo & operator=(const DataFieldInfo &other)
Assignment operator.
int iSize() const
Size in i dimension.
Container for i, j, k Size.
IJKBoundary boundary() const
The size of the halo of the field.
void Init(const int iSize, const int jSize, const int kSize)
Init the container.
Container for the boundary size.
std::string ToString() const
Gives a string representation of the object, useful for debugging.
int kSize() const
Size in k dimension.
int iPlusOffset() const
Offset in i-plus direction.
int iMinusOffset() const
Offset in i-minus direction.
int rank() const
The number of dimensions of the field.
DataFieldInfo()
Default constructor.
void setImpl(const boost::shared_ptr< FieldMetainfoImpl > &fieldMetainfoImpl)
Set implementation pointer.
int jPlusHaloSize() const
The size of the halo in positive j-direction.
int jSize() const
The size of the field in j-direction, including the halo.