Skip to content
Snippets Groups Projects
Commit 3e3f3aa6 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[mpfa][ivlocalassembler][gravity] remove obsolete reset to zero

parent d2fc21e3
No related branches found
No related tags found
2 merge requests!1337WIP Fix/dirichlet caching v2,!1298Restructure mpfa flux caches
...@@ -182,7 +182,6 @@ class InteractionVolumeAssemblerBase ...@@ -182,7 +182,6 @@ class InteractionVolumeAssemblerBase
FaceVector sum_alphas; FaceVector sum_alphas;
resizeVector_(sum_alphas, iv.numUnknowns()); resizeVector_(sum_alphas, iv.numUnknowns());
sum_alphas = 0.0; sum_alphas = 0.0;
std::fill(g.begin(), g.end(), 0.0);
for (LocalIndexType faceIdx = 0; faceIdx < iv.numFaces(); ++faceIdx) for (LocalIndexType faceIdx = 0; faceIdx < iv.numFaces(); ++faceIdx)
{ {
// gravitational acceleration on this face // gravitational acceleration on this face
...@@ -207,10 +206,7 @@ class InteractionVolumeAssemblerBase ...@@ -207,10 +206,7 @@ class InteractionVolumeAssemblerBase
Scalar rho; Scalar rho;
if (isSurfaceGrid) if (isSurfaceGrid)
{
resizeVector_(outsideG[faceIdx], numOutsideFaces); resizeVector_(outsideG[faceIdx], numOutsideFaces);
std::fill(outsideG[faceIdx].begin(), outsideG[faceIdx].end(), 0.0);
}
if (!curLocalScvf.isDirichlet()) if (!curLocalScvf.isDirichlet())
{ {
...@@ -249,13 +245,13 @@ class InteractionVolumeAssemblerBase ...@@ -249,13 +245,13 @@ class InteractionVolumeAssemblerBase
rho = getRho(elemVolVars()[curGlobalScvf.outsideScvIdx()]); rho = getRho(elemVolVars()[curGlobalScvf.outsideScvIdx()]);
// add "inside" & "outside" alphas to gravity containers // add "inside" & "outside" alphas to gravity containers
g[faceIdx] += alpha_inside*rho*curGlobalScvf.area(); g[faceIdx] = alpha_inside*rho*curGlobalScvf.area();
if (isSurfaceGrid) if (isSurfaceGrid)
{ {
unsigned int i = 0; unsigned int i = 0;
for (const auto& alpha : alpha_outside) for (const auto& alpha : alpha_outside)
outsideG[faceIdx][i++] += alpha*rho*curGlobalScvf.area(); outsideG[faceIdx][i++] = alpha*rho*curGlobalScvf.area();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment