state_vector_base.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_STATE_VECTOR_BASE_H_
8 #define WONTON_STATE_STATE_VECTOR_BASE_H_
9 
10 #include <string>
11 #include <iostream>
12 #include <typeinfo>
13 
14 #include "wonton/support/wonton.h"
15 
16 namespace Wonton {
17 
31  public:
38  explicit StateVectorBase(std::string name, Field_type type,
40  name_(name), type_(type), kind_(kind) {}
41 
42 
44 
45  virtual ~StateVectorBase() = default;
46 
48 
49  virtual std::ostream & print(std::ostream & os) const {
50  os << "Print not implemented for data type of StateVectorBase\n";
51  return os;
52  }
53 
54 
55  virtual const std::type_info& data_type() const = 0;
56 
58 
65  std::string get_name() const { return name_; }
66 
67 
75  Field_type get_type() const { return type_; }
76 
77 
84  Entity_kind get_kind() const { return kind_; }
85 
86 
87  protected:
88  std::string name_;
91 };
92 
93 } // namespace Wonton
94 
95 #endif // WONTON_STATE_STATE_VECTOR_BASE_H_
Field_type get_type() const
Return the field type [MESH_FIELD, MULTIMATERIAL_FIELD] of the state vector.
Definition: state_vector_base.h:75
Entity_kind get_kind() const
Return the entity kind [CELL, NODE] of the state vector.
Definition: state_vector_base.h:84
Definition: state_vector_base.h:30
Factorize a number N into D equal (or nearly equal) factors.
Definition: adaptive_refinement_mesh.h:31
virtual std::ostream & print(std::ostream &os) const
Virtual methods.
Definition: state_vector_base.h:49
StateVectorBase(std::string name, Field_type type, Entity_kind kind=Entity_kind::CELL)
Constructor with a name.
Definition: state_vector_base.h:38
Field_type type_
Definition: state_vector_base.h:89
virtual const std::type_info & data_type() const =0
Definition: wonton.h:88
Field_type
Field type - whether it is mesh field or multi-material field.
Definition: wonton.h:187
virtual ~StateVectorBase()=default
Destructor.
Entity_kind
The type of mesh entity.
Definition: wonton.h:81
Entity_kind kind_
Definition: state_vector_base.h:90
std::string name_
Definition: state_vector_base.h:88
std::string get_name() const
Query Metadata.
Definition: state_vector_base.h:65