Am Montag, 13. Mai 2022, finden Wartungsarbeiten am Gitlab-Server (Update auf neue Version statt). Der Dienst wird daher am Montag für einige Zeit nicht verfügbar sein.
On Monday, May 13th 2022, the Gitlab server will be updated. The service will therefore not be accessible for some time on Monday.

Commit 7b3241de authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

resize of gradient cache in local-assemblers added

parent 2a3fbc12
......@@ -94,7 +94,8 @@ namespace AMDiS
// Compute the shape function gradients on the real element
using WorldVector = FieldVector<RangeFieldType,Context::dow>;
thread_local std::vector<WorldVector> gradients(shapeGradients.size());
thread_local std::vector<WorldVector> gradients;
gradients.resize(shapeGradients.size());
for (std::size_t i = 0; i < gradients.size(); ++i)
jacobian.mv(shapeGradients[i][0], gradients[i]);
......
......@@ -76,7 +76,8 @@ namespace AMDiS
colLocalFE.localBasis().evaluateJacobian(local, shapeGradients);
// Compute the shape function gradients on the real element
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > colGradients(shapeGradients.size());
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > colGradients;
colGradients.resize(shapeGradients.size());
for (std::size_t i = 0; i < colGradients.size(); ++i)
jacobian.mv(shapeGradients[i][0], colGradients[i]);
......
......@@ -74,7 +74,8 @@ namespace AMDiS
colLocalFE.localBasis().evaluateJacobian(local, shapeGradients);
// Compute the shape function gradients on the real element
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > colGradients(shapeGradients.size());
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > colGradients;
colGradients.resize(shapeGradients.size());
for (std::size_t i = 0; i < colGradients.size(); ++i)
jacobian.mv(shapeGradients[i][0], colGradients[i]);
......
......@@ -79,7 +79,8 @@ namespace AMDiS
colLocalFE.localBasis().evaluateJacobian(local, shapeGradients);
// Compute the shape function gradients on the real element
thread_local std::vector<RangeFieldType> colPartial(shapeGradients.size());
thread_local std::vector<RangeFieldType> colPartial;
colPartial.resize(shapeGradients.size());
for (std::size_t i = 0; i < colPartial.size(); ++i) {
colPartial[i] = jacobian[comp_][0] * shapeGradients[i][0][0];
for (std::size_t j = 1; j < jacobian.M(); ++j)
......
......@@ -76,7 +76,8 @@ namespace AMDiS
colLocalFE.localBasis().evaluateJacobian(local, shapeGradients);
// Compute the shape function gradients on the real element
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > colGradients(shapeGradients.size());
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > colGradients;
colGradients.resize(shapeGradients.size());
for (std::size_t i = 0; i < colGradients.size(); ++i)
jacobian.mv(shapeGradients[i][0], colGradients[i]);
......
......@@ -94,11 +94,13 @@ namespace AMDiS
colLocalFE.localBasis().evaluateJacobian(local, colShapeGradients);
// Compute the shape function gradients on the real element
thread_local std::vector<Dune::FieldVector<RowFieldType,Context::dow> > rowGradients(rowShapeGradients.size());
thread_local std::vector<Dune::FieldVector<RowFieldType,Context::dow> > rowGradients;
rowGradients.resize(rowShapeGradients.size());
for (std::size_t i = 0; i < rowGradients.size(); ++i)
jacobian.mv(rowShapeGradients[i][0], rowGradients[i]);
thread_local std::vector<Dune::FieldVector<ColFieldType,Context::dow> > colGradients(colShapeGradients.size());
thread_local std::vector<Dune::FieldVector<ColFieldType,Context::dow> > colGradients;
colGradients.resize(colShapeGradients.size());
for (std::size_t i = 0; i < colGradients.size(); ++i)
jacobian.mv(colShapeGradients[i][0], colGradients[i]);
......@@ -145,7 +147,8 @@ namespace AMDiS
localFE.localBasis().evaluateJacobian(local, shapeGradients);
// Compute the shape function gradients on the real element
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > gradients(shapeGradients.size());
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > gradients;
gradients.resize(shapeGradients.size());
for (std::size_t i = 0; i < gradients.size(); ++i)
jacobian.mv(shapeGradients[i][0], gradients[i]);
......
......@@ -90,7 +90,8 @@ namespace AMDiS
localFE.localBasis().evaluateJacobian(local, shapeGradients);
// Compute the shape function gradients on the real element
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > gradients(shapeGradients.size());
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > gradients;
gradients.resize(shapeGradients.size());
for (std::size_t i = 0; i < gradients.size(); ++i)
jacobian.mv(shapeGradients[i][0], gradients[i]);
......@@ -133,7 +134,8 @@ namespace AMDiS
localFE.localBasis().evaluateJacobian(local, shapeGradients);
// Compute the shape function gradients on the real element
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > gradients(shapeGradients.size());
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > gradients;
gradients.resize(shapeGradients.size());
for (std::size_t i = 0; i < gradients.size(); ++i)
jacobian.mv(shapeGradients[i][0], gradients[i]);
......@@ -183,7 +185,8 @@ namespace AMDiS
localFE.localBasis().evaluateJacobian(local, shapeGradients);
// Compute the shape function gradients on the real element
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > gradients(shapeGradients.size());
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > gradients;
gradients.resize(shapeGradients.size());
for (std::size_t i = 0; i < gradients.size(); ++i)
jacobian.mv(shapeGradients[i][0], gradients[i]);
......
......@@ -80,14 +80,16 @@ namespace AMDiS
colLocalFE.localBasis().evaluateJacobian(local, colShapeGradients);
// Compute the shape function gradients on the real element
thread_local std::vector<RowFieldType> rowPartial(rowShapeGradients.size());
thread_local std::vector<RowFieldType> rowPartial;
rowPartial.resize(rowShapeGradients.size());
for (std::size_t i = 0; i < rowPartial.size(); ++i) {
rowPartial[i] = jacobian[compTest_][0] * rowShapeGradients[i][0][0];
for (std::size_t j = 1; j < jacobian.cols(); ++j)
rowPartial[i] += jacobian[compTest_][j] * rowShapeGradients[i][0][j];
}
thread_local std::vector<ColFieldType> colPartial(colShapeGradients.size());
thread_local std::vector<ColFieldType> colPartial;
colPartial.resize(colShapeGradients.size());
for (std::size_t i = 0; i < colPartial.size(); ++i) {
colPartial[i] = jacobian[compTrial_][0] * colShapeGradients[i][0][0];
for (std::size_t j = 1; j < jacobian.cols(); ++j)
......
......@@ -74,7 +74,8 @@ namespace AMDiS
velocityLocalFE.localBasis().evaluateJacobian(local, shapeGradients);
// Compute the shape function gradients on the real element
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > gradients(shapeGradients.size());
thread_local std::vector<Dune::FieldVector<RangeFieldType,Context::dow> > gradients;
gradients.resize(shapeGradients.size());
for (std::size_t i = 0; i < gradients.size(); ++i)
jacobian.mv(shapeGradients[i][0], gradients[i]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment