Commit 86821067 authored by Michael Turner's avatar Michael Turner

merge master

parents fdac6d1c 689f5dd8
......@@ -55,6 +55,7 @@ v4.4.0
- Allow equi-spaced output for 1D and 2DH1D fields (!613)
- Update quality metric to include scaled Jacobian output (!695)
- Allow multiple XML files to be specified in InterpField module (!705)
- Fix issues with isocontour module (!719)
**NekMesh:**
- Modify curve module to allow for spline input (!628)
......@@ -76,6 +77,7 @@ v4.4.0
- Bug fix to get two meshgen regression tests working (!700)
- Remove libANN in deference to boost::geometry (!703)
- Refactor library to use NekMesh modules for CAD generation (!704)
- Add `varopti` process module to optimise meshes (!711)
- Add a mesh extract option to the linearise module to visualise the result
(!712)
- 2D to 3D mesh extrusion module (!715)
......
......@@ -107,8 +107,9 @@ void InputDat::Process(po::variables_map &vm)
while (!datFile.eof())
{
getline(datFile, line);
if (line.find("VARIABLES") != string::npos)
string linetest = line;
boost::to_upper(linetest);
if (linetest.find("VARIABLES") != string::npos)
{
std::size_t pos = line.find('=');
pos++;
......@@ -138,10 +139,9 @@ void InputDat::Process(po::variables_map &vm)
while (!datFile.eof())
{
getline(datFile, line);
if ((line.find("ZONE") != string::npos) ||
(line.find("Zone") != string::npos) ||
(line.find("zone") != string::npos))
string linetest = line;
boost::to_upper(linetest);
if ((linetest.find("ZONE") != string::npos))
{
ReadTecplotFEBlockZone(datFile, line, pts, ptsConn);
}
......
......@@ -795,16 +795,20 @@ void OutputTecplot::WriteTecplotConnectivity(std::ofstream &outfile)
}
else
{
int cnt = 1;
for (int i = 0; i < m_conn.size(); ++i)
{
const int nConn = m_conn[i].num_elements();
for (int j = 0; j < nConn; ++j)
for (int j = 0; j < nConn; ++j,++cnt)
{
outfile << m_conn[i][j] + 1 << " ";
if (!(cnt % 1000))
{
outfile << std::endl;
}
}
outfile << endl;
}
outfile << endl;
if (m_oneOutputFile && m_f->m_comm->GetRank() == 0)
{
......@@ -814,7 +818,6 @@ void OutputTecplot::WriteTecplotConnectivity(std::ofstream &outfile)
{
Array<OneD, int> conn(m_rankConnSizes[n]);
m_f->m_comm->Recv(n, conn);
for (int j = 0; j < conn.num_elements(); ++j)
{
outfile << conn[j] + offset + 1 << " ";
......
......@@ -131,6 +131,11 @@ void ProcessIsoContour::Process(po::variables_map &vm)
if(m_f->m_fieldPts.get()) // assume we have read .dat file to directly input dat file.
{
if(rank == 0)
{
cout << "Process read iso from Field Pts" << endl;
}
SetupIsoFromFieldPts(iso);
}
else // extract isocontour from field
......@@ -196,6 +201,10 @@ void ProcessIsoContour::Process(po::variables_map &vm)
bool globalcondense = m_config["globalcondense"].m_beenSet;
if(globalcondense)
{
if(rank == 0)
{
cout << "Process global condense ..." << endl;
}
int nfields = m_f->m_fieldPts->GetNFields() + m_f->m_fieldPts->GetDim();
IsoSharedPtr g_iso = MemoryManager<Iso>::AllocateSharedPtr(nfields-3);
......@@ -832,13 +841,21 @@ void Iso::GlobalCondense(vector<IsoSharedPtr> &iso, bool verbose)
{
for(id1 = 0; id1 < iso[i]->m_nvert; ++id1)
{
inPoints.push_back(PointPair(BPoint( iso[i]->m_x[id1], iso[i]->m_y[id1], iso[i]->m_z[id1]), id2));
inPoints.push_back(PointPair(BPoint( iso[i]->m_x[id1],
iso[i]->m_y[id1],
iso[i]->m_z[id1]), id2));
global_to_unique_map[id2]=id2;
global_to_iso_map[id2] = make_pair(i,id1);
id2++;
}
}
if(verbose)
{
cout << "Process building tree ..." << endl;
}
//Build tree
bgi::rtree<PointPair, bgi::rstar<16> > rtree;
rtree.insert(inPoints.begin(), inPoints.end());
......@@ -851,49 +868,58 @@ void Iso::GlobalCondense(vector<IsoSharedPtr> &iso, bool verbose)
{
if(verbose)
{
prog = LibUtilities::PrintProgressbar(i,m_nvert,"Nearest verts",prog);
prog = LibUtilities::PrintProgressbar(i,m_nvert,
"Nearest verts",prog);
}
BPoint queryPoint = inPoints[i].first;
// find points within the distance box
std::vector<PointPair> result;
rtree.query(bgi::nearest(queryPoint, 100), std::back_inserter(result));
WARNINGL1(result.size() < 100,"Failed to find less than 100 neighbouring points");
id1 = 0;
unique_index_found = false;
int nptsfound = 0;
WARNINGL1(result.size() > 0,"Failed to find any nearest point");
for(id1 = 0; id1 < result.size(); ++id1)
// check to see if point has been already reset to lower than
// unique value
if(global_to_unique_map[i] < unique_index) // do nothing
{
}
else
{
if(bg::distance(queryPoint, result[id1].first)<SQ_PNT_TOL)
// find nearest 10 points within the distance box
std::vector<PointPair> result;
rtree.query(bgi::nearest(queryPoint, 10), std::back_inserter(result));
//see if any values have unique value already
set<int> samept;
set<int>::iterator it;
int new_index = -1;
for(id1 = 0; id1 < result.size(); ++id1)
{
id2 = result[id1].second;
nptsfound ++;
if(global_to_unique_map[id2] <unique_index)
NekDouble dist = bg::distance(queryPoint, result[id1].first);
if(dist*dist<SQ_PNT_TOL) // same point
{
// point has already been defined
continue;
}
else
{
global_to_unique_map[id2] = unique_index;
unique_index_found = true;
id2 = result[id1].second;
samept.insert(id2);
if(global_to_unique_map[id2] <unique_index)
{
new_index = global_to_unique_map[id2];
}
}
}
}
WARNINGL1(nptsfound > 0,"Failed to find any nearest point");
if(new_index == -1)
{
new_index = unique_index;
unique_index++;
}
if(unique_index_found)
{
unique_index++;
// reset all same values to new_index
global_to_unique_map[i] = new_index;
for(it = samept.begin(); it != samept.end(); ++it)
{
global_to_unique_map[*it] = new_index;
}
}
}
if(verbose)
{
cout << endl;
......@@ -946,14 +972,14 @@ void Iso::GlobalCondense(vector<IsoSharedPtr> &iso, bool verbose)
}
// define == if point is within 1e-4
// define == if point is within 1e-8
bool operator == (const IsoVertex& x, const IsoVertex& y)
{
return ((x.m_x-y.m_x)*(x.m_x-y.m_x) + (x.m_y-y.m_y)*(x.m_y-y.m_y) +
(x.m_z-y.m_z)*(x.m_z-y.m_z) < SQ_PNT_TOL)? true:false;
}
// define != if point is outside 1e-4
// define != if point is outside 1e-8
bool operator != (const IsoVertex& x, const IsoVertex& y)
{
return ((x.m_x-y.m_x)*(x.m_x-y.m_x) + (x.m_y-y.m_y)*(x.m_y-y.m_y) +
......
......@@ -53,7 +53,7 @@ namespace Nektar
namespace FieldUtils
{
const NekDouble SQ_PNT_TOL=1e-6;
const NekDouble SQ_PNT_TOL=1e-16;
class Iso
{
......
......@@ -296,7 +296,7 @@ inline vector<DNekMat> MappingIdealToRef(SpatialDomains::GeometrySharedPtr geom,
}
}
}
else if(geom->GetShapeType() == LibUtilities::eHexahedron)
else if (geom->GetShapeType() == LibUtilities::eHexahedron)
{
vector<Array<OneD, NekDouble> > xyz;
for (int i = 0; i < geom->GetNumVerts(); i++)
......@@ -318,53 +318,62 @@ inline vector<DNekMat> MappingIdealToRef(SpatialDomains::GeometrySharedPtr geom,
{
for (int i = 0; i < b[0]->GetNumPoints(); i++)
{
NekDouble a1 = 0.5 * (1 - eta1[i]);
NekDouble a2 = 0.5 * (1 + eta1[i]);
NekDouble b1 = 0.5 * (1 - eta2[j]),
b2 = 0.5 * (1 + eta2[j]);
NekDouble c1 = 0.5 * (1 - eta3[k]),
c2 = 0.5 * (1 + eta3[k]);
NekDouble a1 = 0.5 * (1 - eta1[i]);
NekDouble a2 = 0.5 * (1 + eta1[i]);
NekDouble b1 = 0.5 * (1 - eta2[j]),
b2 = 0.5 * (1 + eta2[j]);
NekDouble c1 = 0.5 * (1 - eta3[k]),
c2 = 0.5 * (1 + eta3[k]);
DNekMat dxdz(3, 3, 1.0, eFULL);
dxdz(0,0) = - 0.5 * b1 * c1 * xyz[0][0] + 0.5 * b1 * c1 * xyz[1][0]
+ 0.5 * b2 * c1 * xyz[2][0] - 0.5 * b2 * c1 * xyz[3][0]
- 0.5 * b1 * c2 * xyz[5][0] + 0.5 * b1 * c2 * xyz[5][0]
+ 0.5 * b2 * c2 * xyz[6][0] - 0.5 * b2 * c2 * xyz[7][0];
dxdz(1,0) = - 0.5 * b1 * c1 * xyz[0][1] + 0.5 * b1 * c1 * xyz[1][1]
+ 0.5 * b2 * c1 * xyz[2][1] - 0.5 * b2 * c1 * xyz[3][1]
- 0.5 * b1 * c2 * xyz[5][1] + 0.5 * b1 * c2 * xyz[5][1]
+ 0.5 * b2 * c2 * xyz[6][1] - 0.5 * b2 * c2 * xyz[7][1];
dxdz(2,0) = - 0.5 * b1 * c1 * xyz[0][2] + 0.5 * b1 * c1 * xyz[1][2]
+ 0.5 * b2 * c1 * xyz[2][2] - 0.5 * b2 * c1 * xyz[3][2]
- 0.5 * b1 * c2 * xyz[5][2] + 0.5 * b1 * c2 * xyz[5][2]
+ 0.5 * b2 * c2 * xyz[6][2] - 0.5 * b2 * c2 * xyz[7][2];
dxdz(0,1) = - 0.5 * a1 * c1 * xyz[0][0] - 0.5 * a2 * c1 * xyz[1][0]
+ 0.5 * a2 * c1 * xyz[2][0] + 0.5 * a1 * c1 * xyz[3][0]
- 0.5 * a1 * c2 * xyz[5][0] - 0.5 * a2 * c2 * xyz[5][0]
+ 0.5 * a2 * c2 * xyz[6][0] + 0.5 * a1 * c2 * xyz[7][0];
dxdz(1,1) = - 0.5 * a1 * c1 * xyz[0][1] - 0.5 * a2 * c1 * xyz[1][1]
+ 0.5 * a2 * c1 * xyz[2][1] + 0.5 * a1 * c1 * xyz[3][1]
- 0.5 * a1 * c2 * xyz[5][1] - 0.5 * a2 * c2 * xyz[5][1]
+ 0.5 * a2 * c2 * xyz[6][1] + 0.5 * a1 * c2 * xyz[7][1];
dxdz(2,1) = - 0.5 * a1 * c1 * xyz[0][2] - 0.5 * a2 * c1 * xyz[1][2]
+ 0.5 * a2 * c1 * xyz[2][2] + 0.5 * a1 * c1 * xyz[3][2]
- 0.5 * a1 * c2 * xyz[5][2] - 0.5 * a2 * c2 * xyz[5][2]
+ 0.5 * a2 * c2 * xyz[6][2] + 0.5 * a1 * c2 * xyz[7][2];
dxdz(0,0) = - 0.5 * b1 * a1 * xyz[0][0] - 0.5 * b1 * a2 * xyz[1][0]
- 0.5 * b2 * a2 * xyz[2][0] - 0.5 * b2 * a1 * xyz[3][0]
+ 0.5 * b1 * a1 * xyz[5][0] + 0.5 * b1 * a2 * xyz[5][0]
+ 0.5 * b2 * a2 * xyz[6][0] + 0.5 * b2 * a1 * xyz[7][0];
dxdz(1,0) = - 0.5 * b1 * a1 * xyz[0][1] - 0.5 * b1 * a2 * xyz[1][1]
- 0.5 * b2 * a2 * xyz[2][1] - 0.5 * b2 * a1 * xyz[3][1]
+ 0.5 * b1 * a1 * xyz[5][1] + 0.5 * b1 * a2 * xyz[5][1]
+ 0.5 * b2 * a2 * xyz[6][1] + 0.5 * b2 * a1 * xyz[7][1];
dxdz(2,0) = - 0.5 * b1 * a1 * xyz[0][2] - 0.5 * b1 * a2 * xyz[1][2]
- 0.5 * b2 * a2 * xyz[2][2] - 0.5 * b2 * a1 * xyz[3][2]
+ 0.5 * b1 * a1 * xyz[5][2] + 0.5 * b1 * a2 * xyz[5][2]
+ 0.5 * b2 * a2 * xyz[6][2] + 0.5 * b2 * a1 * xyz[7][2];
dxdz(0, 0) =
-0.5 * b1 * c1 * xyz[0][0] + 0.5 * b1 * c1 * xyz[1][0] +
0.5 * b2 * c1 * xyz[2][0] - 0.5 * b2 * c1 * xyz[3][0] -
0.5 * b1 * c2 * xyz[5][0] + 0.5 * b1 * c2 * xyz[5][0] +
0.5 * b2 * c2 * xyz[6][0] - 0.5 * b2 * c2 * xyz[7][0];
dxdz(1, 0) =
-0.5 * b1 * c1 * xyz[0][1] + 0.5 * b1 * c1 * xyz[1][1] +
0.5 * b2 * c1 * xyz[2][1] - 0.5 * b2 * c1 * xyz[3][1] -
0.5 * b1 * c2 * xyz[5][1] + 0.5 * b1 * c2 * xyz[5][1] +
0.5 * b2 * c2 * xyz[6][1] - 0.5 * b2 * c2 * xyz[7][1];
dxdz(2, 0) =
-0.5 * b1 * c1 * xyz[0][2] + 0.5 * b1 * c1 * xyz[1][2] +
0.5 * b2 * c1 * xyz[2][2] - 0.5 * b2 * c1 * xyz[3][2] -
0.5 * b1 * c2 * xyz[5][2] + 0.5 * b1 * c2 * xyz[5][2] +
0.5 * b2 * c2 * xyz[6][2] - 0.5 * b2 * c2 * xyz[7][2];
dxdz(0, 1) =
-0.5 * a1 * c1 * xyz[0][0] - 0.5 * a2 * c1 * xyz[1][0] +
0.5 * a2 * c1 * xyz[2][0] + 0.5 * a1 * c1 * xyz[3][0] -
0.5 * a1 * c2 * xyz[5][0] - 0.5 * a2 * c2 * xyz[5][0] +
0.5 * a2 * c2 * xyz[6][0] + 0.5 * a1 * c2 * xyz[7][0];
dxdz(1, 1) =
-0.5 * a1 * c1 * xyz[0][1] - 0.5 * a2 * c1 * xyz[1][1] +
0.5 * a2 * c1 * xyz[2][1] + 0.5 * a1 * c1 * xyz[3][1] -
0.5 * a1 * c2 * xyz[5][1] - 0.5 * a2 * c2 * xyz[5][1] +
0.5 * a2 * c2 * xyz[6][1] + 0.5 * a1 * c2 * xyz[7][1];
dxdz(2, 1) =
-0.5 * a1 * c1 * xyz[0][2] - 0.5 * a2 * c1 * xyz[1][2] +
0.5 * a2 * c1 * xyz[2][2] + 0.5 * a1 * c1 * xyz[3][2] -
0.5 * a1 * c2 * xyz[5][2] - 0.5 * a2 * c2 * xyz[5][2] +
0.5 * a2 * c2 * xyz[6][2] + 0.5 * a1 * c2 * xyz[7][2];
dxdz(0, 0) =
-0.5 * b1 * a1 * xyz[0][0] - 0.5 * b1 * a2 * xyz[1][0] -
0.5 * b2 * a2 * xyz[2][0] - 0.5 * b2 * a1 * xyz[3][0] +
0.5 * b1 * a1 * xyz[5][0] + 0.5 * b1 * a2 * xyz[5][0] +
0.5 * b2 * a2 * xyz[6][0] + 0.5 * b2 * a1 * xyz[7][0];
dxdz(1, 0) =
-0.5 * b1 * a1 * xyz[0][1] - 0.5 * b1 * a2 * xyz[1][1] -
0.5 * b2 * a2 * xyz[2][1] - 0.5 * b2 * a1 * xyz[3][1] +
0.5 * b1 * a1 * xyz[5][1] + 0.5 * b1 * a2 * xyz[5][1] +
0.5 * b2 * a2 * xyz[6][1] + 0.5 * b2 * a1 * xyz[7][1];
dxdz(2, 0) =
-0.5 * b1 * a1 * xyz[0][2] - 0.5 * b1 * a2 * xyz[1][2] -
0.5 * b2 * a2 * xyz[2][2] - 0.5 * b2 * a1 * xyz[3][2] +
0.5 * b1 * a1 * xyz[5][2] + 0.5 * b1 * a2 * xyz[5][2] +
0.5 * b2 * a2 * xyz[6][2] + 0.5 * b2 * a1 * xyz[7][2];
dxdz.Invert();
ret.push_back(dxdz);
......@@ -380,7 +389,9 @@ inline vector<DNekMat> MappingIdealToRef(SpatialDomains::GeometrySharedPtr geom,
return ret;
}
Array<OneD, NekDouble> ProcessQualityMetric::GetQ(LocalRegions::ExpansionSharedPtr e, bool s)
Array<OneD, NekDouble> ProcessQualityMetric::GetQ(
LocalRegions::ExpansionSharedPtr e,
bool s)
{
SpatialDomains::GeometrySharedPtr geom = e->GetGeom();
StdRegions::StdExpansionSharedPtr chi = e->GetGeom()->GetXmap();
......
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: NodalHexElec
// Description: Nodal hexahedron with 3D GLL distribution
//
///////////////////////////////////////////////////////////////////////////////
......@@ -55,7 +55,7 @@ void NodalHexElec::CalculatePoints()
for (int i = 0; i < 3; i++)
{
m_points[i] = Array<OneD, DataType>(numPoints*numPoints*numPoints);
m_points[i] = Array<OneD, DataType>(numPoints * numPoints * numPoints);
}
for (int k = 0, ct = 0; k < numPoints; k++)
......@@ -76,7 +76,7 @@ void NodalHexElec::CalculateWeights()
{
unsigned int numPoints = GetNumPoints();
m_weights = Array<OneD, DataType>(numPoints*numPoints*numPoints);
m_weights = Array<OneD, DataType>(numPoints * numPoints * numPoints);
for (int k = 0, ct = 0; k < numPoints; k++)
{
......@@ -101,6 +101,5 @@ boost::shared_ptr<PointsBaseType> NodalHexElec::Create(const PointsKey &key)
returnval->Initialize();
return returnval;
}
}
}
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: NodalHexElec
// Description: Nodal hexahedron with 3D GLL distribution
//
///////////////////////////////////////////////////////////////////////////////
......@@ -67,7 +67,10 @@ private:
{
}
Array<OneD, NekDouble> m_e0, m_ew;
/// 1D GLL points.
Array<OneD, NekDouble> m_e0;
/// 1D GLL weights.
Array<OneD, NekDouble> m_ew;
void CalculatePoints();
void CalculateWeights();
......
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: NodalQuadElec
// Description: Nodal quadrilateral with 2D GLL distribution
//
///////////////////////////////////////////////////////////////////////////////
......@@ -55,7 +55,7 @@ void NodalQuadElec::CalculatePoints()
for (int i = 0; i < 2; i++)
{
m_points[i] = Array<OneD, DataType>(numPoints*numPoints);
m_points[i] = Array<OneD, DataType>(numPoints * numPoints);
}
for (int j = 0, ct = 0; j < numPoints; j++)
......@@ -72,7 +72,7 @@ void NodalQuadElec::CalculateWeights()
{
unsigned int numPoints = GetNumPoints();
m_weights = Array<OneD, DataType>(numPoints*numPoints);
m_weights = Array<OneD, DataType>(numPoints * numPoints);
for (int j = 0, ct = 0; j < numPoints; j++)
{
......@@ -94,6 +94,5 @@ boost::shared_ptr<PointsBaseType> NodalQuadElec::Create(const PointsKey &key)
returnval->Initialize();
return returnval;
}
}
}
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: NodalQuadElec
// Description: Nodal quadrilateral with 2D GLL distribution
//
///////////////////////////////////////////////////////////////////////////////
......@@ -67,7 +67,10 @@ private:
{
}
Array<OneD, NekDouble> m_e0, m_ew;
/// 1D GLL points
Array<OneD, NekDouble> m_e0;
/// 1D GLL weights
Array<OneD, NekDouble> m_ew;
void CalculatePoints();
void CalculateWeights();
......
......@@ -229,7 +229,8 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoop> e)
for(it = m_nodesToEdge.begin(); it != m_nodesToEdge.end(); it++)
{
Array<OneD, NekDouble> n(3);
ASSERTL0(it->second.size()==2,"weridness, most likely bl_surfs are incorrect");
ASSERTL0(it->second.size() == 2,
"wierdness, most likely bl_surfs are incorrect");
Array<OneD, NekDouble> n1 = edgeNormals[it->second[0]->m_id];
Array<OneD, NekDouble> n2 = edgeNormals[it->second[1]->m_id];
......@@ -243,7 +244,8 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoop> e)
n[1] = n[1] * m_thickness + it->first->m_y;
n[2] = 0.0;
NodeSharedPtr nn = boost::shared_ptr<Node>(new Node(m_mesh->m_numNodes++,n[0],n[1],0.0));
NodeSharedPtr nn = boost::shared_ptr<Node>(
new Node(m_mesh->m_numNodes++, n[0], n[1], 0.0));
CADSurfSharedPtr s = m_mesh->m_cad->GetSurf(faceid);
Array<OneD, NekDouble> uv = s->locuv(n);
nn->SetCADSurf(faceid,s,uv);
......
......@@ -112,8 +112,8 @@ bool CADSystemOCE::LoadCAD()
}
}
map<int, vector<int> > adjsurfmap; // from id of curve to list of ids of
// surfs
// from id of curve to list of ids of surfs
map<int, vector<int> > adjsurfmap;
// Adds edges to our type and map
for (int i = 1; i <= mapOfEdges.Extent(); i++)
......@@ -391,7 +391,8 @@ TopoDS_Shape CADSystemOCE::BuildNACA(string naca)
}
else
{
yc[i] = M / (1.0 - P) / (1.0 - P) * (1.0 - 2.0 * P + 2.0 * P * xc[i] - xc[i] * xc[i]);
yc[i] = M / (1.0 - P) / (1.0 - P) * (
1.0 - 2.0 * P + 2.0 * P * xc[i] - xc[i] * xc[i]);
dyc[i] = 2.0 * M / (1.0 - P) / (1.0 - P) * (P - xc[i]);
}
}
......@@ -436,7 +437,9 @@ TopoDS_Shape CADSystemOCE::BuildNACA(string naca)
BRepBuilderAPI_MakeEdge areoEdgeBuilder(curve);
TopoDS_Edge aeroEdge = areoEdgeBuilder.Edge();
BRepBuilderAPI_MakeEdge aeroTEBuilder(gp_Pnt(x[0]*1000.0,y[0]*1000.0,0.0), gp_Pnt(x[2*np-2]*1000.0,y[2*np-2]*1000.0,0.0));
BRepBuilderAPI_MakeEdge aeroTEBuilder(
gp_Pnt(x[0]*1000.0, y[0]*1000.0, 0.0),
gp_Pnt(x[2*np-2]*1000.0, y[2*np-2]*1000.0, 0.0));
TopoDS_Edge TeEdge = aeroTEBuilder.Edge();
BRepBuilderAPI_MakeWire aeroWireBuilder(aeroEdge, TeEdge);
......@@ -459,6 +462,7 @@ TopoDS_Shape CADSystemOCE::BuildNACA(string naca)
BRepBuilderAPI_MakeEdge domOutBuilder(gp_Pnt(data[2]*1000.0,data[3]*1000.0,0.0),
gp_Pnt(data[2]*1000.0,data[1]*1000.0,0.0));
TopoDS_Edge outEdge = domOutBuilder.Edge();
BRepBuilderAPI_MakeEdge domBotBuilder(gp_Pnt(data[2]*1000.0,data[1]*1000.0,0.0),
gp_Pnt(data[0]*1000.0,data[1]*1000.0,0.0));
TopoDS_Edge botEdge = domBotBuilder.Edge();
......
......@@ -125,7 +125,8 @@ void Mesh::MakeOrder(int order,
{
pTypes[LibUtilities::eSegment] = LibUtilities::eGaussLobattoLegendre;
pTypes[LibUtilities::eTriangle] = LibUtilities::eNodalTriElec;
pTypes[LibUtilities::eQuadrilateral] = LibUtilities::eGaussLobattoLegendre;
pTypes[LibUtilities::eQuadrilateral] =
LibUtilities::eGaussLobattoLegendre;
pTypes[LibUtilities::ePrism] = LibUtilities::eNodalPrismElec;
pTypes[LibUtilities::eTetrahedron] = LibUtilities::eNodalTetElec;
pTypes[LibUtilities::eHexahedron] = LibUtilities::eGaussLobattoLegendre;
......@@ -165,15 +166,15 @@ void Mesh::MakeOrder(int order,
boost::unordered_set<int> processedEdges, processedFaces, processedVolumes;
//note if CAD previously existed on the face or edge, the new points need
//to be projected onto the CAD entity.
// note if CAD previously existed on the face or edge, the new points need
// to be projected onto the CAD entity.
// Call MakeOrder with our generated geometries on each edge to fill in edge
// interior nodes.
int ct = 0;
for(eit = m_edgeSet.begin(); eit != m_edgeSet.end(); eit++, ct++)
for (eit = m_edgeSet.begin(); eit != m_edgeSet.end(); eit++, ct++)
{
if(m_verbose)
if (m_verbose)
{
LibUtilities::PrintProgressbar(
ct, m_edgeSet.size(), "MakeOrder: Edges: ");
......@@ -193,9 +194,9 @@ void Mesh::MakeOrder(int order,
// Call MakeOrder with our generated geometries on each face to fill in face
// interior nodes.
ct = 0;
for(fit = m_faceSet.begin(); fit != m_faceSet.end(); fit++, ct++)
for (fit = m_faceSet.begin(); fit != m_faceSet.end(); fit++, ct++)
{
if(m_verbose)
if (m_verbose)
{
LibUtilities::PrintProgressbar(
ct, m_faceSet.size(), "MakeOrder: Faces: ");
......@@ -251,18 +252,19 @@ void Mesh::MakeOrder(int order,
const int nElmt = m_element[m_expDim].size();
for (int i = 0; i < nElmt; ++i)
{
if(m_verbose)
if (m_verbose)
{
LibUtilities::PrintProgressbar(
i, nElmt, "MakeOrder: Elements: ");
LibUtilities::PrintProgressbar(i, nElmt, "MakeOrder: Elements: ");
}
ElementSharedPtr el = m_element[m_expDim][i];
el->MakeOrder(order, volGeoms[el->GetId()], pTypes[el->GetConf().m_e],
m_spaceDim, id);
}
if(m_verbose)
if (m_verbose)
{
cout << endl;
}
}
}
......
......@@ -28,6 +28,7 @@ ADD_NEKTAR_TEST(outflow_pointdatatofld)
ADD_NEKTAR_TEST(chan3D_equispacedoutput)
ADD_NEKTAR_TEST(chan3D_isocontour)
ADD_NEKTAR_TEST(naca0012_bnd_equispacedoutput)
ADD_NEKTAR_TEST(smallmesh_isocontour)
IF (NEKTAR_USE_MPI)
ADD_NEKTAR_TEST(chan3D_tec_par)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<test>
<description> Extract an isocontour</description>
<executable>FieldConvert</executable>
<parameters>-e -n6 -m isocontour:fieldstr="p":fieldvalue=0.1:globalcondense:smooth smallmesh.xml smallmesh.fld iso.dat</parameters>
<files>
<file description="Session File">smallmesh.xml</file>
<file description="Session File">smallmesh.fld</file>
</files>
<metrics>
<metric type="L2" id="1">
<value variable="x" tolerance="1e-4">0.644241</value>
<value variable="y" tolerance="1e-4">0.450692</value>
<value variable="z" tolerance="1e-4">0.434032</value>
<value variable="u" tolerance="1e-4">0.901556</value>
<value variable="v" tolerance="1e-4">0.101557</value>
<value variable="w" tolerance="1e-4">0.0892263</value>
<value variable="p" tolerance="1e-4">0.1</value>
<value variable="isocon" tolerance="1e-4">0.1</value>
</metric>
</metrics>
</test>
////////////////////////////////////////////////////////////////////////////////
//
// File: ProcessJac.h
// File: Hessian.hxx
//
// For more information, please see: http://www.nektar.info/
//
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Calculate jacobians of elements.
// Description: Utility functions for Hessian matrices
//
////////////////////////////////////////////////////////////////////////////////
......@@ -41,45 +41,47 @@ namespace Nektar
namespace Utilities
{
//returns zero if hessian is good, 1 if indefinite
template<int DIM> int NodeOpti::IsIndefinite()
/**
* @brief Returns 1 if Hessian matrix is indefinite and 0 otherwise.
*