Chi-Tech
fieldfunction.h
Go to the documentation of this file.
1#ifndef CHITECH_FIELDFUNCTION_H
2#define CHITECH_FIELDFUNCTION_H
3
4#include "ChiObject.h"
6#include "mesh/chi_mesh.h"
7
8namespace chi_mesh
9{
10class Cell;
11}
12
13namespace chi_physics
14{
15
17{
18private:
19 std::string text_name_;
22
23public:
24 /**Returns required input parameters.*/
26
27 /**ObjectMaker based constructor.*/
28 explicit FieldFunction(const chi::InputParameters& params);
29
30 /**Conventional constructor.*/
31 FieldFunction(const std::string& text_name, chi_math::Unknown unknown);
32
33 virtual ~FieldFunction() = default;
34
35 // Getters
36 /**Returns the text name of the field function.*/
37 const std::string& TextName() const { return text_name_; }
38 /**Returns a reference to the unknown structure.*/
39 const chi_math::Unknown& Unknown() const { return unknown_; }
40 /**Returns a reference to the unknown manager that can be used in
41 * spatial discretizations.*/
43 {
44 return unknown_manager_;
45 }
46
47 /**\brief Overrides the stack placement so that FieldFunctions go
48 * to the field function stack.*/
49 void PushOntoStack(std::shared_ptr<ChiObject>& new_object) override;
50
51 virtual double Evaluate(const chi_mesh::Cell& cell,
52 const chi_mesh::Vector3& position,
53 unsigned int component) const {return 0.0;}
54};
55
56} // namespace chi_physics
57
58#endif // CHITECH_FIELDFUNCTION_H
void PushOntoStack(std::shared_ptr< ChiObject > &new_object) override
Overrides the stack placement so that FieldFunctions go to the field function stack.
virtual double Evaluate(const chi_mesh::Cell &cell, const chi_mesh::Vector3 &position, unsigned int component) const
Definition: fieldfunction.h:51
static chi::InputParameters GetInputParameters()
const chi_math::Unknown & Unknown() const
Definition: fieldfunction.h:39
FieldFunction(const chi::InputParameters &params)
virtual ~FieldFunction()=default
chi_math::UnknownManager unknown_manager_
Definition: fieldfunction.h:21
const std::string & TextName() const
Definition: fieldfunction.h:37
const chi_math::UnknownManager & GetUnknownManager() const
Definition: fieldfunction.h:42
chi_math::Unknown unknown_
Definition: fieldfunction.h:20