本文整理汇总了C++中FloatArray::setValues方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatArray::setValues方法的具体用法?C++ FloatArray::setValues怎么用?C++ FloatArray::setValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatArray
的用法示例。
在下文中一共展示了FloatArray::setValues方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FEIElementGeometryWrapper
double Tr21Stokes :: SpatialLocalizerI_giveDistanceFromParametricCenter(const FloatArray &coords)
{
FloatArray center;
FloatArray lcoords;
lcoords.setValues(3, 0.333333, 0.333333, 0.333333);
interpolation_quad.local2global(center, lcoords, FEIElementGeometryWrapper(this));
return center.distance(coords);
}
示例2: giveIPValue
int FE2FluidMaterial :: giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
{
FE2FluidMaterialStatus *status = static_cast<FE2FluidMaterialStatus *>(this->giveStatus(gp));
if ( type == IST_VOFFraction ) {
answer.setValues(1, status->giveVOFFraction());
return true;
} else {
return FluidDynamicMaterial::giveIPValue(answer, gp, type, tStep);
}
}
示例3: clamp
int
FEI3dLineLin :: global2local(FloatArray &answer, const FloatArray &coords, const FEICellGeometry &cellgeo)
{
FloatArray vec, x;
vec.beDifferenceOf(*cellgeo.giveVertexCoordinates(2), *cellgeo.giveVertexCoordinates(1));
x.beDifferenceOf(coords, *cellgeo.giveVertexCoordinates(1));
double l2 = vec.computeSquaredNorm();
double xvec = x.dotProduct(vec);
answer.setValues(1, 2.0 * xvec / l2 - 1.0);
answer.at(1) = clamp(answer.at(1), -1.0, 1.0);
return false; // No point to check if point is "inside".
}
示例4: propagateInterfaces
void PLCrackPrescribedDir::propagateInterfaces(EnrichmentDomain &ioEnrDom) {
printf("Entering PLCrackPrescribedDir::propagateInterfaces().\n");
// Fetch crack tip data
std::vector<TipInfo> tipInfo;
ioEnrDom.giveTipInfos(tipInfo);
int tipIndex = 1;
FloatArray dir;
double angleRad = mAngle*M_PI/180.0;
dir.setValues(2, cos(angleRad), sin(angleRad));
dir.normalize();
std::vector<TipPropagation> tipPropagations;
TipPropagation tipProp;
tipProp.mTipIndex = tipIndex;
tipProp.mPropagationDir = dir;
tipProp.mPropagationLength = mIncrementLength;
tipPropagations.push_back(tipProp);
ioEnrDom.propagateTips(tipPropagations);
}
示例5: giveLocalNodeCoords
void
Tr2Shell7PhFi:: giveLocalNodeCoords(FloatArray &nodeLocalXiCoords, FloatArray &nodeLocalEtaCoords)
{
nodeLocalXiCoords.setValues(6, 1., 0., 0., .5, 0., .5); // corner nodes then midnodes, uncertain of node numbering
nodeLocalEtaCoords.setValues(6, 0., 1., 0., .5, .5, 0.);
}