diff --git a/src/ASM/LR/LRSplineFields2Dmx.C b/src/ASM/LR/LRSplineFields2Dmx.C index 4282363a..bc7556c2 100644 --- a/src/ASM/LR/LRSplineFields2Dmx.C +++ b/src/ASM/LR/LRSplineFields2Dmx.C @@ -18,6 +18,7 @@ #include "ItgPoint.h" #include "CoordinateMapping.h" #include "Utilities.h" +#include "Vec3.h" 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 { if (!surf) return false; diff --git a/src/ASM/LR/LRSplineFields2Dmx.h b/src/ASM/LR/LRSplineFields2Dmx.h index a684fae4..37adc023 100644 --- a/src/ASM/LR/LRSplineFields2Dmx.h +++ b/src/ASM/LR/LRSplineFields2Dmx.h @@ -52,6 +52,11 @@ public: //! \param[out] vals Node values 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. //! \param[in] x Local coordinate of evaluation point //! \param[out] vals Values in local point in given element diff --git a/src/ASM/LR/LRSplineFields3Dmx.C b/src/ASM/LR/LRSplineFields3Dmx.C index 018c5185..14fb7f69 100644 --- a/src/ASM/LR/LRSplineFields3Dmx.C +++ b/src/ASM/LR/LRSplineFields3Dmx.C @@ -18,6 +18,7 @@ #include "ItgPoint.h" #include "CoordinateMapping.h" #include "Utilities.h" +#include "Vec3.h" 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 { if (!vol) return false; diff --git a/src/ASM/LR/LRSplineFields3Dmx.h b/src/ASM/LR/LRSplineFields3Dmx.h index f8731aa6..afe696a4 100644 --- a/src/ASM/LR/LRSplineFields3Dmx.h +++ b/src/ASM/LR/LRSplineFields3Dmx.h @@ -52,6 +52,11 @@ public: //! \param[out] vals Node values 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. //! \param[in] x Local coordinate of evaluation point //! \param[out] vals Values in local point in given element diff --git a/src/ASM/SplineFields2Dmx.C b/src/ASM/SplineFields2Dmx.C index bed22d12..e3579bb9 100644 --- a/src/ASM/SplineFields2Dmx.C +++ b/src/ASM/SplineFields2Dmx.C @@ -18,6 +18,7 @@ #include "ItgPoint.h" #include "CoordinateMapping.h" #include "Utilities.h" +#include "Vec3.h" 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 { if (!surf) return false; diff --git a/src/ASM/SplineFields2Dmx.h b/src/ASM/SplineFields2Dmx.h index 9aae3232..02c2973a 100644 --- a/src/ASM/SplineFields2Dmx.h +++ b/src/ASM/SplineFields2Dmx.h @@ -52,6 +52,11 @@ public: //! \param[out] vals Node values 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. //! \param[in] x Local coordinate of evaluation point //! \param[out] vals Values in local point in given element diff --git a/src/ASM/SplineFields3Dmx.C b/src/ASM/SplineFields3Dmx.C index bae68a68..e4e3ef77 100644 --- a/src/ASM/SplineFields3Dmx.C +++ b/src/ASM/SplineFields3Dmx.C @@ -18,6 +18,7 @@ #include "ItgPoint.h" #include "CoordinateMapping.h" #include "Utilities.h" +#include "Vec3.h" 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 { if (!svol) return false; diff --git a/src/ASM/SplineFields3Dmx.h b/src/ASM/SplineFields3Dmx.h index aefa89e0..d3116f3c 100644 --- a/src/ASM/SplineFields3Dmx.h +++ b/src/ASM/SplineFields3Dmx.h @@ -52,6 +52,11 @@ public: //! \param[out] vals Node values 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. //! \param[in] x Local coordinate of evaluation point //! \param[out] vals Values in local point in given element