changed: hardcode basis to 1 in ASMs[2|3]D::projectSolution

retains current behavior for single basis and this way
it also works for basis 1 in mixed ASMs.
This commit is contained in:
Arne Morten Kvarving 2016-07-06 10:03:35 +02:00 committed by Knut Morten Okstad
parent ea76fc6cf9
commit b38a254a30
2 changed files with 29 additions and 21 deletions

View File

@ -116,10 +116,12 @@ Go::SplineSurface* ASMs2D::projectSolution (const IntegrandBase& integrnd) const
{ {
PROFILE2("ASMs2D::projectSolution"); PROFILE2("ASMs2D::projectSolution");
const int basis = 1;
// Compute parameter values of the result sampling points (Greville points) // Compute parameter values of the result sampling points (Greville points)
std::array<RealArray,2> gpar; std::array<RealArray,2> gpar;
for (int dir = 0; dir < 2; dir++) for (int dir = 0; dir < 2; dir++)
if (!this->getGrevilleParameters(gpar[dir],dir)) if (!this->getGrevilleParameters(gpar[dir],dir,basis))
return nullptr; return nullptr;
// Evaluate the secondary solution at all sampling points // Evaluate the secondary solution at all sampling points
@ -127,6 +129,8 @@ Go::SplineSurface* ASMs2D::projectSolution (const IntegrandBase& integrnd) const
if (!this->evalSolution(sValues,integrnd,gpar.data()) || sValues.rows() == 0) if (!this->evalSolution(sValues,integrnd,gpar.data()) || sValues.rows() == 0)
return nullptr; return nullptr;
const Go::SplineSurface* psurf = this->getBasis(basis);
// Project the results onto the spline basis to find control point // Project the results onto the spline basis to find control point
// values based on the result values evaluated at the Greville points. // values based on the result values evaluated at the Greville points.
// Note that we here implicitly assume that the number of Greville points // Note that we here implicitly assume that the number of Greville points
@ -135,16 +139,16 @@ Go::SplineSurface* ASMs2D::projectSolution (const IntegrandBase& integrnd) const
// other projection schemes later. // other projection schemes later.
RealArray weights; RealArray weights;
if (surf->rational()) if (psurf->rational())
surf->getWeights(weights); psurf->getWeights(weights);
const Vector& vec = sValues; const Vector& vec = sValues;
return Go::SurfaceInterpolator::regularInterpolation(surf->basis(0), return Go::SurfaceInterpolator::regularInterpolation(psurf->basis(0),
surf->basis(1), psurf->basis(1),
gpar[0], gpar[1], gpar[0], gpar[1],
const_cast<Vector&>(vec), const_cast<Vector&>(vec),
sValues.rows(), sValues.rows(),
surf->rational(), psurf->rational(),
weights); weights);
} }

View File

@ -115,12 +115,16 @@ Go::SplineVolume* ASMs3D::projectSolution (const IntegrandBase& integrand) const
{ {
PROFILE2("ASMs3D::projectSolution"); PROFILE2("ASMs3D::projectSolution");
const int basis = 1;
// Compute parameter values of the result sampling points (Greville points) // Compute parameter values of the result sampling points (Greville points)
std::array<RealArray,3> gpar; std::array<RealArray,3> gpar;
for (int dir = 0; dir < 3; dir++) for (int dir = 0; dir < 3; dir++)
if (!this->getGrevilleParameters(gpar[dir],dir)) if (!this->getGrevilleParameters(gpar[dir],dir,basis))
return nullptr; return nullptr;
const Go::SplineVolume* pvol = this->getBasis(basis);
// Evaluate the secondary solution at all sampling points // Evaluate the secondary solution at all sampling points
Matrix sValues; Matrix sValues;
if (!this->evalSolution(sValues,integrand,gpar.data()) || sValues.rows() == 0) if (!this->evalSolution(sValues,integrand,gpar.data()) || sValues.rows() == 0)
@ -134,17 +138,17 @@ Go::SplineVolume* ASMs3D::projectSolution (const IntegrandBase& integrand) const
// other projection schemes later. // other projection schemes later.
RealArray weights; RealArray weights;
if (svol->rational()) if (pvol->rational())
svol->getWeights(weights); pvol->getWeights(weights);
const Vector& vec = sValues; const Vector& vec = sValues;
return Go::VolumeInterpolator::regularInterpolation(svol->basis(0), return Go::VolumeInterpolator::regularInterpolation(pvol->basis(0),
svol->basis(1), pvol->basis(1),
svol->basis(2), pvol->basis(2),
gpar[0], gpar[1], gpar[2], gpar[0], gpar[1], gpar[2],
const_cast<Vector&>(vec), const_cast<Vector&>(vec),
sValues.rows(), sValues.rows(),
svol->rational(), pvol->rational(),
weights); weights);
} }