00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef PHX_FIELD_H
00033 #define PHX_FIELD_H
00034
00035 #include <iostream>
00036 #include <string>
00037 #include "Teuchos_ArrayRCP.hpp"
00038 #include "Phalanx_FieldTag_Tag.hpp"
00039
00040 namespace PHX {
00041
00042 template<typename DataT>
00043 class Field {
00044
00045 public:
00046
00047 typedef DataT value_type;
00048
00049 Field(const std::string& name, const Teuchos::RCP<PHX::DataLayout>& t);
00050
00051 Field(const PHX::Tag<DataT>& v);
00052
00053 Field();
00054
00055 ~Field();
00056
00057 const PHX::FieldTag& fieldTag() const;
00058
00059 DataT& operator[](int index);
00060
00061 typename Teuchos::ArrayRCP<DataT>::Ordinal size() const;
00062
00063 void setFieldTag(const PHX::Tag<DataT>& t);
00064
00065 void setFieldData(const Teuchos::ArrayRCP<DataT>& d);
00066
00067 void print(std::ostream& os) const;
00068
00069 private:
00070
00071 PHX::Tag<DataT> m_tag;
00072
00073 Teuchos::ArrayRCP<DataT> m_field_data;
00074
00075 #ifdef PHX_DEBUG
00076 bool m_tag_set;
00077 bool m_data_set;
00078 static const std::string m_field_tag_error_msg;
00079 static const std::string m_field_data_error_msg;
00080 #endif
00081
00082 };
00083
00084 template<typename DataT>
00085 std::ostream& operator<<(std::ostream& os, const PHX::Field<DataT>& h);
00086
00087 }
00088
00089 #include "Phalanx_Field_Def.hpp"
00090
00091 #endif