Flow123d
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
flow123d
src
fields
field_add_potential.hh
Go to the documentation of this file.
1
/*
2
* field_add_potential.hh
3
*
4
* Created on: Jan 19, 2013
5
* Author: jb
6
*/
7
8
#ifndef FIELD_ADD_POTENTIAL_HH_
9
#define FIELD_ADD_POTENTIAL_HH_
10
11
#include <armadillo>
12
#include <memory>
13
14
15
/**
16
* This field is meant to be used to implement two possibilities for initialization of pressure fields in
17
* Darcy flows. You can either use pressure of piezo-metric head which are related by adding gravity potential.
18
* For various reasons we use pressure as the primary variable, so if the user enters piezo-head we need to add the potential to
19
* the field he/she has provided. This is done by this class. Unfortunately it introduce one more level of indirection,
20
* namely one more virtual call for getting the field value.
21
*
22
* - The field can not be initialized form the input.
23
* - We allow only Scalar Value with element_type double.
24
*/
25
template
<
int
spacedim,
class
Value>
26
class
FieldAddPotential
:
public
FieldBase
<spacedim, Value> {
27
public
:
28
typedef
typename
Space<spacedim>::Point
Point
;
29
/**
30
*
31
*/
32
FieldAddPotential
(
const
arma::vec::fixed<spacedim+1> &potential_grad,
const
Input::AbstractRecord
&rec,
unsigned
int
n_comp
=0);
33
34
/**
35
* Returns one value in one given point. ResultType can be used to avoid some costly calculation if the result is trivial.
36
*/
37
virtual
typename
Value::return_type
const
&
value
(
const
Point
&p,
const
ElementAccessor<spacedim>
&elm);
38
39
/**
40
* Returns std::vector of scalar values in several points at once.
41
*/
42
virtual
void
value_list
(
const
std::vector< Point >
&point_list,
const
ElementAccessor<spacedim>
&elm,
43
std::vector<typename Value::return_type>
&
value_list
);
44
45
46
/**
47
* Update time and possibly update data.
48
*/
49
virtual
bool
set_time
(
double
time);
50
51
52
virtual
~FieldAddPotential
();
53
54
private
:
55
/// Field to which we add linear potential.
56
std::shared_ptr< FieldBase<spacedim, Value> >
inner_field_
;
57
/// Potential gradient.
58
arma::vec::fixed<spacedim>
grad_
;
59
/// Potential constant term.
60
double
zero_level_
;
61
};
62
63
64
#endif
/* FIELD_ADD_POTENTIAL_HH_ */
Generated on Thu May 29 2014 23:14:47 for Flow123d by
1.8.4