Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KiT-RT
KiT-RT
Commits
d1c74e69
Commit
d1c74e69
authored
Dec 07, 2020
by
Tianbai Xiao
Browse files
Clean codes & add docs
Former-commit-id:
8c98b7ef
parent
f01884ab
Changes
4
Hide whitespace changes
Inline
Side-by-side
code/include/solvers/mnsolver.h
View file @
d1c74e69
...
...
@@ -42,9 +42,9 @@ class MNSolver : public Solver
Layout: _nCells x _nTotalEntries*/
OptimizerBase
*
_optimizer
;
/*! @brief: Class to solve minimal entropy problem */
VectorVector
_solDx
;
VectorVector
_solDy
;
VectorVector
_solDx
;
/*! @brief: temporary storage of x-derivatives of alpha */
VectorVector
_solDy
;
/*! @brief: temporary storage of y-derivatives of alpha */
// ---- Private Member functions ---
// IO
...
...
code/include/solvers/pnsolver.h
View file @
d1c74e69
...
...
@@ -38,8 +38,8 @@ class PNSolver : public Solver
Vector
_scatterMatDiag
;
/*! @brief: diagonal of the scattering matrix (its a diagonal matrix by construction). Contains eigenvalues of the
scattering kernel. */
VectorVector
_solDx
;
VectorVector
_solDy
;
VectorVector
_solDx
;
/*! @brief: temporary storage of x-derivatives of solution */
VectorVector
_solDy
;
/*! @brief: temporary storage of y-derivatives of solution */
// ---- Member functions ----
...
...
code/src/solvers/mnsolver.cpp
View file @
d1c74e69
...
...
@@ -31,6 +31,7 @@ MNSolver::MNSolver( Config* settings ) : Solver( settings ) {
_quadPointsSphere
=
_quadrature
->
GetPointsSphere
();
_settings
->
SetNQuadPoints
(
_nq
);
// Initialize temporary storages of alpha derivatives
_solDx
=
VectorVector
(
_nCells
,
Vector
(
_nTotalEntries
,
0.0
)
);
_solDy
=
VectorVector
(
_nCells
,
Vector
(
_nTotalEntries
,
0.0
)
);
...
...
@@ -91,20 +92,19 @@ void MNSolver::ComputeMoments() {
Vector
MNSolver
::
ConstructFlux
(
unsigned
idx_cell
)
{
Vector
alphaL
(
_nTotalEntries
,
0.0
);
Vector
alphaR
(
_nTotalEntries
,
0.0
);
//--- Integration of Moment of flux ---
//--- Integration of moments of flux ---
double
entropyL
,
entropyR
,
entropyFlux
;
Vector
flux
(
_nTotalEntries
,
0.0
);
for
(
unsigned
idx_quad
=
0
;
idx_quad
<
_nq
;
idx_quad
++
)
{
//--- Temporary storages of reconstructed alpha ---
Vector
alphaL
(
_nTotalEntries
,
0.0
);
Vector
alphaR
(
_nTotalEntries
,
0.0
);
entropyFlux
=
0.0
;
// Reset temorary flux
for
(
unsigned
idx_quad
=
0
;
idx_quad
<
_nq
;
idx_quad
++
)
{
entropyFlux
=
0.0
;
// reset temorary flux
for
(
unsigned
idx_neigh
=
0
;
idx_neigh
<
_neighbors
[
idx_cell
].
size
();
idx_neigh
++
)
{
// Left side reconstruction
if
(
_reconsOrder
>
1
)
{
alphaL
=
_alpha
[
idx_cell
]
+
_solDx
[
idx_cell
]
*
(
_interfaceMidPoints
[
idx_cell
][
idx_neigh
][
0
]
-
_cellMidPoints
[
idx_cell
][
0
]
)
+
...
...
@@ -115,7 +115,7 @@ Vector MNSolver::ConstructFlux( unsigned idx_cell ) {
}
entropyL
=
_entropy
->
EntropyPrimeDual
(
blaze
::
dot
(
alphaL
,
_moments
[
idx_quad
]
)
);
//
Store fluxes in psiNew, to save memory
//
Right side reconstruction
if
(
_boundaryCells
[
idx_cell
]
==
BOUNDARY_TYPE
::
NEUMANN
&&
_neighbors
[
idx_cell
][
idx_neigh
]
==
_nCells
)
entropyR
=
entropyL
;
else
{
...
...
@@ -130,11 +130,11 @@ Vector MNSolver::ConstructFlux( unsigned idx_cell ) {
entropyR
=
_entropy
->
EntropyPrimeDual
(
blaze
::
dot
(
alphaR
,
_moments
[
idx_quad
]
)
);
}
// Entropy flux
entropyFlux
+=
_g
->
Flux
(
_quadPoints
[
idx_quad
],
entropyL
,
entropyR
,
_normals
[
idx_cell
][
idx_neigh
]
);
}
// Solution flux
flux
+=
_moments
[
idx_quad
]
*
(
_weights
[
idx_quad
]
*
entropyFlux
);
// ------- Relizablity Reconstruction Step ----
}
return
flux
;
}
...
...
code/src/solvers/pnsolver.cpp
View file @
d1c74e69
...
...
@@ -32,6 +32,7 @@ PNSolver::PNSolver( Config* settings ) : Solver( settings ) {
// Initialize Scatter Matrix
_scatterMatDiag
=
Vector
(
_nTotalEntries
,
0
);
// Initialize temporary storages of solution derivatives
_solDx
=
VectorVector
(
_nCells
,
Vector
(
_nTotalEntries
,
0.0
)
);
_solDy
=
VectorVector
(
_nCells
,
Vector
(
_nTotalEntries
,
0.0
)
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment