Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90449017
WeakEquationPoisson.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 1, 18:59
Size
2 KB
Mime Type
text/x-c
Expires
Sun, Nov 3, 18:59 (2 d)
Engine
blob
Format
Raw Data
Handle
22035676
Attached To
rLAMMPS lammps
WeakEquationPoisson.cpp
View Options
#include "WeakEquationPoisson.h"
#include "Material.h"
#include <iostream>
#include <fstream>
namespace
ATC
{
//==============================================================
// Class WeakEquationPoisson
//==============================================================
// R = B^T flux + N source = 0
// 0 = B^T perm B phi - N rho_+
//--------------------------------------------------------------
// Constructor
//--------------------------------------------------------------
WeakEquationPoisson
::
WeakEquationPoisson
()
:
WeakEquation
(
STATIC_PDE
,
ELECTRIC_POTENTIAL
,
1
)
{}
//---------------------------------------------------------------------
void
WeakEquationPoisson
::
B_integrand
(
const
FIELD_MATS
&
fields
,
const
GRAD_FIELD_MATS
&
grad_fields
,
const
Material
*
material
,
DENS_MAT_VEC
&
flux
)
const
{
// flux = - perm D_x phi
material
->
electric_displacement
(
fields
,
grad_fields
,
flux
);
flux
[
0
]
*=
-
1
;
flux
[
1
]
*=
-
1
;
flux
[
2
]
*=
-
1
;
}
//---------------------------------------------------------------------
void
WeakEquationPoisson
::
BB_tangent_coefficients
(
const
FieldName
field
,
const
FIELD_MATS
&
fields
,
const
Material
*
material
,
DENS_MAT
&
coefs
)
const
{
material
->
permittivity
(
fields
,
coefs
);
// convention evalues (B^T perm B) > 0
}
//---------------------------------------------------------------------
bool
WeakEquationPoisson
::
N_integrand
(
const
FIELD_MATS
&
fields
,
const
GRAD_FIELD_MATS
&
grad_fields
,
const
Material
*
material
,
DENS_MAT
&
flux
)
const
{
return
material
->
electron_charge_density
(
fields
,
flux
);
// - N rho_+ = N n
}
//---------------------------------------------------------------------
void
WeakEquationPoisson
::
NN_tangent_coefficients
(
const
FieldName
field
,
const
FIELD_MATS
&
fields
,
const
Material
*
material
,
DENS_MAT
&
coefs
)
const
{
material
->
D_electron_charge_density
(
ELECTRIC_POTENTIAL
,
fields
,
coefs
);
}
//==============================================================
// Class WeakEquationPoissonConstantRHS
//==============================================================
//--------------------------------------------------------------
// Constructor
//--------------------------------------------------------------
WeakEquationPoissonConstantRHS
::
WeakEquationPoissonConstantRHS
()
:
WeakEquationPoisson
()
{}
//---------------------------------------------------------------------
bool
WeakEquationPoissonConstantRHS
::
N_integrand
(
const
FIELD_MATS
&
fields
,
const
GRAD_FIELD_MATS
&
grad_fields
,
const
Material
*
material
,
DENS_MAT
&
flux
)
const
{
FIELD_MATS
::
const_iterator
nIter
=
fields
.
find
(
ELECTRON_DENSITY
);
if
(
nIter
!=
fields
.
end
())
{
const
DENS_MAT
&
n
=
nIter
->
second
;
flux
=
-
1.0
*
n
;
return
true
;
}
return
false
;
}
};
Event Timeline
Log In to Comment