Commit ecc683a8 authored by Michael Turner's avatar Michael Turner

windows fix take 2

parent 18fc175c
......@@ -44,6 +44,8 @@
#include <NekMeshUtils/MeshElements/MeshElements.h>
#include <NekMeshUtils/CADSystem/CADSystem.h>
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
namespace Nektar
{
namespace NekMeshUtils
......@@ -57,9 +59,9 @@ public:
/**
*@brief default constructor
*/
BLMesh(MeshSharedPtr m, std::vector<unsigned int> bls,
std::vector<unsigned int> syms, NekDouble b) :
m_mesh(m), m_blsurfs(bls), m_symsurfs(syms), m_bl(b)
NEKMESHUTILS_EXPORT BLMesh(MeshSharedPtr m, std::vector<unsigned int> bls,
std::vector<unsigned int> syms, NekDouble b) :
m_mesh(m), m_blsurfs(bls), m_symsurfs(syms), m_bl(b)
{
};
......@@ -67,12 +69,12 @@ public:
/**
*@brief execute tet meshing
*/
void Mesh();
NEKMESHUTILS_EXPORT void Mesh();
/**
* @brief Get the map of surface element id to pseudo surface prism face
*/
std::map<int, FaceSharedPtr> GetSurfToPri()
NEKMESHUTILS_EXPORT std::map<int, FaceSharedPtr> GetSurfToPri()
{
return m_surftopriface;
}
......
......@@ -46,6 +46,8 @@
#include <NekMeshUtils/CADSystem/CADVert.h>
#include <NekMeshUtils/CADSystem/CADSurf.h>
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
namespace Nektar
{
namespace NekMeshUtils
......@@ -65,14 +67,14 @@ public:
/**
* @brief Default constructor.
*/
CADCurve(int i, TopoDS_Shape in);
NEKMESHUTILS_EXPORT CADCurve(int i, TopoDS_Shape in);
/**
* @brief Returns the minimum and maximum parametric coords t of the curve.
*
* @return Array of two entries, min and max parametric coordinate.
*/
Array<OneD, NekDouble> Bounds();
NEKMESHUTILS_EXPORT Array<OneD, NekDouble> Bounds();
/**
* @brief Calculates the arclength between the two paremetric points \p ti
......@@ -82,7 +84,7 @@ public:
* @param tf Second parametric coordinate.
* @return Arc length between \p ti and \p tf.
*/
NekDouble Length(NekDouble ti, NekDouble tf);
NEKMESHUTILS_EXPORT NekDouble Length(NekDouble ti, NekDouble tf);
/**
* @brief Gets the location (x,y,z) in an array out of the curve at point \p t.
......@@ -90,7 +92,7 @@ public:
* @param t Parametric coordinate
* @return Array of x,y,z
*/
Array<OneD, NekDouble> P(NekDouble t);
NEKMESHUTILS_EXPORT Array<OneD, NekDouble> P(NekDouble t);
/**
* @brief Calculates the parametric coordinate and arclength location
......@@ -101,43 +103,49 @@ public:
*
* @todo This really needs improving for accuracy.
*/
NekDouble tAtArcLength(NekDouble s);
NEKMESHUTILS_EXPORT NekDouble tAtArcLength(NekDouble s);
/**
* @brief Gets the start and end of the curve.
*
* @return Array with 6 entries of endpoints x1,y1,z1,x2,y2,z2.
*/
Array<OneD, NekDouble> GetMinMax();
NEKMESHUTILS_EXPORT Array<OneD, NekDouble> GetMinMax();
/// return the id of the curve
int GetID()
NEKMESHUTILS_EXPORT int GetID()
{
return m_ID;
}
///set the ids of the surfaces either side of the curve
void SetAdjSurf(std::vector<CADSurfSharedPtr> i)
NEKMESHUTILS_EXPORT void SetAdjSurf(std::vector<CADSurfSharedPtr> i)
{
m_adjSurfs = i;
}
/// returns the ids of neigbouring surfaces
std::vector<CADSurfSharedPtr> GetAdjSurf()
NEKMESHUTILS_EXPORT std::vector<CADSurfSharedPtr> GetAdjSurf()
{
return m_adjSurfs;
}
/// returns lenght of the curve
NekDouble GetTotLength(){return m_length;}
NEKMESHUTILS_EXPORT NekDouble GetTotLength(){return m_length;}
/*
* @brief assign ids of end vertices in main cad
*/
void SetVert(std::vector<CADVertSharedPtr> &falVert){m_mainVerts = falVert;}
NEKMESHUTILS_EXPORT void SetVert(std::vector<CADVertSharedPtr> &falVert)
{
m_mainVerts = falVert;
}
/// get the ids of the vertices that are the ends of the curve, which are in the main cad list
std::vector<CADVertSharedPtr> GetVertex(){return m_mainVerts;}
NEKMESHUTILS_EXPORT std::vector<CADVertSharedPtr> GetVertex()
{
return m_mainVerts;
}
private:
/// ID of the curve.
......
......@@ -45,6 +45,8 @@
#include <NekMeshUtils/CADSystem/CADVert.h>
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
namespace Nektar
{
namespace NekMeshUtils
......@@ -76,7 +78,7 @@ public:
/**
* @brief Default constructor.
*/
CADSurf(int i, TopoDS_Shape in, std::vector<EdgeLoop> ein);
NEKMESHUTILS_EXPORT CADSurf(int i, TopoDS_Shape in, std::vector<EdgeLoop> ein);
/**
* @brief Get the IDs of the edges which bound the surface.
......@@ -87,7 +89,7 @@ public:
* integer that indicates whether this edge is orientated forwards or
* backwards on this surface to form the loop.
*/
std::vector<EdgeLoop> GetEdges()
NEKMESHUTILS_EXPORT std::vector<EdgeLoop> GetEdges()
{
return m_edges;
}
......@@ -97,7 +99,7 @@ public:
*
* @return Array of 4 entries with parametric umin,umax,vmin,vmax.
*/
Array<OneD, NekDouble> GetBounds()
NEKMESHUTILS_EXPORT Array<OneD, NekDouble> GetBounds()
{
Array<OneD,NekDouble> b(4);
......@@ -115,7 +117,7 @@ public:
* @param uv Array of u and v parametric coords.
* @return Array of xyz components of normal vector.
*/
Array<OneD, NekDouble> N (Array<OneD, NekDouble> uv);
NEKMESHUTILS_EXPORT Array<OneD, NekDouble> N (Array<OneD, NekDouble> uv);
/**
* @brief Get the set of first derivatives at parametric point u,v
......@@ -123,7 +125,7 @@ public:
* @param uv Array of u and v parametric coords.
* @return Array of xyz copmonents of first derivatives.
*/
Array<OneD, NekDouble> D1 (Array<OneD, NekDouble> uv);
NEKMESHUTILS_EXPORT Array<OneD, NekDouble> D1 (Array<OneD, NekDouble> uv);
/**
* @brief Get the set of second derivatives at parametric point u,v
......@@ -131,7 +133,7 @@ public:
* @param uv array of u and v parametric coords
* @return array of xyz copmonents of second derivatives
*/
Array<OneD, NekDouble> D2 (Array<OneD, NekDouble> uv);
NEKMESHUTILS_EXPORT Array<OneD, NekDouble> D2 (Array<OneD, NekDouble> uv);
/**
* @brief Get the x,y,z at parametric point u,v.
......@@ -139,7 +141,7 @@ public:
* @param uv Array of u and v parametric coords.
* @return Array of xyz location.
*/
Array<OneD, NekDouble> P (Array<OneD, NekDouble> uv);
NEKMESHUTILS_EXPORT Array<OneD, NekDouble> P (Array<OneD, NekDouble> uv);
/**
* @brief Performs a reverse look up to find u,v and x,y,z.
......@@ -147,24 +149,24 @@ public:
* @param p Array of xyz location
* @return The parametric location of xyz on this surface
*/
Array<OneD, NekDouble> locuv(Array<OneD, NekDouble> p);
NEKMESHUTILS_EXPORT Array<OneD, NekDouble> locuv(Array<OneD, NekDouble> p);
/**
* @brief returns true if the surface is flat (2D)
*/
bool IsPlane();
NEKMESHUTILS_EXPORT bool IsPlane();
/**
* @brief sets the flag to reverse the normal for this suface,
* this is determined in cadsystem and ensures all surface normals,
* point internaly
*/
void SetReverseNomral()
NEKMESHUTILS_EXPORT void SetReverseNomral()
{
m_correctNormal = false;
}
bool IsReversedNormal()
NEKMESHUTILS_EXPORT bool IsReversedNormal()
{
return !m_correctNormal;
}
......@@ -172,7 +174,7 @@ public:
/**
* @brief surface needs to know if it is bounded by only two curves
*/
void SetTwoC()
NEKMESHUTILS_EXPORT void SetTwoC()
{
m_hasTwoCurves = true;
}
......@@ -180,24 +182,24 @@ public:
/**
* @brief query two curves
*/
bool GetTwoC(){return m_hasTwoCurves;}
NEKMESHUTILS_EXPORT bool GetTwoC(){return m_hasTwoCurves;}
/**
* @brief return id
*/
int GetId(){return m_ID;}
NEKMESHUTILS_EXPORT int GetId(){return m_ID;}
/**
* @brief does unconstrained locuv to project point from anywhere
*/
NekDouble DistanceTo(Array<OneD, NekDouble> p);
NEKMESHUTILS_EXPORT NekDouble DistanceTo(Array<OneD, NekDouble> p);
void ProjectTo(Array<OneD, NekDouble> &tp, Array<OneD, NekDouble> &uv);
NEKMESHUTILS_EXPORT void ProjectTo(Array<OneD, NekDouble> &tp, Array<OneD, NekDouble> &uv);
/**
* @brief returns curvature at point uv
*/
NekDouble Curvature(Array<OneD, NekDouble> uv);
NEKMESHUTILS_EXPORT NekDouble Curvature(Array<OneD, NekDouble> uv);
private:
......
......@@ -48,6 +48,8 @@
#include <NekMeshUtils/CADSystem/CADCurve.h>
#include <NekMeshUtils/CADSystem/CADSurf.h>
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
namespace Nektar
{
namespace NekMeshUtils
......@@ -67,26 +69,26 @@ public:
/**
* @brief Default constructor.
*/
CADSystem(const std::string &name) : m_name(name)
NEKMESHUTILS_EXPORT CADSystem(const std::string &name) : m_name(name)
{
}
/**
* @brief Return the name of the CAD system.
*/
std::string GetName();
NEKMESHUTILS_EXPORT std::string GetName();
/**
* @brief Initialises CAD and makes surface, curve and vertex maps.
*
* @return true if completed successfully
*/
bool LoadCAD();
NEKMESHUTILS_EXPORT bool LoadCAD();
/**
* @brief Reports basic properties to screen.
*/
void Report();
NEKMESHUTILS_EXPORT void Report();
/**
* @brief Returns bounding box of the domain.
......@@ -96,12 +98,12 @@ public:
*
* @return Array with 6 entries: xmin, xmax, ymin, ymax, zmin and zmax.
*/
Array<OneD, NekDouble> GetBoundingBox();
NEKMESHUTILS_EXPORT Array<OneD, NekDouble> GetBoundingBox();
/**
* @brief Get the number of surfaces.
*/
int GetNumSurf()
NEKMESHUTILS_EXPORT int GetNumSurf()
{
return m_surfs.size();
}
......@@ -109,7 +111,7 @@ public:
/**
* @brief Get the number of curves.
*/
int GetNumCurve()
NEKMESHUTILS_EXPORT int GetNumCurve()
{
return m_curves.size();
}
......@@ -117,7 +119,7 @@ public:
/**
* @brief Gets a curve from the map.
*/
CADCurveSharedPtr GetCurve(int i)
NEKMESHUTILS_EXPORT CADCurveSharedPtr GetCurve(int i)
{
std::map<int,CADCurveSharedPtr>::iterator
search = m_curves.find(i);
......@@ -129,7 +131,7 @@ public:
/**
* @brief Gets a suface from the map.
*/
CADSurfSharedPtr GetSurf(int i)
NEKMESHUTILS_EXPORT CADSurfSharedPtr GetSurf(int i)
{
std::map<int,CADSurfSharedPtr>::iterator
search = m_surfs.find(i);
......@@ -141,7 +143,7 @@ public:
/**
* @brief Gets map of all vertices
*/
std::map<int, CADVertSharedPtr> GetVerts()
NEKMESHUTILS_EXPORT std::map<int, CADVertSharedPtr> GetVerts()
{
return m_verts;
}
......@@ -149,7 +151,7 @@ public:
/**
* @brief Gets number of vertices
*/
int GetNumVerts(){return m_verts.size();}
NEKMESHUTILS_EXPORT int GetNumVerts(){return m_verts.size();}
/**
* @brief based on location in space, uses opencascade routines to
......@@ -157,7 +159,7 @@ public:
* and should be used sparingly, it is smart enough to take and form
* of geometry
*/
bool InsideShape(Array<OneD, NekDouble> loc);
NEKMESHUTILS_EXPORT bool InsideShape(Array<OneD, NekDouble> loc);
private:
......
......@@ -45,6 +45,8 @@
#include <NekMeshUtils/MeshElements/MeshElements.h>
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
namespace Nektar
{
namespace NekMeshUtils
......@@ -64,7 +66,7 @@ public:
/**
* @brief Default constructor.
*/
CADVert(int i, TopoDS_Shape in)
NEKMESHUTILS_EXPORT CADVert(int i, TopoDS_Shape in)
{
gp_Trsf transform;
gp_Pnt ori(0.0, 0.0, 0.0);
......@@ -83,7 +85,7 @@ public:
/**
* @brief Get x,y,z location of the vertex
*/
Array<OneD, NekDouble> GetLoc()
NEKMESHUTILS_EXPORT Array<OneD, NekDouble> GetLoc()
{
Array<OneD, NekDouble> out(3);
out[0] = m_occVert.X(); out[1] = m_occVert.Y(); out[2] = m_occVert.Z();
......@@ -93,17 +95,17 @@ public:
/**
* @brief Return ID of the vertex
*/
int GetId(){return m_ID;}
NEKMESHUTILS_EXPORT int GetId(){return m_ID;}
/**
* @brief returns a node object of the cad vertex
*/
NodeSharedPtr GetNode(){return m_node;}
NEKMESHUTILS_EXPORT NodeSharedPtr GetNode(){return m_node;}
/**
* @brief if the vertex is degenerate manually set uv for that surface
*/
void SetDegen(int s, CADSurfSharedPtr su, NekDouble u, NekDouble v)
NEKMESHUTILS_EXPORT void SetDegen(int s, CADSurfSharedPtr su, NekDouble u, NekDouble v)
{
degen = true;
degensurf = s;
......@@ -116,7 +118,7 @@ public:
/**
* @brief query is degenerate
*/
int IsDegen()
NEKMESHUTILS_EXPORT int IsDegen()
{
if(degen)
{
......
......@@ -32,6 +32,7 @@ IF(NEKTAR_USE_MESH)
ENDIF()
SET(NEKMESHUTILS_HEADERS
NekMeshUtilsDeclspec.h
MeshElements/MeshElements.h
MeshElements/Node.h
MeshElements/Edge.h
......
......@@ -46,6 +46,8 @@
#include <NekMeshUtils/MeshElements/MeshElements.h>
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
namespace Nektar
{
namespace NekMeshUtils
......@@ -62,35 +64,35 @@ class TetGenInterface
/**
* @brief default constructor
*/
TetGenInterface()
NEKMESHUTILS_EXPORT TetGenInterface()
{
};
/**
* @brief assign parameters for meshing
*/
void InitialMesh(std::map<int, NodeSharedPtr> tgidton,
NEKMESHUTILS_EXPORT void InitialMesh(std::map<int, NodeSharedPtr> tgidton,
std::vector<Array<OneD, int> > tri);
/**
* @brief gets the locations of the stiener points added by tetgen
*/
void GetNewPoints(int num, std::vector<Array<OneD, NekDouble> > &newp);
NEKMESHUTILS_EXPORT void GetNewPoints(int num, std::vector<Array<OneD, NekDouble> > &newp);
/**
* @brief refines a previously made tetmesh with node delta information from the Octree
*/
void RefineMesh(std::map<int, NekDouble> delta);
NEKMESHUTILS_EXPORT void RefineMesh(std::map<int, NekDouble> delta);
/**
* @brief get the list of connectivites of the nodes
*/
std::vector<Array<OneD, int> > Extract();
NEKMESHUTILS_EXPORT std::vector<Array<OneD, int> > Extract();
/**
* @brief clear previous mesh
*/
void freetet();
NEKMESHUTILS_EXPORT void freetet();
private:
......
......@@ -53,6 +53,8 @@ extern "C"{
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/Memory/NekMemoryManager.hpp>
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
namespace Nektar
{
namespace NekMeshUtils
......@@ -69,14 +71,14 @@ public:
/**
* @brief default constructor
*/
TriangleInterface()
NEKMESHUTILS_EXPORT TriangleInterface()
{
};
/**
* @brief assign meshing paramters
*/
void Assign(std::vector<std::vector<NodeSharedPtr> > &boundingloops,
NEKMESHUTILS_EXPORT void Assign(std::vector<std::vector<NodeSharedPtr> > &boundingloops,
std::vector<Array<OneD, NekDouble> > &centers, int i,
NekDouble str = 1.0)
{
......@@ -86,27 +88,20 @@ public:
sid = i;
}
void AssignStiener(std::vector<NodeSharedPtr> stiner)
NEKMESHUTILS_EXPORT void AssignStiener(std::vector<NodeSharedPtr> stiner)
{
m_stienerpoints = stiner;
}
/**
* @brief destructor, clear mesh to prevent memory leak
*/
~TriangleInterface()
{
}
/**
* @brief execute meshing
*/
void Mesh(bool Quiet = true, bool Quality = false);
NEKMESHUTILS_EXPORT void Mesh(bool Quiet = true, bool Quality = false);
/**
* @brief extract mesh
*/
void Extract(std::vector<std::vector<NodeSharedPtr> > &Connec);
NEKMESHUTILS_EXPORT void Extract(std::vector<std::vector<NodeSharedPtr> > &Connec);
private:
......
......@@ -47,7 +47,7 @@ namespace NekMeshUtils
*/
class Composite {
public:
Composite() : m_reorder(true) {}
NEKMESHUTILS_EXPORT Composite() : m_reorder(true) {}
/**
* @brief Generate a Nektar++ string describing the composite.
......@@ -55,7 +55,7 @@ namespace NekMeshUtils
* The list of composites may include individual element IDs or ranges
* of element IDs.
*/
std::string GetXmlString(bool doSort=true)
NEKMESHUTILS_EXPORT std::string GetXmlString(bool doSort=true)
{
#if 0 // turn this option off since causes problem with InputNekpp.cpp
......
......@@ -49,9 +49,9 @@ namespace NekMeshUtils
class Edge {
public:
/// Creates a new edge.
Edge(NodeSharedPtr pVertex1, NodeSharedPtr pVertex2,
std::vector<NodeSharedPtr> pEdgeNodes,
LibUtilities::PointsType pCurveType)
NEKMESHUTILS_EXPORT Edge(NodeSharedPtr pVertex1, NodeSharedPtr pVertex2,
std::vector<NodeSharedPtr> pEdgeNodes,
LibUtilities::PointsType pCurveType)
: m_n1(pVertex1), m_n2(pVertex2), m_edgeNodes(pEdgeNodes),
m_curveType(pCurveType), m_geom()
{
......@@ -60,7 +60,7 @@ namespace NekMeshUtils
#endif
}
/// Creates a new linear edge.
Edge(NodeSharedPtr pVertex1, NodeSharedPtr pVertex2)
NEKMESHUTILS_EXPORT Edge(NodeSharedPtr pVertex1, NodeSharedPtr pVertex2)
: m_n1(pVertex1), m_n2(pVertex2), m_edgeNodes(),
m_curveType(), m_geom()
{
......@@ -69,21 +69,21 @@ namespace NekMeshUtils
#endif
}
/// Copies an existing edge.
Edge(const Edge& pSrc)
NEKMESHUTILS_EXPORT Edge(const Edge& pSrc)
: m_n1(pSrc.m_n1), m_n2(pSrc.m_n2), m_edgeNodes(pSrc.m_edgeNodes),
m_curveType(pSrc.m_curveType), m_geom(pSrc.m_geom) {}
~Edge()
NEKMESHUTILS_EXPORT ~Edge()
{}
/// Returns the total number of nodes defining the edge.
unsigned int GetNodeCount() const
NEKMESHUTILS_EXPORT unsigned int GetNodeCount() const
{
return m_edgeNodes.size() + 2;
}
/// Creates a Nektar++ string listing the coordinates of all the
/// nodes.
std::string GetXmlCurveString() const
NEKMESHUTILS_EXPORT std::string GetXmlCurveString() const
{
std::stringstream s;
std::string str;
...</