PRISMS-PF
v2.1
fields.h
Go to the documentation of this file.
1
//fields class
2
#ifndef FIELDS_H
3
#define FIELDS_H
4
#include <deal.II/base/conditional_ostream.h>
5
6
#include "
userInputParameters.h
"
7
8
template
<
int
dim>
9
class
Field
10
{
11
public
:
12
Field
(
fieldType
_type,
PDEType
_pdetype, std::string _name);
13
fieldType
type
;
14
PDEType
pdetype
;
15
std::string
name
;
16
unsigned
int
index
;
17
unsigned
int
startIndex
;
18
unsigned
int
numComponents
;
19
20
private
:
21
static
unsigned
int
fieldCount
;
22
static
unsigned
int
indexCount
;
23
};
24
25
//initialize static variables
26
template
<
int
dim>
unsigned
int
Field<dim>::fieldCount
= 0;
27
template
<
int
dim>
unsigned
int
Field<dim>::indexCount
= 0;
28
29
//constructor
30
template
<
int
dim>
31
Field<dim>::Field
(
fieldType
_type,
PDEType
_pdetype, std::string _name): type(_type), pdetype(_pdetype), name(_name)
32
{
33
//increment field count as new field is being created
34
index
=
fieldCount
;
35
fieldCount
++;
36
startIndex
=
indexCount
;
37
38
//assign index to this field
39
switch
(
type
){
40
case
SCALAR
:{
41
//increment index count by one
42
indexCount
+=1;
43
numComponents
=1;
44
break
;
45
}
46
case
VECTOR
:{
47
//increment index count by dim
48
indexCount
+=dim;
49
numComponents
=dim;
50
break
;
51
}
52
default
:{
53
std::cout <<
"fields.h: unknown field type\n"
;
54
exit(-1);
55
}
56
}
57
}
58
59
#endif
Field::numComponents
unsigned int numComponents
Definition:
fields.h:18
Field::type
fieldType type
Definition:
fields.h:13
Field::fieldCount
static unsigned int fieldCount
Definition:
fields.h:21
Field::indexCount
static unsigned int indexCount
Definition:
fields.h:22
PDEType
PDEType
Definition:
varTypeEnums.h:5
Field::index
unsigned int index
Definition:
fields.h:16
userInputParameters.h
Field
Definition:
fields.h:9
Field::name
std::string name
Definition:
fields.h:15
Field::Field
Field(fieldType _type, PDEType _pdetype, std::string _name)
Definition:
fields.h:31
VECTOR
Definition:
varTypeEnums.h:4
Field::startIndex
unsigned int startIndex
Definition:
fields.h:17
Field::pdetype
PDEType pdetype
Definition:
fields.h:14
fieldType
fieldType
Definition:
varTypeEnums.h:4
SCALAR
Definition:
varTypeEnums.h:4
include
fields.h
Generated by
1.8.14