Commit 537ce867 authored by Michael Turner's avatar Michael Turner

basic wake line refinement

parent 316686bb
......@@ -51,8 +51,6 @@ std::string CADSystemOCE::key = GetEngineFactory().RegisterCreatorFunction(
bool CADSystemOCE::LoadCAD()
{
cout << "trying " << m_name << endl;
if (m_name.find('.') != std::string::npos)
{
// Takes step file and makes OpenCascade shape
......@@ -69,7 +67,7 @@ bool CADSystemOCE::LoadCAD()
}
else
{
cout << "assuming " << m_name << " is a 4 digit naca code" << endl;
cout << m_name << " is not a step file, assuming it is a 4 digit naca code" << endl;
shape = BuildNACA(m_name);
/*STEPControl_Writer writer;
......
......@@ -38,8 +38,11 @@
#include <NekMeshUtils/CADSystem/CADCurve.h>
#include <NekMeshUtils/Module/Module.h>
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <boost/algorithm/string.hpp>
using namespace std;
namespace Nektar
{
......@@ -1047,38 +1050,34 @@ void Octree::CompileSourcePointList()
cout << endl;
}
//vector<unsigned int> surfs;
//ParseUtils::GenerateSeqVector(surf.c_str(), surfs);
if (m_udsfileset)
if (m_refinement.size() > 0)
{
if(m_mesh->m_verbose)
{
cout << "\t\tModifying based on uds files" << endl;
cout << "\t\tModifying based on refinement lines" << endl;
}
// now deal with the user defined spacing
vector<linesource> lsources;
fstream fle;
fle.open(m_udsfile.c_str());
vector<string> lines;
string fileline;
boost::split(lines, m_refinement, boost::is_any_of(":"));
while (!fle.eof())
for(int i = 0; i < lines.size(); i++)
{
getline(fle, fileline);
stringstream s(fileline);
string word;
s >> word;
if (word == "L")
{
Array<OneD, NekDouble> x1(3), x2(3);
NekDouble r, d;
s >> x1[0] >> x1[1] >> x1[2] >> x2[0] >> x2[1] >> x2[2]
>> r >> d;
lsources.push_back(linesource(x1, x2, r, d));
}
vector<NekDouble> data;
ParseUtils::GenerateUnOrderedVector(lines[i].c_str(), data);
Array<OneD, NekDouble> x1(3), x2(3);
x1[0] = data[0];
x1[1] = data[1];
x1[2] = data[2];
x2[0] = data[3];
x2[1] = data[4];
x2[2] = data[5];
lsources.push_back(linesource(x1, x2, data[6], data[7]));
}
fle.close();
// this takes any existing sourcepoints within the influence range
// and modifies them
......
......@@ -57,7 +57,6 @@ public:
Octree(MeshSharedPtr m) : m_mesh(m)
{
m_udsfileset = false;
}
Octree()
......@@ -115,10 +114,9 @@ public:
*
* @param nm name of the user defined spacing file
*/
void UDS(std::string nm)
void Refinement(std::string nm)
{
m_udsfile = nm;
m_udsfileset = true;
m_refinement = nm;
}
private:
......@@ -190,10 +188,8 @@ private:
int m_numoct;
/// Mesh object
MeshSharedPtr m_mesh;
/// user defined spacing has been set
bool m_udsfileset;
/// name of the user defined spacing file
std::string m_udsfile;
std::string m_refinement;
};
typedef boost::shared_ptr<Octree> OctreeSharedPtr;
......
......@@ -55,7 +55,7 @@ ProcessLoadOctree::ProcessLoadOctree(MeshSharedPtr m) : ProcessModule(m)
ConfigOption(false, "0", "mindelta.");
m_config["eps"] =
ConfigOption(false, "0", "mindelta.");
m_config["udsfile"] =
m_config["refinement"] =
ConfigOption(false, "", "mindelta.");
m_config["writeoctree"] =
ConfigOption(true, "0", "dump octree as xml mesh");
......@@ -87,9 +87,9 @@ void ProcessLoadOctree::Process()
m_mesh->m_octree->SetParameters(minDelta, maxDelta, eps);
if(m_config["udsfile"].beenSet)
if(m_config["refinement"].beenSet)
{
m_mesh->m_octree->UDS(m_config["udsfile"].as<string>());
m_mesh->m_octree->Refinement(m_config["refinement"].as<string>());
}
m_mesh->m_octree->Process();
......
......@@ -117,13 +117,22 @@ void InputCAD::ParseFile(string nm)
}
}
<<<<<<< HEAD
map<string, string>::iterator it;
=======
set<string>
set<string> refinement;
if(pSession->DefinesElement("NEKTAR/MESHING/REFINEMENT"))
{
TiXmlElement *refine = mcf->FirstChildElement("REFINEMENT");
TiXmlElement *L = refine->FirstChildElement("L");
while (L)
{
string tmp;
L->QueryStringAttribute("VALUE", &tmp);
refinement.insert(tmp);
L = L->NextSiblingElement("L");
}
}
map<string,string>::iterator it;
>>>>>>> start refinment lines
it = information.find("CADFile");
ASSERTL0(it != information.end(), "no cadfile defined");
......@@ -139,12 +148,6 @@ void InputCAD::ParseFile(string nm)
m_2D = true;
}
it = information.find("UDSFile");
if (it != information.end())
{
m_udsfile = it->second;
m_uds = true;
}
it = parameters.find("MinDelta");
ASSERTL0(it != parameters.end(), "no mindelta defined");
......@@ -187,6 +190,19 @@ void InputCAD::ParseFile(string nm)
m_surfopti = sit != boolparameters.end();
sit = boolparameters.find("WriteOctree");
m_woct = sit != boolparameters.end();
m_refine = refinement.size() > 0;
if(m_refine)
{
stringstream ss;
for(sit = refinement.begin(); sit != refinement.end(); sit++)
{
ss << *sit;
ss << ":";
}
m_refinement = ss.str();
m_refinement.erase(m_refinement.end()-1);
}
}
void InputCAD::Process()
......@@ -215,9 +231,9 @@ void InputCAD::Process()
mods.back()->RegisterConfig("mindel", m_minDelta);
mods.back()->RegisterConfig("maxdel", m_maxDelta);
mods.back()->RegisterConfig("eps", m_eps);
if (m_uds)
if (m_refine)
{
mods.back()->RegisterConfig("udsfile", m_udsfile);
mods.back()->RegisterConfig("refinement", m_refinement);
}
if (m_woct)
{
......
......@@ -62,8 +62,8 @@ public:
private:
std::string m_minDelta, m_maxDelta, m_eps, m_cadfile, m_order,
m_blsurfs, m_blthick, m_blprog, m_bllayers, m_udsfile;
bool m_makeBL, m_surfopti, m_uds, m_woct, m_2D, m_splitBL;
m_blsurfs, m_blthick, m_blprog, m_bllayers, m_refinement;
bool m_makeBL, m_surfopti, m_refine, m_woct, m_2D, m_splitBL;
};
}
......
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