本文整理汇总了C++中ARRAY::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ ARRAY::Get方法的具体用法?C++ ARRAY::Get怎么用?C++ ARRAY::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ARRAY
的用法示例。
在下文中一共展示了ARRAY::Get方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MeshVolume
MESHING3_RESULT MeshVolume (MeshingParameters & mp, Mesh& mesh3d)
{
int i, oldne;
PointIndex pi;
int meshed;
int cntsteps;
ARRAY<INDEX_2> connectednodes;
mesh3d.Compress();
// mesh3d.PrintMemInfo (cout);
if (mp.checkoverlappingboundary)
if (mesh3d.CheckOverlappingBoundary())
throw NgException ("Stop meshing since boundary mesh is overlapping");
int nonconsist = 0;
for (int k = 1; k <= mesh3d.GetNDomains(); k++)
{
PrintMessage (3, "Check subdomain ", k, " / ", mesh3d.GetNDomains());
mesh3d.FindOpenElements(k);
/*
bool res = mesh3d.CheckOverlappingBoundary();
if (res)
{
PrintError ("Surface is overlapping !!");
nonconsist = 1;
}
*/
bool res = (mesh3d.CheckConsistentBoundary() != 0);
if (res)
{
PrintError ("Surface mesh not consistent");
nonconsist = 1;
}
}
if (nonconsist)
{
PrintError ("Stop meshing since surface mesh not consistent");
throw NgException ("Stop meshing since surface mesh not consistent");
}
double globmaxh = mp.maxh;
for (int k = 1; k <= mesh3d.GetNDomains(); k++)
{
if (multithread.terminate)
break;
PrintMessage (2, "");
PrintMessage (1, "Meshing subdomain ", k, " of ", mesh3d.GetNDomains());
(*testout) << "Meshing subdomain " << k << endl;
mp.maxh = min2 (globmaxh, mesh3d.MaxHDomain(k));
mesh3d.CalcSurfacesOfNode();
mesh3d.FindOpenElements(k);
if (!mesh3d.GetNOpenElements())
continue;
Box<3> domain_bbox( Box<3>::EMPTY_BOX );
/*
Point<3> (1e10, 1e10, 1e10),
Point<3> (-1e10, -1e10, -1e10));
*/
for (SurfaceElementIndex sei = 0; sei < mesh3d.GetNSE(); sei++)
{
const Element2d & el = mesh3d[sei];
if (el.IsDeleted() ) continue;
if (mesh3d.GetFaceDescriptor(el.GetIndex()).DomainIn() == k ||
mesh3d.GetFaceDescriptor(el.GetIndex()).DomainOut() == k)
for (int j = 0; j < el.GetNP(); j++)
domain_bbox.Add (mesh3d[el[j]]);
}
domain_bbox.Increase (0.01 * domain_bbox.Diam());
for (int qstep = 1; qstep <= 3; qstep++)
{
if (mesh3d.HasOpenQuads())
{
string rulefile = ngdir;
const char ** rulep = NULL;
switch (qstep)
{
case 1:
//.........这里部分代码省略.........
示例2: c
void LocalH ::
FindInnerBoxesRec2 (GradingBox * box,
class AdFront3 * adfront,
ARRAY<Box3d> & faceboxes,
ARRAY<int> & faceinds, int nfinbox)
{
if (!box) return;
int i, j;
GradingBox * father = box -> father;
Point3d c(box->xmid[0], box->xmid[1], box->xmid[2]);
Vec3d v(box->h2, box->h2, box->h2);
Box3d boxc(c-v, c+v);
Point3d fc(father->xmid[0], father->xmid[1], father->xmid[2]);
Vec3d fv(father->h2, father->h2, father->h2);
Box3d fboxc(fc-fv, fc+fv);
Box3d boxcfc(c,fc);
static ARRAY<int> faceused;
static ARRAY<int> faceused2;
static ARRAY<int> facenotused;
faceused.SetSize(0);
facenotused.SetSize(0);
faceused2.SetSize(0);
for (j = 1; j <= nfinbox; j++)
{
// adfront->GetFaceBoundingBox (faceinds.Get(j), facebox);
const Box3d & facebox = faceboxes.Get(faceinds.Get(j));
if (boxc.Intersect (facebox))
faceused.Append(faceinds.Get(j));
else
facenotused.Append(faceinds.Get(j));
if (boxcfc.Intersect (facebox))
faceused2.Append (faceinds.Get(j));
}
for (j = 1; j <= faceused.Size(); j++)
faceinds.Elem(j) = faceused.Get(j);
for (j = 1; j <= facenotused.Size(); j++)
faceinds.Elem(j+faceused.Size()) = facenotused.Get(j);
if (!father->flags.cutboundary)
{
box->flags.isinner = father->flags.isinner;
box->flags.pinner = father->flags.pinner;
}
else
{
Point3d cf(father->xmid[0], father->xmid[1], father->xmid[2]);
if (father->flags.isinner)
box->flags.pinner = 1;
else
{
if (adfront->SameSide (c, cf, &faceused2))
box->flags.pinner = father->flags.pinner;
else
box->flags.pinner = 1 - father->flags.pinner;
}
if (box->flags.cutboundary)
box->flags.isinner = 0;
else
box->flags.isinner = box->flags.pinner;
}
int nf = faceused.Size();
for (i = 0; i < 8; i++)
FindInnerBoxesRec2 (box->childs[i], adfront, faceboxes, faceinds, nf);
}
示例3: GetOLimit
twoint GetOLimit(int i) const {return olimit->Get(i);}
示例4: GetILimit
twoint GetILimit(int i) const {return ilimit->Get(i);}
示例5: GetTrig
//get all trigs:
int GetTrig(int i) const
{
if (i <= charttrigs->Size()) {return charttrigs->Get(i);}
else {return outertrigs->Get(i-charttrigs->Size());}
}
示例6: GetOuterTrig
int GetOuterTrig(int i) const {return outertrigs->Get(i);}
示例7: GetChartTrig
int GetChartTrig(int i) const {return charttrigs->Get(i);}
示例8: GetSegment
const STLBoundarySeg & GetSegment(int i) {return boundary.Get(i);}
示例9: nel
void MeshOptimize2d :: GenericImprove (Mesh & mesh)
{
if (!faceindex)
{
if (writestatus)
PrintMessage (3, "Generic Improve");
for (faceindex = 1; faceindex <= mesh.GetNFD(); faceindex++)
GenericImprove (mesh);
faceindex = 0;
}
// int j, k, l, ri;
int np = mesh.GetNP();
int ne = mesh.GetNSE();
// SurfaceElementIndex sei;
// for (SurfaceElementIndex sei = 0; sei < ne; sei++)
// {
// const Element2d & el = mesh[sei];
// (*testout) << "element " << sei << ": " <<flush;
// for(int j=0; j<el.GetNP(); j++)
// (*testout) << el[j] << " " << flush;
// (*testout) << "IsDeleted() " << el.IsDeleted()<< endl;
// }
bool ok;
int olddef, newdef;
ARRAY<ImprovementRule*> rules;
ARRAY<SurfaceElementIndex> elmap;
ARRAY<int> elrot;
ARRAY<PointIndex> pmap;
ARRAY<PointGeomInfo> pgi;
int surfnr = mesh.GetFaceDescriptor (faceindex).SurfNr();
ImprovementRule * r1;
// 2 triangles to quad
r1 = new ImprovementRule;
r1->oldels.Append (Element2d (1, 2, 3));
r1->oldels.Append (Element2d (3, 2, 4));
r1->newels.Append (Element2d (1, 2, 4, 3));
r1->deledges.Append (INDEX_2 (2,3));
r1->onp = 4;
r1->bonus = 2;
rules.Append (r1);
// 2 quad to 1 quad
r1 = new ImprovementRule;
r1->oldels.Append (Element2d (1, 2, 3, 4));
r1->oldels.Append (Element2d (4, 3, 2, 5));
r1->newels.Append (Element2d (1, 2, 5, 4));
r1->deledges.Append (INDEX_2 (2, 3));
r1->deledges.Append (INDEX_2 (3, 4));
r1->onp = 5;
r1->bonus = 0;
rules.Append (r1);
// swap quads
r1 = new ImprovementRule;
r1->oldels.Append (Element2d (1, 2, 3, 4));
r1->oldels.Append (Element2d (3, 2, 5, 6));
r1->newels.Append (Element2d (1, 6, 3, 4));
r1->newels.Append (Element2d (1, 2, 5, 6));
r1->deledges.Append (INDEX_2 (2, 3));
r1->onp = 6;
r1->bonus = 0;
rules.Append (r1);
// three quads to 2
r1 = new ImprovementRule;
r1->oldels.Append (Element2d (1, 2, 3, 4));
r1->oldels.Append (Element2d (2, 5, 6, 3));
r1->oldels.Append (Element2d (3, 6, 7, 4));
r1->newels.Append (Element2d (1, 2, 5, 4));
r1->newels.Append (Element2d (4, 5, 6, 7));
r1->deledges.Append (INDEX_2 (2, 3));
r1->deledges.Append (INDEX_2 (3, 4));
r1->deledges.Append (INDEX_2 (3, 6));
r1->onp = 7;
r1->bonus = -1;
rules.Append (r1);
// quad + 2 connected trigs to quad
r1 = new ImprovementRule;
r1->oldels.Append (Element2d (1, 2, 3, 4));
r1->oldels.Append (Element2d (2, 5, 3));
r1->oldels.Append (Element2d (3, 5, 4));
r1->newels.Append (Element2d (1, 2, 5, 4));
r1->deledges.Append (INDEX_2 (2, 3));
r1->deledges.Append (INDEX_2 (3, 4));
r1->deledges.Append (INDEX_2 (3, 5));
r1->onp = 5;
r1->bonus = 0;
rules.Append (r1);
//.........这里部分代码省略.........