added: implement valueCoor in mixed spline fields

This commit is contained in:
Arne Morten Kvarving 2022-03-12 21:52:14 +01:00
parent e479951031
commit 3dc01f07a4
8 changed files with 78 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include "ItgPoint.h" #include "ItgPoint.h"
#include "CoordinateMapping.h" #include "CoordinateMapping.h"
#include "Utilities.h" #include "Utilities.h"
#include "Vec3.h"
LRSplineFields2Dmx::LRSplineFields2Dmx (const ASMu2Dmx* patch, LRSplineFields2Dmx::LRSplineFields2Dmx (const ASMu2Dmx* patch,
@ -48,6 +49,18 @@ bool LRSplineFields2Dmx::valueNode (size_t node, Vector& vals) const
} }
bool LRSplineFields2Dmx::valueCoor (const Vec4& x, Vector& vals) const
{
if (x.u)
return this->valueFE(ItgPoint(x.u[0],x.u[1]),vals);
std::cerr << "** LRSplineFields2Dmx::valueCoor: "
<< "not implemented without parameters\n";
return false;
}
bool LRSplineFields2Dmx::valueFE (const ItgPoint& x, Vector& vals) const bool LRSplineFields2Dmx::valueFE (const ItgPoint& x, Vector& vals) const
{ {
if (!surf) return false; if (!surf) return false;

View File

@ -52,6 +52,11 @@ public:
//! \param[out] vals Node values //! \param[out] vals Node values
bool valueNode(size_t node, Vector& vals) const; bool valueNode(size_t node, Vector& vals) const;
//! \brief Computes the value at a given global coordinate.
//! \param[in] x Global/physical coordinate for point
//! \param[out] vals Values in given physical coordinate
bool valueCoor(const Vec4& x, Vector& vals) const;
//! \brief Computes the value at a given local coordinate. //! \brief Computes the value at a given local coordinate.
//! \param[in] x Local coordinate of evaluation point //! \param[in] x Local coordinate of evaluation point
//! \param[out] vals Values in local point in given element //! \param[out] vals Values in local point in given element

View File

@ -18,6 +18,7 @@
#include "ItgPoint.h" #include "ItgPoint.h"
#include "CoordinateMapping.h" #include "CoordinateMapping.h"
#include "Utilities.h" #include "Utilities.h"
#include "Vec3.h"
LRSplineFields3Dmx::LRSplineFields3Dmx (const ASMu3Dmx* patch, LRSplineFields3Dmx::LRSplineFields3Dmx (const ASMu3Dmx* patch,
@ -48,6 +49,18 @@ bool LRSplineFields3Dmx::valueNode (size_t node, Vector& vals) const
} }
bool LRSplineFields3Dmx::valueCoor (const Vec4& x, Vector& vals) const
{
if (x.u)
return this->valueFE(ItgPoint(x.u[0],x.u[1],x.u[2]),vals);
std::cerr << "** LRSplineFields3Dmx::valueCoor: "
<< "not implemented without parameters\n";
return false;
}
bool LRSplineFields3Dmx::valueFE (const ItgPoint& x, Vector& vals) const bool LRSplineFields3Dmx::valueFE (const ItgPoint& x, Vector& vals) const
{ {
if (!vol) return false; if (!vol) return false;

View File

@ -52,6 +52,11 @@ public:
//! \param[out] vals Node values //! \param[out] vals Node values
bool valueNode(size_t node, Vector& vals) const; bool valueNode(size_t node, Vector& vals) const;
//! \brief Computes the value at a given global coordinate.
//! \param[in] x Global/physical coordinate for point
//! \param[out] vals Values in given physical coordinate
bool valueCoor(const Vec4& x, Vector& vals) const;
//! \brief Computes the value at a given local coordinate. //! \brief Computes the value at a given local coordinate.
//! \param[in] x Local coordinate of evaluation point //! \param[in] x Local coordinate of evaluation point
//! \param[out] vals Values in local point in given element //! \param[out] vals Values in local point in given element

View File

@ -18,6 +18,7 @@
#include "ItgPoint.h" #include "ItgPoint.h"
#include "CoordinateMapping.h" #include "CoordinateMapping.h"
#include "Utilities.h" #include "Utilities.h"
#include "Vec3.h"
SplineFields2Dmx::SplineFields2Dmx (const ASMs2Dmx* patch, SplineFields2Dmx::SplineFields2Dmx (const ASMs2Dmx* patch,
@ -48,6 +49,21 @@ bool SplineFields2Dmx::valueNode (size_t node, Vector& vals) const
} }
bool SplineFields2Dmx::valueCoor (const Vec4& x, Vector& vals) const
{
if (x.u)
return this->valueFE(ItgPoint(x.u[0],x.u[1]),vals);
// Use with caution, very slow!
Go::Point pt(x.x,x.y,x.z), clopt(3);
double clo_u, clo_v, dist;
#pragma omp critical
surf->getBasis(1)->closestPoint(pt, clo_u, clo_v, clopt, dist, 1.0e-5);
return this->valueFE(ItgPoint(clo_u,clo_v),vals);
}
bool SplineFields2Dmx::valueFE (const ItgPoint& x, Vector& vals) const bool SplineFields2Dmx::valueFE (const ItgPoint& x, Vector& vals) const
{ {
if (!surf) return false; if (!surf) return false;

View File

@ -52,6 +52,11 @@ public:
//! \param[out] vals Node values //! \param[out] vals Node values
bool valueNode(size_t node, Vector& vals) const; bool valueNode(size_t node, Vector& vals) const;
//! \brief Computes the value at a given global coordinate.
//! \param[in] x Global/physical coordinate for point
//! \param[out] vals Values in given physical coordinate
virtual bool valueCoor(const Vec4& x, Vector& vals) const;
//! \brief Computes the value at a given local coordinate. //! \brief Computes the value at a given local coordinate.
//! \param[in] x Local coordinate of evaluation point //! \param[in] x Local coordinate of evaluation point
//! \param[out] vals Values in local point in given element //! \param[out] vals Values in local point in given element

View File

@ -18,6 +18,7 @@
#include "ItgPoint.h" #include "ItgPoint.h"
#include "CoordinateMapping.h" #include "CoordinateMapping.h"
#include "Utilities.h" #include "Utilities.h"
#include "Vec3.h"
SplineFields3Dmx::SplineFields3Dmx (const ASMs3Dmx* patch, SplineFields3Dmx::SplineFields3Dmx (const ASMs3Dmx* patch,
@ -48,6 +49,21 @@ bool SplineFields3Dmx::valueNode (size_t node, Vector& vals) const
} }
bool SplineFields3Dmx::valueCoor (const Vec4& x, Vector& vals) const
{
if (x.u)
return this->valueFE(ItgPoint(x.u[0],x.u[1],x.u[2]),vals);
// Use with caution, very slow!
Go::Point pt(x.x,x.y,x.z), clopt(3);
double clo_u, clo_v, clo_w, dist;
#pragma omp critical
svol->getBasis(1)->closestPoint(pt, clo_u, clo_v, clo_w, clopt, dist, 1.0e-5);
return this->valueFE(ItgPoint(clo_u,clo_v,clo_w),vals);
}
bool SplineFields3Dmx::valueFE (const ItgPoint& x, Vector& vals) const bool SplineFields3Dmx::valueFE (const ItgPoint& x, Vector& vals) const
{ {
if (!svol) return false; if (!svol) return false;

View File

@ -52,6 +52,11 @@ public:
//! \param[out] vals Node values //! \param[out] vals Node values
bool valueNode(size_t node, Vector& vals) const; bool valueNode(size_t node, Vector& vals) const;
//! \brief Computes the value at a given global coordinate.
//! \param[in] x Global/physical coordinate for point
//! \param[out] vals Values in given physical coordinate
virtual bool valueCoor(const Vec4& x, Vector& vals) const;
//! \brief Computes the value at a given local coordinate. //! \brief Computes the value at a given local coordinate.
//! \param[in] x Local coordinate of evaluation point //! \param[in] x Local coordinate of evaluation point
//! \param[out] vals Values in local point in given element //! \param[out] vals Values in local point in given element