state_vector_uni_raw.h
Go to the documentation of this file.
1 /*
2 This file is part of the Ristra Wonton project.
3 Please see the license file at the root of this repository, or at:
4  https://github.com/laristra/wonton/blob/master/LICENSE
5 */
6 
7 #ifndef WONTON_STATE_VECTOR_UNI_RAW_H_
8 #define WONTON_STATE_VECTOR_UNI_RAW_H_
9 
10 #include <string>
11 #include <typeinfo>
12 #include <memory>
13 
14 #include "wonton/support/wonton.h"
16 
17 namespace Wonton {
18 
19 template <class T=double>
21 
22  public:
23 
25  std::string name,
27  T* pdata=nullptr
28  ) : StateVectorBase(name, Field_type::MESH_FIELD, kind),pdata_(pdata) {}
29 
30 
33 
34  // print
35  std::ostream & print(std::ostream & os) const {
36  os << "UniStateVector\n";
37  return os;
38  }
39 
40  // get the data type
41  const std::type_info& data_type() const {
42  const std::type_info& ti = typeid(T);
43  return ti;
44  }
45 
52  T* get_data() { return pdata_; }
53 
60  T const * get_data() const { return pdata_; }
61 
62  private:
63 
64  T* pdata_;
65 
66 };
67 
68 }
69 
70 #endif //WONTON_STATE_VECTOR_UNI_RAW_H_
71 
StateVectorUniRaw(std::string name, Entity_kind kind=Entity_kind::CELL, T *pdata=nullptr)
Definition: state_vector_uni_raw.h:24
Definition: state_vector_base.h:30
Factorize a number N into D equal (or nearly equal) factors.
Definition: adaptive_refinement_mesh.h:31
T const * get_data() const
Return a pointer to the data in the state vector.
Definition: state_vector_uni_raw.h:60
T * get_data()
Return a pointer to the data in the state vector.
Definition: state_vector_uni_raw.h:52
Definition: wonton.h:88
Field_type
Field type - whether it is mesh field or multi-material field.
Definition: wonton.h:187
Definition: state_vector_uni_raw.h:20
Entity_kind
The type of mesh entity.
Definition: wonton.h:81
std::ostream & print(std::ostream &os) const
Virtual methods.
Definition: state_vector_uni_raw.h:35
const std::type_info & data_type() const
Definition: state_vector_uni_raw.h:41
~StateVectorUniRaw()
Destructor.
Definition: state_vector_uni_raw.h:32