Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
77a39967
Commit
77a39967
authored
9 months ago
by
Axelle Drouard
Browse files
Options
Downloads
Patches
Plain Diff
Fix bugs in eucclhyd flux computation
parent
3a29064b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scheme/EulerKineticSolver2D.cpp
+39
-18
39 additions, 18 deletions
src/scheme/EulerKineticSolver2D.cpp
with
39 additions
and
18 deletions
src/scheme/EulerKineticSolver2D.cpp
+
39
−
18
View file @
77a39967
...
@@ -384,26 +384,25 @@ class EulerKineticSolver2D
...
@@ -384,26 +384,25 @@ class EulerKineticSolver2D
const
size_t
i_node_cell
=
local_node_number_in_cell
(
node_id
);
const
size_t
i_node_cell
=
local_node_number_in_cell
(
node_id
);
const
TinyVector
<
Dimension
>
n_face
=
nlr
(
face_id
,
i_node_face
);
TinyVector
<
Dimension
>
n_face
=
nlr
(
face_id
,
i_node_face
);
const
TinyVector
<
Dimension
>
n_node
=
njr
(
cell_id
,
i_node_cell
);
TinyVector
<
Dimension
>
n_node
=
njr
(
cell_id
,
i_node_cell
);
if
(
dot
(
n_face
,
n_node
)
>
0
)
{
if
(
dot
(
n_face
,
n_node
)
<
0
)
{
double
li_nlr
=
dot
(
m_lambda_vector
[
i_wave
],
n_face
);
for
(
size_t
d
=
0
;
d
<
Dimension
;
++
d
)
{
if
(
li_nlr
>
0
)
{
n_face
[
d
]
=
-
n_face
[
d
];
Fr
[
node_id
][
i_face
][
i_wave
]
+=
Fn
[
cell_id
][
i_wave
]
*
li_nlr
;
sum
+=
li_nlr
;
}
}
}
else
{
}
double
li_nlr
=
-
dot
(
m_lambda_vector
[
i_wave
],
n_face
);
double
li_nlr
=
dot
(
m_lambda_vector
[
i_wave
],
n_face
);
if
(
li_nlr
>
0
)
{
if
(
li_nlr
>
0
)
{
Fr
[
node_id
][
i_face
][
i_wave
]
+=
Fn
[
cell_id
][
i_wave
]
*
li_nlr
;
Fr
[
node_id
][
i_face
][
i_wave
]
+=
Fn
[
cell_id
][
i_wave
]
*
li_nlr
;
sum
+=
li_nlr
;
sum
+=
li_nlr
;
}
}
}
}
}
if
(
sum
!=
0
)
{
Fr
[
node_id
][
i_face
][
i_wave
]
/=
sum
;
Fr
[
node_id
][
i_face
][
i_wave
]
/=
sum
;
}
}
}
}
}
});
});
return
Fr
;
return
Fr
;
...
@@ -441,12 +440,14 @@ class EulerKineticSolver2D
...
@@ -441,12 +440,14 @@ class EulerKineticSolver2D
DiscreteFunctionP0Vector
<
double
>
deltaLFn
(
p_mesh
,
nb_waves
);
DiscreteFunctionP0Vector
<
double
>
deltaLFn
(
p_mesh
,
nb_waves
);
const
auto
&
cell_to_face_matrix
=
p_mesh
->
connectivity
().
cellToFaceMatrix
();
const
auto
&
cell_to_face_matrix
=
p_mesh
->
connectivity
().
cellToFaceMatrix
();
const
auto
&
cell_to_node_matrix
=
p_mesh
->
connectivity
().
cellToNodeMatrix
();
const
auto
&
face_to_node_matrix
=
p_mesh
->
connectivity
().
faceToNodeMatrix
();
const
auto
&
face_to_node_matrix
=
p_mesh
->
connectivity
().
faceToNodeMatrix
();
const
auto
&
node_to_face_matrix
=
p_mesh
->
connectivity
().
nodeToFaceMatrix
();
const
auto
&
node_to_face_matrix
=
p_mesh
->
connectivity
().
nodeToFaceMatrix
();
parallel_for
(
parallel_for
(
p_mesh
->
numberOfCells
(),
PUGS_LAMBDA
(
CellId
cell_id
)
{
p_mesh
->
numberOfCells
(),
PUGS_LAMBDA
(
CellId
cell_id
)
{
const
auto
&
cell_to_face
=
cell_to_face_matrix
[
cell_id
];
const
auto
&
cell_to_face
=
cell_to_face_matrix
[
cell_id
];
const
auto
&
cell_to_node
=
cell_to_node_matrix
[
cell_id
];
for
(
size_t
i_wave
=
0
;
i_wave
<
nb_waves
;
++
i_wave
)
{
for
(
size_t
i_wave
=
0
;
i_wave
<
nb_waves
;
++
i_wave
)
{
deltaLFn
[
cell_id
][
i_wave
]
=
0
;
deltaLFn
[
cell_id
][
i_wave
]
=
0
;
...
@@ -455,8 +456,8 @@ class EulerKineticSolver2D
...
@@ -455,8 +456,8 @@ class EulerKineticSolver2D
const
FaceId
face_id
=
cell_to_face
[
i_face_cell
];
const
FaceId
face_id
=
cell_to_face
[
i_face_cell
];
const
auto
&
face_to_node
=
face_to_node_matrix
[
face_id
];
const
auto
&
face_to_node
=
face_to_node_matrix
[
face_id
];
for
(
size_t
i_node
=
0
;
i_node
<
face_to_node
.
size
();
++
i_node
)
{
for
(
size_t
i_node
_face
=
0
;
i_node
_face
<
face_to_node
.
size
();
++
i_node
_face
)
{
const
NodeId
node_id
=
face_to_node
[
i_node
];
const
NodeId
node_id
=
face_to_node
[
i_node
_face
];
const
auto
&
node_to_face
=
node_to_face_matrix
[
node_id
];
const
auto
&
node_to_face
=
node_to_face_matrix
[
node_id
];
auto
local_face_number_in_node
=
[
&
](
FaceId
face_number
)
{
auto
local_face_number_in_node
=
[
&
](
FaceId
face_number
)
{
...
@@ -468,8 +469,28 @@ class EulerKineticSolver2D
...
@@ -468,8 +469,28 @@ class EulerKineticSolver2D
return
std
::
numeric_limits
<
size_t
>::
max
();
return
std
::
numeric_limits
<
size_t
>::
max
();
};
};
auto
local_node_number_in_cell
=
[
&
](
NodeId
node_number
)
{
for
(
size_t
i_node
=
0
;
i_node
<
cell_to_node
.
size
();
++
i_node
)
{
if
(
node_number
==
cell_to_node
[
i_node
])
{
return
i_node
;
}
}
return
std
::
numeric_limits
<
size_t
>::
max
();
};
const
size_t
i_face_node
=
local_face_number_in_node
(
face_id
);
const
size_t
i_face_node
=
local_face_number_in_node
(
face_id
);
const
double
li_Nlr
=
dot
(
m_lambda_vector
[
i_wave
],
Nlr
(
face_id
,
i_node
));
const
size_t
i_node_cell
=
local_node_number_in_cell
(
node_id
);
TinyVector
<
Dimension
>
n_face
=
nlr
(
face_id
,
i_node_face
);
TinyVector
<
Dimension
>
n_node
=
njr
(
cell_id
,
i_node_cell
);
if
(
dot
(
n_face
,
n_node
)
<
0
)
{
for
(
size_t
d
=
0
;
d
<
Dimension
;
++
d
)
{
n_face
[
d
]
=
-
n_face
[
d
];
}
}
const
double
li_Nlr
=
dot
(
m_lambda_vector
[
i_wave
],
n_face
);
deltaLFn
[
cell_id
][
i_wave
]
+=
Fr
[
node_id
][
i_face_node
][
i_wave
]
*
li_Nlr
;
deltaLFn
[
cell_id
][
i_wave
]
+=
Fr
[
node_id
][
i_face_node
][
i_wave
]
*
li_Nlr
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment