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); }
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); } }
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". }
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); }
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.); }