Fixed: Avoid memory corruption when multi-threaded CGL2 and -principal.
Also handle patch index out-of-range in SIMgeneric::evalPoint.
This commit is contained in:
parent
736614ef37
commit
5f5d792c00
@ -2354,7 +2354,9 @@ bool SIMbase::project (Matrix& ssol, const Vector& psol,
|
|||||||
if (myModel[i]->empty()) continue; // skip empty patches
|
if (myModel[i]->empty()) continue; // skip empty patches
|
||||||
|
|
||||||
// Extract the primary solution control point values for this patch
|
// Extract the primary solution control point values for this patch
|
||||||
extractPatchSolution(myProblem,Vectors(1,psol),i);
|
myProblem->initResultPoints(time.t);
|
||||||
|
if (!this->extractPatchSolution(myProblem,Vectors(1,psol),i))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Initialize material properties for this patch in case of multiple regions
|
// Initialize material properties for this patch in case of multiple regions
|
||||||
const_cast<SIMbase*>(this)->setPatchMaterial(i+1);
|
const_cast<SIMbase*>(this)->setPatchMaterial(i+1);
|
||||||
|
@ -47,13 +47,14 @@ Vector SIMgeneric::getSolution (const Vector& psol, const double* par,
|
|||||||
return tmpVal.getColumn(1);
|
return tmpVal.getColumn(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int SIMgeneric::evalPoint(const double* xi, Vec3& X, double* param, int patch) const
|
|
||||||
{
|
|
||||||
ASMbase *pch = getPatch(patch-1);
|
|
||||||
|
|
||||||
double dummy[2];
|
int SIMgeneric::evalPoint (const double* xi, Vec3& X, double* param,
|
||||||
if(param == nullptr)
|
int patch) const
|
||||||
return pch->evalPoint(xi, dummy, X);
|
{
|
||||||
else
|
patch = this->getLocalPatchIndex(patch);
|
||||||
return pch->evalPoint(xi, param, X);
|
if (patch < 1 || (size_t)patch > myModel.size())
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
double dummy[3];
|
||||||
|
return myModel[patch-1]->evalPoint(xi, param ? param : dummy, X);
|
||||||
}
|
}
|
||||||
|
@ -50,10 +50,10 @@ public:
|
|||||||
//! \param[in] xi Dimensionless parameters in range [0,1] of the point
|
//! \param[in] xi Dimensionless parameters in range [0,1] of the point
|
||||||
//! \param[out] X The Cartesian coordinates of the point
|
//! \param[out] X The Cartesian coordinates of the point
|
||||||
//! \param[out] param The parameters of the point in the knot-span domain
|
//! \param[out] param The parameters of the point in the knot-span domain
|
||||||
//! \param[in] patch The patch to evaluate
|
//! \param[in] patch 1-based patch index contining the evaluation point
|
||||||
//! \return 0 if the evaluation went good
|
//! \return Local node number within the patch that matches the point
|
||||||
int evalPoint(const double* xi, Vec3& X,
|
int evalPoint(const double* xi, Vec3& X,
|
||||||
double* param=nullptr, int patch = 1) const;
|
double* param = nullptr, int patch = 1) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user