本文整理汇总了C++中point::z方法的典型用法代码示例。如果您正苦于以下问题:C++ point::z方法的具体用法?C++ point::z怎么用?C++ point::z使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类point
的用法示例。
在下文中一共展示了point::z方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
scalar arakawaKonorStripesTracerField::tracerAt
(
const point& p,
const Time& t
) const
{
scalar x = p.x() - xOffset;
if (mag(x) <= wavelength / 2)
{
if (p.z() >= z1Start - 1 && p.z() <= z1End - 1)
{
return -rho0*Foam::sin(2*M_PI*x/wavelength);
}
else if (p.z() >= z2Start - 1 && p.z() <= z2End - 1)
{
return rho0*Foam::sin(2*M_PI*x/wavelength);
}
else
{
return 0;
}
}
else
{
return 0;
}
}
示例2: mag
bool Foam::octreeDataBoundBox::findTightest
(
const label index,
const point& sample,
treeBoundBox& tightest
) const
{
// Get furthest away vertex
point myNear, myFar;
allBb_[index].calcExtremities(sample, myNear, myFar);
const point dist = myFar - sample;
scalar myFarDist = mag(dist);
point tightestNear, tightestFar;
tightest.calcExtremities(sample, tightestNear, tightestFar);
scalar tightestFarDist = mag(tightestFar - sample);
if (tightestFarDist < myFarDist)
{
// Keep current tightest.
return false;
}
else
{
// Construct bb around sample and myFar
const point dist2(fabs(dist.x()), fabs(dist.y()), fabs(dist.z()));
tightest.min() = sample - dist2;
tightest.max() = sample + dist2;
return true;
}
}
示例3: unitNormal
vector horizontalVelocityField::streamfunctionAt
(
const point& p,
const Time& t
) const
{
const vector unitNormal(0, -1, 0);
const dimensionedScalar z("z", dimLength, p.z());
dimensionedScalar psi("psi", cmptMultiply(dimVelocity, dimLength), scalar(0));
if (z.value() <= z1.value())
{
// psi is zero
}
else if (z.value() <= z2.value())
{
psi = -0.5*u0*(z - z1 - (z2-z1)/M_PI*Foam::sin(M_PI*(z-z1)/(z2-z1)));
}
else
{
psi = -0.5*u0*(2*z - z2 - z1);
}
return unitNormal * psi.value();
}
示例4:
Foam::point Foam::scaleSearchableSurface::inverseTransform(const point &p) const
{
return point
(
p.x()/scale_.x(),
p.y()/scale_.y(),
p.z()/scale_.z()
);
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Breeder1.7-libraries-swak4Foam,代码行数:9,代码来源:scaleSearchableSurface.C
示例5: z
point horizontalVelocityField::initialPositionOf
(
const point& p,
const Time& t
) const
{
const dimensionedScalar z("z", dimLength, p.z());
if (z.value() <= z1.value())
{
return p;
}
else if (z.value() <= z2.value())
{
return point(p.x() - (u0*sqr(Foam::sin(0.5*M_PI*(z-z1)/(z2-z1)))*t).value(), p.y(), p.z());
}
else
{
return point(p.x() - u0.value()*t.value(), p.y(), p.z());
}
}
示例6: stringify
std::string stringify(point p)
{
std::stringstream ss;
ss << "#<point:";
ss << " x=";
ss << p.x();
ss << " y=";
ss << p.y();
ss << " z=";
ss << p.z();
ss << ">";
return ss.str();
}
示例7: forAll
forAll(order, sortI)
{
label pointI = order[sortI];
// Convert to scalar precision
const point pt
(
scalar(d[pointI].x()),
scalar(d[pointI].y()),
scalar(d[pointI].z())
);
sortedTol[sortI] = 2*mergeTol*(mag(pt.x())+mag(pt.y())+mag(pt.z()));
}
示例8:
void Foam::surfaceIntersection::writeOBJ(const point& pt, Ostream& os)
{
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
}
示例9:
void Foam::coupledPolyPatch::writeOBJ(Ostream& os, const point& pt)
{
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
}
示例10: in_range
bool in_range(point p, point min, point max)
{
return (min.x() <= p.x() && p.x() <= max.x() &&
min.y() <= p.y() && p.y() <= max.y() &&
min.z() <= p.z() && p.z() <= max.z());
}
示例11: intersectsObject
bool lineRefinement::intersectsObject(const boundBox& bb) const
{
//- check if the cube contains start point or end point
const scalar l = bb.max().x() - bb.min().x();
const point min = bb.min() - l * vector(SMALL, SMALL, SMALL);
const point max = bb.max() + l * vector(SMALL, SMALL, SMALL);
//- check for intersections of line with the cube faces
const vector v(p1_ - p0_);
if( mag(v.x()) > SMALL )
{
if(
((p0_.x() < min.x()) && (p1_.x() < min.x())) ||
((p0_.x() > max.x()) && (p1_.x() > max.x()))
)
return false;
{
//- x-min face
const vector n(-1, 0, 0);
const scalar t = (n & (min - p0_)) / (n & v);
const point i = p0_ + t * v;
if(
(t > -SMALL) && (t < (1.0+SMALL))
)
if(
(i.y() > min.y()) && (i.y() < max.y()) &&
(i.z() > min.z()) && (i.z() < max.z())
)
return true;
}
{
//- x-max face
const vector n(1, 0, 0);
const scalar t = (n & (max - p0_)) / (n & v);
const point i = p0_ + t * v;
if(
(t > -SMALL) && (t < (1.0+SMALL))
)
if(
(i.y() > min.y()) && (i.y() < max.y()) &&
(i.z() > min.z()) && (i.z() < max.z())
)
return true;
}
}
if( mag(v.y()) > SMALL)
{
if(
((p0_.y() < min.y()) && (p1_.y() < min.y())) ||
((p0_.y() > max.y()) && (p1_.y() > max.y()))
)
return false;
{
//- y-min face
const vector n(0, -1, 0);
const scalar t = (n & (min - p0_)) / (n & v);
const point i = p0_ + t * v;
if(
(t > -SMALL) && (t < (1.0+SMALL))
)
if(
(i.x() > min.x()) && (i.x() < max.x()) &&
(i.z() > min.z()) && (i.z() < max.z())
)
return true;
}
{
//- y-max face
const vector n(0, 1, 0);
const scalar t = (n & (max - p0_)) / (n & v);
const point i = p0_ + t * v;
if(
(t > -SMALL) && (t < (1.0+SMALL))
)
if(
(i.x() > min.x()) && (i.x() < max.x()) &&
(i.z() > min.z()) && (i.z() < max.z())
)
return true;
}
}
if( mag(v.z()) > SMALL )
{
if(
((p0_.z() < min.z()) && (p1_.z() < min.z())) ||
((p0_.z() > max.z()) && (p1_.z() > max.z()))
)
return false;
{
//- z-min face
const vector n(0, 0, -1);
const scalar t = (n & (min - p0_)) / (n & v);
const point i = p0_ + t * v;
if(
(t > -SMALL) && (t < (1.0+SMALL)) &&
//.........这里部分代码省略.........
示例12: pointZones
void Foam::layerSmooth::addZonesAndModifiers()
{
// Add the zones and mesh modifiers to operate piston motion
if
(
/*
pointZones().size() > 0
|| faceZones().size() > 0
|| cellZones().size() > 0
|| topoChanger_.size() > 0
*/
pointZones().size() > 0
&& faceZones().size() > 0
&& topoChanger_.size() > 0
)
{
Info<< "Time = " << engTime().theta() << endl;
Info<< "void Foam::layerSmooth::addZonesAndModifiers() : "
<< "Zones and modifiers already present. Skipping."
<< endl;
setVirtualPositions();
checkAndCalculate();
Info << "Point zones found = " << pointZones().size() << endl;
Info << "Face zones found = " << faceZones().size() << endl;
Info << "Cell zones found = " << cellZones().size() << endl;
return;
}
else
{
pointZones().setSize(0);
faceZones().setSize(0);
cellZones().setSize(0);
topoChanger_.setSize(0);
}
if
(
engTime().engineDict().found("zOffsetGambit")
&& engTime().engineDict().found("zDisplGambit")
)
{
Info << "Assembling the cylinder mesh" << endl;
scalar zOffset
(
readScalar(engTime().engineDict().lookup("zOffsetGambit"))
);
scalar zDispl
(
readScalar(engTime().engineDict().lookup("zDisplGambit"))
);
const pointField& ap = allPoints();
pointField pDispl = allPoints();
forAll(ap, pointI)
{
const point p = ap[pointI];
if (p.z() >= zOffset)
{
pDispl[pointI].z() -= zDispl;
}
}
movePoints(pDispl);
write();
resetMotion();
Info << "Cylinder mesh assembled" << endl;
}
示例13:
void Foam::directions::writeOBJ(Ostream& os, const point& pt)
{
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
}