StabilizationUtils::getTauPt:
use matrix::norm2()
This commit is contained in:
@@ -41,12 +41,9 @@ double getElementSize (const std::vector<Vec3>& XC, int nsd)
|
||||
double getTauPt (double dt, double mu, const Vector& U,
|
||||
const Matrix& G, const double Ct, const double Cl)
|
||||
{
|
||||
double Gnorm2 = 0.0;
|
||||
for (size_t i = 1;i <= G.rows();i++)
|
||||
for (size_t j = 1;j <= G.cols();j++)
|
||||
Gnorm2 += G(i,j)*G(i,j);
|
||||
|
||||
return 1.0/sqrt( Ct/pow(dt,2) + U.dot(G*U) + Cl*mu*mu*Gnorm2);
|
||||
double Gnorm2 = G.norm2();
|
||||
Gnorm2 *= Gnorm2;
|
||||
return 1.0/ sqrt(Ct/pow(dt,2) + U.dot(G*U) + Cl*mu*mu*Gnorm2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user