Flow123d
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
flow123d
src
fields
field_constant.hh
Go to the documentation of this file.
1
/*
2
* field_constant.hh
3
*
4
* Created on: Dec 15, 2012
5
* Author: jb
6
*/
7
8
9
#ifndef FIELD_CONSTANT_HH_
10
#define FIELD_CONSTANT_HH_
11
12
#include "
system/system.hh
"
13
#include "
fields/field_base.hh
"
14
#include "
mesh/point.hh
"
15
16
17
/**
18
* Class representing spatially constant fields.
19
*
20
*/
21
template
<
int
spacedim,
class
Value>
22
class
FieldConstant
:
public
FieldBase
<spacedim, Value>
23
{
24
public
:
25
typedef
typename
FieldBase<spacedim, Value>::Point
Point
;
26
27
/**
28
* Default constructor, optionally we need number of components @p n_comp in the case of Vector valued fields.
29
*/
30
FieldConstant
(
unsigned
int
n_comp
=0);
31
32
33
static
Input::Type::Record
input_type
;
34
35
/**
36
* Return Record for initialization of FieldConstant that is derived from AbstractRecord given by @p a_type
37
* and the individual elements of the possible Value (vector, tensor) have Input::Type @p eit.
38
*/
39
static
Input::Type::Record
get_input_type
(
Input::Type::AbstractRecord
&a_type,
const
typename
Value::ElementInputType *eit);
40
41
/**
42
* Smart setter from the given value to return.
43
*/
44
FieldConstant<spacedim, Value>
&
set_value
(
const
typename
Value::return_type &val);
45
46
/**
47
* This method initialize actual value of the field given from the given Input::Record @p rec.
48
*/
49
virtual
void
init_from_input
(
const
Input::Record
&rec);
50
51
52
53
/**
54
* Returns one value in one given point. ResultType can be used to avoid some costly calculation if the result is trivial.
55
*/
56
virtual
typename
Value::return_type
const
&
value
(
const
Point
&p,
const
ElementAccessor<spacedim>
&elm);
57
58
/**
59
* Returns std::vector of scalar values in several points at once.
60
*/
61
virtual
void
value_list
(
const
std::vector< Point >
&point_list,
const
ElementAccessor<spacedim>
&elm,
62
std::vector<typename Value::return_type>
&
value_list
);
63
64
65
virtual
~FieldConstant
();
66
67
private
:
68
69
};
70
71
72
#endif
/* FIELD_CONSTANT_HH_ */
Generated on Thu May 29 2014 23:14:47 for Flow123d by
1.8.4