Commit 52816be6 by Spencer Sherwin

Merge branch 'fix/isocontour-performance' into 'master'

fix/isocontour-performance

See merge request !821
2 parents 49ab3b77 f2dfde8c
......@@ -41,6 +41,8 @@ v4.4.2
**Library**
- Fix ability to set default implementation in Collections and added an option
to set eNoCollections in FieldConvert as default (!789)
- Fix performance issue in ProcessIsoContour in relation to memory consumption
(!821)
- Fix performance issue with ExtractPhysToBndElmt (!796)
**Utilities**
......
......@@ -406,6 +406,7 @@ vector<IsoSharedPtr> ProcessIsoContour::ExtractContour(
vector<Array<OneD, int> > ptsConn;
m_f->m_fieldPts->GetConnectivity(ptsConn);
for(int zone = 0; zone < ptsConn.size(); ++zone)
{
IsoSharedPtr iso;
......@@ -529,13 +530,18 @@ vector<IsoSharedPtr> ProcessIsoContour::ExtractContour(
}
}
}
iso->SetNTris(n);
// condense the information in this elemental extraction.
iso->Condense();
returnval.push_back(iso);
if(n)
{
iso->SetNTris(n);
// condense the information in this elemental extraction.
iso->Condense();
returnval.push_back(iso);
}
}
return returnval;
}
......@@ -871,7 +877,7 @@ void Iso::GlobalCondense(vector<IsoSharedPtr> &iso, bool verbose)
for(id1 = 0; id1 < result.size(); ++id1)
{
NekDouble dist = bg::distance(queryPoint, result[id1].first);
if(dist*dist<SQ_PNT_TOL) // same point
if(dist*dist < NekConstants::kNekZeroTol) // same point
{
id2 = result[id1].second;
samept.insert(id2);
......@@ -953,14 +959,14 @@ void Iso::GlobalCondense(vector<IsoSharedPtr> &iso, bool verbose)
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;
(x.m_z-y.m_z)*(x.m_z-y.m_z) < NekConstants::kNekZeroTol)? true:false;
}
// 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) +
(x.m_z-y.m_z)*(x.m_z-y.m_z) < SQ_PNT_TOL)? 0:1;
(x.m_z-y.m_z)*(x.m_z-y.m_z) < NekConstants::kNekZeroTol)? 0:1;
}
void Iso::Smooth(int n_iter, NekDouble lambda, NekDouble mu)
......
......@@ -44,8 +44,6 @@ namespace Nektar
namespace FieldUtils
{
const NekDouble SQ_PNT_TOL=1e-16;
class Iso
{
public:
......@@ -160,13 +158,13 @@ class Iso
m_condensed = false;
m_nvert = 0;
m_fields.resize(nfields);
// set up initial vectors to be 10000 long
m_x.resize(10000);
m_y.resize(10000);
m_z.resize(10000);
// set up initial vectors to be 1000 long
m_x.resize(1000);
m_y.resize(1000);
m_z.resize(1000);
for(int i = 0; i < m_fields.size(); ++i)
{
m_fields[i].resize(10000);
m_fields[i].resize(1000);
}
};
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!