Skip to content

Commit

Permalink
feat(hcurl): avoids dynamic alloc on transform shape/curl
Browse files Browse the repository at this point in the history
  • Loading branch information
orlandini committed Sep 13, 2023
1 parent 230897a commit 0333739
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Mesh/TPZCompElHCurl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,13 @@ void TPZCompElHCurl<TSHAPE>::TransformShape(const TPZFMatrix<REAL> &phiref,
jacinv.Transpose(&jacinvt);
axes.Transpose(&axest);

(axest * (jacinvt * phiref)).Transpose(&phi);
//2000 should take care of up to a 6th order tetrahedral el
TPZFNMatrix<2000,REAL> tmp1,tmp2;
//we want to do (axest * (jacinvt * phiref)).Transpose(&phi);
//with no mem alloc
jacinvt.Multiply(phiref, tmp1);
axest.Multiply(tmp1,tmp2);
tmp2.Transpose(&phi);
}

template<class TSHAPE>
Expand All @@ -578,7 +584,7 @@ void TPZCompElHCurl<TSHAPE>::TransformCurl(const TPZFMatrix<REAL> &curlphiref,
TPZFMatrix<REAL> &curlphi)
{
if constexpr(TDIM==3){
curlphi = jacobian * curlphiref;
jacobian.Multiply(curlphiref, curlphi);
curlphi *= 1./detjac;
}else {
curlphi = curlphiref;
Expand Down

0 comments on commit 0333739

Please sign in to comment.