Skip to content

Commit

Permalink
ongoing(strmtrx): we give preallocated data for elmat
Browse files Browse the repository at this point in the history
  • Loading branch information
orlandini committed May 28, 2024
1 parent 62aff96 commit 2d1aee0
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions StrMatrix/TPZStructMatrixOMPorTBB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,19 +447,28 @@ void TPZStructMatrixOMPorTBB<TVar>::AssemblingUsingTBBbutNotColoring(TPZBaseMatr
[&](tbb::blocked_range<int64_t> r){
TPZElementMatrixT<TVar> ek(cmesh,TPZElementMatrix::EK);
TPZElementMatrixT<TVar> ef(cmesh,TPZElementMatrix::EF);
for (int64_t iel = r.begin(); iel < r.end(); iel++)
const auto bufsz = 400*400;
TVar*buf = new TVar[bufsz];

{
TPZCompEl *el = cmesh->Element(iel);
if ((!el) ||
(nmatids != 0 &&
!el->NeedsComputing(matids)))
TPZFMatrix<TVar> auxmat(1,1,buf,bufsz);
ek.SetUserAllocMat(&auxmat);
for (int64_t iel = r.begin(); iel < r.end(); iel++)
{
continue;
}
TPZCompEl *el = cmesh->Element(iel);
if ((!el) ||
(nmatids != 0 &&
!el->NeedsComputing(matids)))
{
continue;
}

CalcStiffAndAssemble(mat,rhs,el,ek,ef);
CalcStiffAndAssemble(mat,rhs,el,ek,ef);

}
}
//matrix has been destroyed
delete [] buf;
});
#else
DebugStop();
Expand Down

0 comments on commit 2d1aee0

Please sign in to comment.