Skip to content
Snippets Groups Projects
Commit 5e24aead authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[PL] GWF: Explicitly set type of darcy_velocity.

auto const darcy_v = (EigenExpr).eval() returns a temporary
object. (Eigen 3.2.9).
Error is detected by clang's address sanitizer.
AddressSanitizer: heap-use-after-free on address ...
parent c0cef8f0
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,7 @@ class LocalAssemblerData
using NodalMatrixType = typename LocalAssemblerTraits::LocalMatrix;
using NodalVectorType = typename LocalAssemblerTraits::LocalVector;
using GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType;
public:
/// The hydraulic_conductivity factor is directly integrated into the local
......@@ -100,11 +101,12 @@ public:
sm.detJ * wp.getWeight();
// Darcy velocity only computed for output.
auto const darcy_velocity = -(k * sm.dNdx *
Eigen::Map<const NodalVectorType>(local_x.data(), ShapeFunction::NPOINTS)
).eval();
GlobalDimVectorType const darcy_velocity =
-k * sm.dNdx * Eigen::Map<const NodalVectorType>(
local_x.data(), ShapeFunction::NPOINTS);
for (unsigned d=0; d<GlobalDim; ++d) {
for (unsigned d = 0; d < GlobalDim; ++d)
{
_darcy_velocities[d][ip] = darcy_velocity[d];
}
}
......
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