Commit f1f79295 authored by Michael Turner's avatar Michael Turner

file clean up, broke something in gmsh and one nek test

parent c3aa096c
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* @brief A composite is a collection of elements.
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* @brief Represents an edge which joins two points.
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* @brief Basic information about an element.
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* @brief Represents a face comprised of three or more edges.
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* @brief A 3-dimensional six-faced element.
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* @brief A 1-dimensional line between two vertex nodes.
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* Enumeration of condition types (Dirichlet, Neumann, etc).
......
......@@ -33,8 +33,6 @@
//
////////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <vector>
#include <loki/Singleton.h>
#include <StdRegions/StdNodalTriExp.h>
......@@ -55,7 +53,7 @@ using namespace std;
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
ElementFactory& GetElementFactory()
{
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
// Forwards declaration for Element class.
class Element;
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* @brief A 0-dimensional vertex.
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* @brief A 3-dimensional five-faced element (2 triangles, 3
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* @brief A 3-dimensional square-based pyramidic element
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* @brief A 2-dimensional four-sided element.
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* @brief A 3-dimensional four-faced element.
......
......@@ -38,7 +38,7 @@
namespace Nektar
{
namespace Utilities
namespace MeshUtils
{
/**
* @brief A lightweight struct for dealing with high-order triangle
......
......@@ -7,7 +7,7 @@ SET(MeshConvertHeaders
InputModules/InputSwan.h
InputModules/InputStarTec.h
Module.h
OutputModules/OutputGmsh.h
# OutputModules/OutputGmsh.h
OutputModules/OutputNekpp.h
ProcessModules/ProcessBL.h
ProcessModules/ProcessCyl.h
......@@ -31,7 +31,7 @@ SET(MeshConvertSources
InputModules/InputStarTec.cpp
MeshConvert.cpp
Module.cpp
OutputModules/OutputGmsh.cpp
# OutputModules/OutputGmsh.cpp
OutputModules/OutputNekpp.cpp
ProcessModules/ProcessBL.cpp
ProcessModules/ProcessCyl.cpp
......
......@@ -33,9 +33,7 @@
//
////////////////////////////////////////////////////////////////////////////////
#include <string>
#include <MeshUtils/MeshElements/MeshElements.h>
#include <MeshUtils/CADSystem/CADSystem.h>
#include <MeshUtils/Octree/Octree.h>
......@@ -45,12 +43,15 @@
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <MeshUtils/MeshElements/MeshElements.h>
#include "InputCAD.h"
using namespace std;
namespace Nektar{
namespace Utilities{
using namespace Nektar::MeshUtils;
namespace Nektar
{
namespace Utilities
{
ModuleKey InputCAD::className =
GetModuleFactory().RegisterCreatorFunction(
......
......@@ -40,23 +40,25 @@
namespace Nektar
{
namespace Utilities
{
class InputCAD : public InputModule
{
public:
InputCAD(MeshSharedPtr m);
virtual ~InputCAD();
virtual void Process();
namespace Utilities
{
class InputCAD : public InputModule
{
public:
InputCAD(MeshSharedPtr m);
virtual ~InputCAD();
virtual void Process();
/// Creates an instance of this class
static ModuleSharedPtr create(MeshSharedPtr m) {
return MemoryManager<InputCAD>::AllocateSharedPtr(m);
}
/// %ModuleKey for class.
static ModuleKey className;
};
/// Creates an instance of this class
static ModuleSharedPtr create(MeshSharedPtr m) {
return MemoryManager<InputCAD>::AllocateSharedPtr(m);
}
/// %ModuleKey for class.
static ModuleKey className;
};
}
}
#endif
......@@ -33,48 +33,50 @@
//
////////////////////////////////////////////////////////////////////////////////
#ifndef UTILITIES_PREPROCESSING_MESHCONVERT_INPUTGMSH
#define UTILITIES_PREPROCESSING_MESHCONVERT_INPUTGMSH
#ifndef UTILITIES_MESHCONVERT_INPUTGMSH
#define UTILITIES_MESHCONVERT_INPUTGMSH
#include "../Module.h"
namespace Nektar
{
namespace Utilities
{
/**
* Converter for Gmsh files.
*/
class InputGmsh : public InputModule
{
public:
InputGmsh(MeshSharedPtr m);
virtual ~InputGmsh();
virtual void Process();
namespace Utilities
{
/// Creates an instance of this class
static ModuleSharedPtr create(MeshSharedPtr m) {
return MemoryManager<InputGmsh>::AllocateSharedPtr(m);
}
/// %ModuleKey for class.
static ModuleKey className;
static std::map<unsigned int, ElmtConfig> GenElmMap();
/**
* Element map; takes a msh id to an %ElmtConfig object.
*/
static std::map<unsigned int, ElmtConfig> elmMap;
/**
* Converter for Gmsh files.
*/
class InputGmsh : public InputModule
{
public:
InputGmsh(MeshSharedPtr m);
virtual ~InputGmsh();
virtual void Process();
private:
int GetNnodes(unsigned int InputGmshEntity);
vector<int> CreateReordering(unsigned int InputGmshEntity);
vector<int> TriReordering(ElmtConfig conf);
vector<int> QuadReordering(ElmtConfig conf);
vector<int> HexReordering(ElmtConfig conf);
vector<int> PrismReordering(ElmtConfig conf);
vector<int> TetReordering(ElmtConfig conf);
};
/// Creates an instance of this class
static ModuleSharedPtr create(MeshSharedPtr m) {
return MemoryManager<InputGmsh>::AllocateSharedPtr(m);
}
/// %ModuleKey for class.
static ModuleKey className;
static std::map<unsigned int, ElmtConfig> GenElmMap();
/**
* Element map; takes a msh id to an %ElmtConfig object.
*/
static std::map<unsigned int, ElmtConfig> elmMap;
private:
int GetNnodes(unsigned int InputGmshEntity);
vector<int> CreateReordering(unsigned int InputGmshEntity);
vector<int> TriReordering(ElmtConfig conf);
vector<int> QuadReordering(ElmtConfig conf);
vector<int> HexReordering(ElmtConfig conf);
vector<int> PrismReordering(ElmtConfig conf);
vector<int> TetReordering(ElmtConfig conf);
};
}
}
#endif
......@@ -33,87 +33,89 @@
//
////////////////////////////////////////////////////////////////////////////////
#ifndef UTILITIES_PREPROCESSING_MESHCONVERT_INPUTNEK
#define UTILITIES_PREPROCESSING_MESHCONVERT_INPUTNEK
#ifndef UTILITIES_MESHCONVERT_INPUTNEK
#define UTILITIES_MESHCONVERT_INPUTNEK
#include "../Module.h"
namespace Nektar
{
namespace Utilities
namespace Utilities
{
enum NekCurve
{
eFile,
eRecon
};
typedef HOTriangle<NodeSharedPtr> HOSurf;
typedef boost::shared_ptr<HOSurf> HOSurfSharedPtr;
/**
* Hash class for high-order surfaces.
*/
struct HOSurfHash : std::unary_function<HOSurfSharedPtr, std::size_t>
{
/**
* Calculate hash of a given high-order surface p by taking
* successive hashes of the vertex IDs.
*/
std::size_t operator()(HOSurfSharedPtr const& p) const
{
enum NekCurve
std::size_t seed = 0;
std::vector<int> ids = p->vertId;
std::sort(ids.begin(), ids.end());
for (int i = 0; i < ids.size(); ++i)
{
eFile,
eRecon
};
boost::hash_combine(seed, ids[i]);
}
return seed;
}
};
typedef HOTriangle<NodeSharedPtr> HOSurf;
typedef boost::shared_ptr<HOSurf> HOSurfSharedPtr;
bool operator==(HOSurfSharedPtr const &p1, HOSurfSharedPtr const &p2);
/**
* Hash class for high-order surfaces.
*/
struct HOSurfHash : std::unary_function<HOSurfSharedPtr, std::size_t>
{
/**
* Calculate hash of a given high-order surface p by taking
* successive hashes of the vertex IDs.
*/
std::size_t operator()(HOSurfSharedPtr const& p) const
{
std::size_t seed = 0;
std::vector<int> ids = p->vertId;
std::sort(ids.begin(), ids.end());
for (int i = 0; i < ids.size(); ++i)
{
boost::hash_combine(seed, ids[i]);
}
return seed;
}
};
bool operator==(HOSurfSharedPtr const &p1, HOSurfSharedPtr const &p2);
typedef boost::unordered_set<HOSurfSharedPtr, HOSurfHash> HOSurfSet;
/**
* Converter class for Nektar session files.
*/
class InputNek : public InputModule
{
public:
InputNek(MeshSharedPtr p_m);
virtual ~InputNek();
virtual void Process();
/// Creates an instance of this class.
static ModuleSharedPtr create(MeshSharedPtr m) {
return MemoryManager<InputNek>::AllocateSharedPtr(m);
}
/// %ModuleKey for class.
static ModuleKey className;
private:
void LoadHOSurfaces();
int GetNnodes (LibUtilities::ShapeType elType);
/**
* Maps a curve tag to a filename containing surface information.
*/
std::map<string, pair<NekCurve, string> > curveTags;
/**
* Maps a curve tag to the high-order surface data for that tag.
*/
std::map<string, HOSurfSet> hoData;
/**
* Maps ordering of hsf standard element to Nektar++ ordering.
*/
std::map<int, int> hoMap;
};
typedef boost::unordered_set<HOSurfSharedPtr, HOSurfHash> HOSurfSet;
/**
* Converter class for Nektar session files.
*/
class InputNek : public InputModule
{
public:
InputNek(MeshSharedPtr p_m);
virtual ~InputNek();
virtual void Process();
/// Creates an instance of this class.
static ModuleSharedPtr create(MeshSharedPtr m) {
return MemoryManager<InputNek>::AllocateSharedPtr(m);
}
/// %ModuleKey for class.
static ModuleKey className;
private:
void LoadHOSurfaces();
int GetNnodes (LibUtilities::ShapeType elType);
/**
* Maps a curve tag to a filename containing surface information.
*/
std::map<string, pair<NekCurve, string> > curveTags;
/**
* Maps a curve tag to the high-order surface data for that tag.
*/
std::map<string, HOSurfSet> hoData;
/**
* Maps ordering of hsf standard element to Nektar++ ordering.
*/
std::map<int, int> hoMap;
};
}
}
#endif
......@@ -37,7 +37,7 @@
#define UTILITIES_PREPROCESSING_MESHCONVERT_INPUTSTAR
#include "../Module.h"
#include <MeshUtils/MeshElements/MeshElements.h>
#include "ccmio.h"
......
......@@ -37,7 +37,6 @@
#define UTILITIES_PREPROCESSING_MESHCONVERT_INPUTTEC
#include "../Module.h"
#include <MeshUtils/MeshElements/MeshElements.h>
namespace Nektar
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -36,13 +36,20 @@
#ifndef UTILITIES_PREPROCESSING_MESHCONVERT_MODULE
#define UTILITIES_PREPROCESSING_MESHCONVERT_MODULE
#include <map>
#include <vector>
#include <sstream>
#include <string>
#include <iostream>
#include <LibUtilities/BasicUtils/NekFactory.hpp>
#include <fstream>
#include <set>
#include <LibUtilities/BasicUtils/NekFactory.hpp>
#include <MeshUtils/MeshElements/MeshElements.h>
using namespace Nektar::MeshUtils;
namespace Nektar
{
namespace Utilities
......