Skip to content
Snippets Groups Projects
Commit 2fd5224c authored by mattijs's avatar mattijs
Browse files

ENH: pointMVCWeight : handle zero field. (div by zero)

parent a4cbf982
Branches
Tags
No related merge requests found
......@@ -60,7 +60,7 @@ protected:
public:
//- Runtime type information
TypeName("cellPoint");
TypeName("point");
// Constructors
......
......@@ -119,7 +119,15 @@ void Foam::pointMVCWeight::calcWeights
//Pout<< " uj:" << u[j] << " ujPlus1:" << u[jPlus1] << endl;
vector temp = u[j] ^ u[jPlus1];
temp /= mag(temp);
scalar magTemp = mag(temp);
if (magTemp < VSMALL)
{
continue;
}
temp /= magTemp;
//Pout<< " uj:" << u[j] << " ujPlus1:" << u[jPlus1]
// << " temp:" << temp << endl;
......
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