Commit 04c985a5 authored by Dave Moxey's avatar Dave Moxey

Lots of fixes and sorting compiler errors

parent 3470e341
......@@ -24,7 +24,7 @@ IF(NEKTAR_USE_MESHGEN)
IF(CFI_INCLUDE_DIR)
MESSAGE(STATUS "cfi libraries: ${CFI_LIBRARY_API}")
MESSAGE(STATUS "Found CFI Libraries: ${CFI_LIBRARY_API}")
INCLUDE_DIRECTORIES(NekMeshUtils ${CFI_INCLUDE_DIR_HXX})
INCLUDE_DIRECTORIES(NekMeshUtils ${CFI_INCLUDE_DIR})
......
......@@ -113,7 +113,8 @@ public:
*/
const std::string &GetConfig(const std::string &key) const
{
return m_config[key];
auto it = m_config.find(key);
return it->second;
}
/**
......@@ -122,7 +123,7 @@ public:
* @param key Configuration key.
* @param value The configuration value.
*/
void &GetConfig(const std::string &key, const std::string &value)
void SetConfig(const std::string &key, const std::string &value)
{
m_config[key] = value;
}
......
......@@ -87,16 +87,16 @@ bool CADSystemCFI::LoadCAD()
<< "\tubid " << m_cfiHandle.info.ubid << endl;
}
if (m_config["UseCFIMesh"].count())
if (m_config.count("UseCFIMesh"))
{
m_useCFImesh = boost::lexical_cast<bool>(m_config["UseCFIMesh"]);
m_useCFIMesh = boost::lexical_cast<bool>(m_config["UseCFIMesh"]);
}
m_model = m_cfiHandle.openModelFile(m_name.c_str());
if (m_model->getEntityTotal(cfi::TYPE_BODY, cfi::SUBTYPE_ALL) != 1)
{
if (m_config["UseCFIMesh"].count())
if (m_useCFIMesh)
{
if (m_verbose)
{
......
......@@ -49,7 +49,7 @@ class CADSystemCFI : public CADSystem
public:
static CADSystemSharedPtr create(std::string name)
{
return MemoryManager<CADSystemCFI>::AllocateSharedPtr(name, "cfi");
return MemoryManager<CADSystemCFI>::AllocateSharedPtr(name);
}
static std::string key;
......@@ -57,7 +57,7 @@ public:
/**
* @brief Default constructor.
*/
CADSystemCFI(std::string name) : CADSystem(name)
CADSystemCFI(std::string name) : CADSystem(name, "CFI")
{
}
~CADSystemCFI() = default;
......@@ -68,28 +68,24 @@ public:
cfi::Model *GetCFIModel()
{
return model;
return m_model;
}
std::map<std::string, int> GetCFICurveId()
{
return nameToCurveId;
return m_nameToCurveId;
}
std::map<std::string, int> GetCFIFaceId()
{
return nameToFaceId;
return m_nameToFaceId;
}
std::map<std::string, int> GetCFIVertId()
{
return nameToVertId;
return m_nameToVertId;
}
NekDouble GetScaling()
{
return m_scal;
}
void UseCFIMesh()
{
m_useCFIMesh = true;
}
private:
void AddVert(int i, cfi::Point *in);
......
......@@ -77,7 +77,7 @@ bool CADSystemOCE::LoadCAD()
bool fromStep = false;
if (m_config["UseNACA"].count())
if (m_config.count("UseNACA") == 0)
{
// not a naca profile behave normally
// could be a geo
......@@ -411,9 +411,9 @@ Array<OneD, NekDouble> CADSystemOCE::GetBoundingBox()
TopoDS_Shape CADSystemOCE::BuildNACA(string naca)
{
ASSERTL0(naca.length() == 4, "not a 4 digit code");
ASSERTL0(naca.length() == 4, "not a 4 digit code: " + naca);
vector<NekDouble> data;
ParseUtils::GenerateVector(m_naca, data);
ParseUtils::GenerateVector(m_config["UseNACA"], data);
ASSERTL0(data.size() == 5, "not a vaild domain");
int n = std::stoi(naca);
......
......@@ -80,7 +80,7 @@ void ProcessLoadCAD::Process()
if (boost::iequals(ext, ".fbm"))
{
m_mesh->m_cad = GetEngineFactory().CreateInstance("cfi",name);
m_mesh->m_cad = GetEngineFactory().CreateInstance("cfi", name);
if (m_config["usecfimesh"].beenSet)
{
......
......@@ -131,8 +131,8 @@ IF(NEKTAR_USE_MESHGEN)
ADD_DEPENDENCIES(NekMeshUtils oce-0.17 tetgen-1.5 triangle-1.6)
IF(NEKTAR_USE_CFI)
TARGET_LINK_LIBRARIES(NekMeshUtils LINK_PRIVATE ${CFI_LIBRARY_API})
TARGET_LINK_LIBRARIES(NekMeshUtils LINK_PRIVATE ${CFI_LIBRARY_CXX})
TARGET_LINK_LIBRARIES(NekMeshUtils LINK_PUBLIC ${CFI_LIBRARY_API})
TARGET_LINK_LIBRARIES(NekMeshUtils LINK_PUBLIC ${CFI_LIBRARY_CXX})
ENDIF()
ENDIF()
......
......@@ -275,7 +275,7 @@ void InputCADfix::Process()
ElementSharedPtr E = GetElementFactory().CreateInstance(
LibUtilities::ePrism, conf, n, tags);
E->m_cfiParent = it.parent;
m_mesh->m_element[3].push_back(E);
......@@ -301,7 +301,7 @@ void InputCADfix::Process()
ElmtConfig conf(LibUtilities::eTetrahedron, 1, false, false);
ElementSharedPtr E = GetElementFactory().CreateInstance(
LibUtilities::eTetrahedron, conf, n, tags);
E->m_cfiParent = it.parent;
m_mesh->m_element[3].push_back(E);
......@@ -327,7 +327,7 @@ void InputCADfix::Process()
ElmtConfig conf(LibUtilities::eHexahedron, 1, false, false);
ElementSharedPtr E = GetElementFactory().CreateInstance(
LibUtilities::eHexahedron, conf, n, tags);
E->m_cfiParent = it.parent;
m_mesh->m_element[3].push_back(E);
......
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