Commit ea52836a authored by Dave Moxey's avatar Dave Moxey

Add all missing files from previous commit

parent b650048c
......@@ -9,6 +9,10 @@ v5.1.0
**CardiacEPSolver**
- Added additional parameter sets to Fenton-Karma model (!1119)
**NekMesh**
- Improved boundary layer splitting and output to CADfix (!938)
v5.0.1
------
**Library**
......
......@@ -77,12 +77,13 @@ public:
*
* @return Array of two entries, min and max parametric coordinate.
*/
virtual Array<OneD, NekDouble> GetBounds() = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> GetBounds() = 0;
/**
* @brief Returns the minimum and maximum parametric coords t of the curve.
*/
virtual void GetBounds(NekDouble &tmin, NekDouble &tmax) = 0;
NEKMESHUTILS_EXPORT virtual void GetBounds(
NekDouble &tmin, NekDouble &tmax) = 0;
/**
* @brief Calculates the arclength between the two paremetric points \p ti
......@@ -92,7 +93,8 @@ public:
* @param tf Second parametric coordinate.
* @return Arc length between \p ti and \p tf.
*/
virtual NekDouble Length(NekDouble ti, NekDouble tf) = 0;
NEKMESHUTILS_EXPORT virtual NekDouble Length(
NekDouble ti, NekDouble tf) = 0;
/**
* @brief Gets the location (x,y,z) in an array out of the curve at
......@@ -101,7 +103,7 @@ public:
* @param t Parametric coordinate
* @return Array of x,y,z
*/
virtual Array<OneD, NekDouble> P(NekDouble t) = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> P(NekDouble t) = 0;
/**
* @brief Gets the location (x,y,z) in an array out of the curve at
......@@ -109,17 +111,18 @@ public:
*
* @param t Parametric coordinate
*/
virtual void P(NekDouble t, NekDouble &x, NekDouble &y, NekDouble &z) = 0;
NEKMESHUTILS_EXPORT virtual void P(
NekDouble t, NekDouble &x, NekDouble &y, NekDouble &z) = 0;
/**
* @brief Gets the second derivatives at t
*/
virtual Array<OneD, NekDouble> D2(NekDouble t) = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> D2(NekDouble t) = 0;
/**
* @brief Calculates the radius of curvature of the curve at point t
*/
virtual NekDouble Curvature(NekDouble t) = 0;
NEKMESHUTILS_EXPORT virtual NekDouble Curvature(NekDouble t) = 0;
/**
* @brief Calculates the parametric coordinate and arclength location
......@@ -130,14 +133,14 @@ public:
*
* @todo This really needs improving for accuracy.
*/
virtual NekDouble tAtArcLength(NekDouble s) = 0;
NEKMESHUTILS_EXPORT virtual NekDouble tAtArcLength(NekDouble s) = 0;
/**
* @brief Gets the start and end of the curve.
*
* @return Array with 6 entries of endpoints x1,y1,z1,x2,y2,z2.
*/
virtual Array<OneD, NekDouble> GetMinMax() = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> GetMinMax() = 0;
/**
* @brief set the ids of the surfaces either side of the curve
......@@ -186,25 +189,26 @@ public:
* @brief locates a point in the parametric space. returns the
* distance to the point and passes t by reference and updates it
*/
virtual NekDouble loct(Array<OneD, NekDouble> xyz, NekDouble &t) = 0;
NEKMESHUTILS_EXPORT virtual NekDouble loct(
Array<OneD, NekDouble> xyz, NekDouble &t) = 0;
/**
* @brief Returns the orientation of the curve with respect to a given
* surface by id surf
*/
CADOrientation::Orientation GetOrienationWRT(int surf);
NEKMESHUTILS_EXPORT CADOrientation::Orientation GetOrienationWRT(int surf);
/**
* @brief Returns the normal to the curve which is orientate with respect
* to the surface surf
*/
Array<OneD, NekDouble> NormalWRT(NekDouble t, int surf);
NEKMESHUTILS_EXPORT Array<OneD, NekDouble> NormalWRT(NekDouble t, int surf);
/**
* @brief Returns the normal to a curve, it will always point in the concave
* direction
*/
virtual Array<OneD, NekDouble> N(NekDouble t) = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> N(NekDouble t) = 0;
protected:
/// Length of edge
......
......@@ -36,6 +36,7 @@
#define NEKMESHUTILS_CADSYSTEM_CADOBJ
#include <LibUtilities/Memory/NekMemoryManager.hpp>
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
namespace Nektar
{
......@@ -48,7 +49,8 @@ enum cadType
{
eVert,
eCurve,
eSurf
eSurf,
eOther
};
}
......
......@@ -49,16 +49,6 @@ namespace Nektar
namespace NekMeshUtils
{
Array<OneD, NekDouble> CADSurf::locuv(Array<OneD, NekDouble> p)
{
NekDouble dist;
Array<OneD, NekDouble> uv = locuv(p, dist);
WARNINGL1(dist < 1e-3, "large locuv distance");
return uv;
}
void CADSurf::OrientateEdges(CADSurfSharedPtr surf,
vector<EdgeLoopSharedPtr> &ein)
{
......
......@@ -113,13 +113,13 @@ public:
*
* @return Array of 4 entries with parametric umin,umax,vmin,vmax.
*/
virtual Array<OneD, NekDouble> GetBounds() = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> GetBounds() = 0;
/**
* @brief Get the limits of the parametric space for the surface.
*/
virtual void GetBounds(NekDouble &umin, NekDouble &umax, NekDouble &vmin,
NekDouble &vmax) = 0;
NEKMESHUTILS_EXPORT virtual void GetBounds(
NekDouble &umin, NekDouble &umax, NekDouble &vmin, NekDouble &vmax) = 0;
/**
* @brief Get the normal vector at parametric point u,v.
......@@ -127,7 +127,8 @@ public:
* @param uv Array of u and v parametric coords.
* @return Array of xyz components of normal vector.
*/
virtual Array<OneD, NekDouble> N(Array<OneD, NekDouble> uv) = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> N(
Array<OneD, NekDouble> uv) = 0;
/**
* @brief Get the set of first derivatives at parametric point u,v
......@@ -135,7 +136,8 @@ public:
* @param uv Array of u and v parametric coords.
* @return Array of xyz copmonents of first derivatives.
*/
virtual Array<OneD, NekDouble> D1(Array<OneD, NekDouble> uv) = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> D1(
Array<OneD, NekDouble> uv) = 0;
/**
* @brief Get the set of second derivatives at parametric point u,v
......@@ -143,7 +145,8 @@ public:
* @param uv array of u and v parametric coords
* @return array of xyz copmonents of second derivatives
*/
virtual Array<OneD, NekDouble> D2(Array<OneD, NekDouble> uv) = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> D2(
Array<OneD, NekDouble> uv) = 0;
/**
* @brief Get the x,y,z at parametric point u,v.
......@@ -151,15 +154,17 @@ public:
* @param uv Array of u and v parametric coords.
* @return Array of x,y,z location.
*/
virtual Array<OneD, NekDouble> P(Array<OneD, NekDouble> uv) = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> P(
Array<OneD, NekDouble> uv) = 0;
/**
* @brief Get the x,y,z at parametric point u,v.
*
* @param uv Array of u and v parametric coords.
*/
virtual void P(Array<OneD, NekDouble> uv, NekDouble &x, NekDouble &y,
NekDouble &z) = 0;
NEKMESHUTILS_EXPORT virtual void P(
Array<OneD, NekDouble> uv, NekDouble &x, NekDouble &y,
NekDouble &z) = 0;
/**
* @brief Performs a reverse look up to find u,v and x,y,z.
......@@ -168,8 +173,8 @@ public:
* @param p Array of xyz location
* @return The parametric location of xyz on this surface
*/
virtual Array<OneD, NekDouble> locuv(Array<OneD, NekDouble> p,
NekDouble &dist) = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> locuv(
Array<OneD, NekDouble> p, NekDouble &dist) = 0;
/**
* @brief overload function of locuv ommiting the dist parameter
......@@ -177,23 +182,30 @@ public:
* it will produce a warning. To do large distance projection use the other
* locuv method
*/
Array<OneD, NekDouble> locuv(Array<OneD, NekDouble> p);
Array<OneD, NekDouble> locuv(Array<OneD, NekDouble> p)
{
NekDouble dist;
Array<OneD, NekDouble> uv = locuv(p, dist);
WARNINGL1(dist < 1e-3, "large locuv distance");
return uv;
}
/**
* @brief Returns the bounding box of the surface
*/
virtual Array<OneD, NekDouble> BoundingBox() = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> BoundingBox() = 0;
/**
* @brief returns curvature at point uv
*/
virtual NekDouble Curvature(Array<OneD, NekDouble> uv) = 0;
NEKMESHUTILS_EXPORT virtual NekDouble Curvature(
Array<OneD, NekDouble> uv) = 0;
/**
* @brief Is the surface defined by a planar surface (i.e not nurbs and is
* flat)
*/
virtual bool IsPlanar() = 0;
NEKMESHUTILS_EXPORT virtual bool IsPlanar() = 0;
/**
* @brief query reversed normal
......
......@@ -141,7 +141,7 @@ public:
*
* @return true if completed successfully
*/
virtual bool LoadCAD() = 0;
NEKMESHUTILS_EXPORT virtual bool LoadCAD() = 0;
/**
* @brief Returns bounding box of the domain.
......@@ -151,7 +151,7 @@ public:
*
* @return Array with 6 entries: xmin, xmax, ymin, ymax, zmin and zmax.
*/
virtual Array<OneD, NekDouble> GetBoundingBox() = 0;
NEKMESHUTILS_EXPORT virtual Array<OneD, NekDouble> GetBoundingBox() = 0;
/**
* @brief Get the number of surfaces.
......
......@@ -105,6 +105,7 @@ IF(NEKTAR_USE_CFI)
CADSystem/CFI/CADVertCFI.h
CADSystem/CFI/CADCurveCFI.h
CADSystem/CFI/CADSurfCFI.h
CADSystem/CFI/CADElementCFI.h
)
SET(NEKMESHUTILS_SOURCES ${NEKMESHUTILS_SOURCES}
CADSystem/CFI/CADSystemCFI.cpp
......
......@@ -45,10 +45,6 @@
#include <NekMeshUtils/MeshElements/Face.h>
#include <NekMeshUtils/MeshElements/ElementConfig.h>
#ifdef NEKTAR_USE_CFI
#include <NekMeshUtils/CADSystem/CFI/CADSystemCFI.h>
#endif
namespace Nektar
{
namespace NekMeshUtils
......@@ -457,10 +453,6 @@ public:
CADObjectSharedPtr m_parentCAD;
#ifdef NEKTAR_USE_CFI
cfi::MeshableEntity *m_cfiParent;
#endif
protected:
/// ID of the element.
unsigned int m_id;
......
......@@ -93,6 +93,7 @@ Array<OneD, NekDouble> OptiEdge::Getxi()
break;
case CADType::eVert:
case CADType::eOther:
ASSERTL0(false, "Should not be able to pass vert");
}
return xi;
......@@ -130,6 +131,7 @@ Array<OneD, NekDouble> OptiEdge::Getli()
break;
case CADType::eVert:
case CADType::eOther:
ASSERTL0(false, "Should not be able to pass vert");
}
return li;
......@@ -167,6 +169,7 @@ Array<OneD, NekDouble> OptiEdge::Getui()
break;
case CADType::eVert:
case CADType::eOther:
ASSERTL0(false, "Should not be able to pass vert");
}
return ui;
......
......@@ -37,6 +37,7 @@
#include <NekMeshUtils/CADSystem/CADCurve.h>
#include <NekMeshUtils/CADSystem/CADSurf.h>
#include <NekMeshUtils/CADSystem/CADVert.h>
#include <NekMeshUtils/CADSystem/CFI/CADElementCFI.h>
using namespace std;
namespace Nektar
......@@ -276,7 +277,10 @@ void InputCADfix::Process()
ElementSharedPtr E = GetElementFactory().CreateInstance(
LibUtilities::ePrism, conf, n, tags);
E->m_cfiParent = it.parent;
// Create a CFI parent CAD object to store reference to CFI element.
std::shared_ptr<CADElementCFI> cfiParent = MemoryManager<
CADElementCFI>::AllocateSharedPtr(it.parent);
E->m_parentCAD = cfiParent;
m_mesh->m_element[3].push_back(E);
}
......@@ -302,7 +306,10 @@ void InputCADfix::Process()
ElementSharedPtr E = GetElementFactory().CreateInstance(
LibUtilities::eTetrahedron, conf, n, tags);
E->m_cfiParent = it.parent;
// Create a CFI parent CAD object to store reference to CFI element.
std::shared_ptr<CADElementCFI> cfiParent = MemoryManager<
CADElementCFI>::AllocateSharedPtr(it.parent);
E->m_parentCAD = cfiParent;
m_mesh->m_element[3].push_back(E);
}
......@@ -328,7 +335,10 @@ void InputCADfix::Process()
ElementSharedPtr E = GetElementFactory().CreateInstance(
LibUtilities::eHexahedron, conf, n, tags);
E->m_cfiParent = it.parent;
// Create a CFI parent CAD object to store reference to CFI element.
std::shared_ptr<CADElementCFI> cfiParent = MemoryManager<
CADElementCFI>::AllocateSharedPtr(it.parent);
E->m_parentCAD = cfiParent;
m_mesh->m_element[3].push_back(E);
}
......
......@@ -35,8 +35,9 @@
#include "OutputCADfix.h"
#include "NekMeshUtils/CADSystem/CFI/CADCurveCFI.h"
#include "NekMeshUtils/CADSystem/CFI/CADSurfCFI.h"
#include <NekMeshUtils/CADSystem/CFI/CADCurveCFI.h>
#include <NekMeshUtils/CADSystem/CFI/CADSurfCFI.h>
#include <NekMeshUtils/CADSystem/CFI/CADElementCFI.h>
using namespace std;
using namespace Nektar::NekMeshUtils;
......@@ -142,7 +143,10 @@ void OutputCADfix::Process()
}
// Default: volume parent
cfi::MeshableEntity *parent = el->m_cfiParent;
CADElementCFISharedPtr cadParent = std::dynamic_pointer_cast<
CADElementCFI>(el->m_parentCAD);
ASSERTL0(cadParent, "Expected a CFI parent.");
cfi::MeshableEntity *parent = cadParent->GetCfiPointer();
// Point parent
if (node->GetNumCadCurve() > 1)
......@@ -317,7 +321,11 @@ void OutputCADfix::Process()
}
}
el->m_cfiParent->createElement(0, cfi::EntitySubtype(type), cfiNodes);
CADElementCFISharedPtr cadParent = std::dynamic_pointer_cast<
CADElementCFI>(el->m_parentCAD);
ASSERTL0(cadParent, "Expected a CFI parent.");
cadParent->GetCfiPointer()->createElement(
0, cfi::EntitySubtype(type), cfiNodes);
}
m_model->saveCopy(m_config["outfile"].as<string>());
......
Markdown is supported
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