O P A R - Open Architecture Particle in Cell Simulation - Version 3.0
Plasma simulations with dust particles
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Friends
Macros
Groups
Pages
species.h
Go to the documentation of this file.
1
5
#ifndef SPECIES_H
6
#define SPECIES_H
7
#include "
task.h
"
8
#include "
numeric.h
"
9
#include <cmath>
10
#define ID_SPECIES "Species"
11
//---------------------------------------------------------------------------------------------------------------------
12
class
Species
;
13
typedef
PtrWrapper<Species>
WSpecies
;
14
class
SpeciesBase
;
15
typedef
PtrWrapper<SpeciesBase>
WSpeciesBase
;
16
21
class
SpeciesBase
:
public
Task
{
22
public
:
24
virtual
void
MakeRho
()=0;
26
virtual
grid<double>
&
Rho
()=0;
28
virtual
std::string
GetClassName
()
const
{
return
ID_SPECIES;}
30
virtual
double
GetSize
()
const
= 0;
31
virtual
double
GetSize0 ()
const
= 0;
33
virtual
double
GetCharge
()
const
= 0;
34
};
35
class
Wall
;
36
class
Density
;
37
class
Geometry
;
38
62
class
Species
:
public
SpeciesBase
{
63
private
:
65
std::string strGeometry;
67
std::string strDensity;
69
std::string strWall;
71
bool
Moved;
72
77
double
initialDensity;
78
GridPosition
gRhoSize;
79
protected
:
81
Geometry
*
pGeom
;
83
Wall
*
pWall
;
85
grid<double>
gRho
;
86
grid<double>
gRho1;
87
grid<double>
gRho2;
88
grid<double>
gRho3;
89
grid<double>
gRho4;
90
grid<double>
gRho5;
91
grid<double>
gRho6;
92
grid<double>
gRho7;
93
grid<double>
gRho8;
95
int
MaxCount
;
97
double
Size
;
99
double
Size0
;
101
double
Charge
;
103
double
Mass
;
105
double
dt
;
106
public
:
108
std::valarray<Position>
X
;
110
std::valarray<Velocity>
V
;
112
int
Count
;
113
public
:
115
Species
();
117
virtual
~Species
();
118
virtual
void
Init
();
119
virtual
bool
Execute
();
120
void
MakeRho
();
122
double
GetSize
()
const
{
return
Size
;}
124
double
GetSize0
()
const
{
return
Size0
;}
126
double
GetCharge
()
const
{
return
Charge
;}
128
double
GetMass
()
const
{
return
Mass
;}
130
double
Getdt
()
const
{
return
dt
;}
132
grid<double>
&
Rho
() {
return
gRho
;}
134
double
Vabs
(
int
p)
const
{
return
sqrt(
V
[p]*
V
[p]);}
136
void
SetV
(
int
p,
const
Velocity
& _V) {
V
[p] = _V;}
138
Position
GetRx
(
int
nParticle)
const
{
return
((nParticle <
Count
) ?
X
[nParticle] : 0.0);}
140
void
SetMovedFlag
() {Moved =
true
;};
142
void
ClearMovedFlag
() {Moved =
false
;};
144
bool
HasMoved
()
const
{
return
Moved;};
145
int
Generate (
Position
aX,
Velocity
aV);
146
void
Remove (
int
nP);
147
void
Swap (
int
i1,
int
i2);
148
void
ModifySize
(
double
densityContribution);
149
protected
:
150
virtual
PARAMETERMAP*
MakeParamMap
(PARAMETERMAP* pm = NULL);
151
};
152
#endif
153
154
155
Generated by
1.8.1.1