本文整理汇总了C++中FloatArray::beColumnOf方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatArray::beColumnOf方法的具体用法?C++ FloatArray::beColumnOf怎么用?C++ FloatArray::beColumnOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatArray
的用法示例。
在下文中一共展示了FloatArray::beColumnOf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: giveMaterialOrientationAt
void
Structural2DElement :: giveMaterialOrientationAt(FloatArray &x, FloatArray &y, const FloatArray &lcoords)
{
if ( this->elemLocalCS.isNotEmpty() ) { // User specified orientation
x = {
elemLocalCS.at(1, 1), elemLocalCS.at(2, 1)
};
y = {
-x(1), x(0)
};
} else {
FloatMatrix jac;
this->giveInterpolation()->giveJacobianMatrixAt( jac, lcoords, * this->giveCellGeometryWrapper() );
x.beColumnOf(jac, 1); // This is {dx/dxi, dy/dxi, dz/dxi}
x.normalize();
y = {
-x(1), x(0)
};
}
}
示例2: line
std::vector<std::unique_ptr<EnrichmentItem>> NCPrincipalStress::nucleateEnrichmentItems() {
SpatialLocalizer *octree = this->mpDomain->giveSpatialLocalizer();
XfemManager *xMan = mpDomain->giveXfemManager();
std::vector<std::unique_ptr<EnrichmentItem>> eiList;
// Center coordinates of newly inserted cracks
std::vector<FloatArray> center_coord_inserted_cracks;
// Loop over all elements and all bulk GP.
for(auto &el : mpDomain->giveElements() ) {
int numIR = el->giveNumberOfIntegrationRules();
int csNum = el->giveCrossSection()->giveNumber();
if(csNum == mCrossSectionInd || true) {
for(int irInd = 0; irInd < numIR; irInd++) {
IntegrationRule *ir = el->giveIntegrationRule(irInd);
int numGP = ir->giveNumberOfIntegrationPoints();
for(int gpInd = 0; gpInd < numGP; gpInd++) {
GaussPoint *gp = ir->getIntegrationPoint(gpInd);
// int csNum = gp->giveCrossSection()->giveNumber();
// printf("csNum: %d\n", csNum);
StructuralMaterialStatus *ms = dynamic_cast<StructuralMaterialStatus*>(gp->giveMaterialStatus());
if(ms != NULL) {
const FloatArray &stress = ms->giveTempStressVector();
FloatArray principalVals;
FloatMatrix principalDirs;
StructuralMaterial::computePrincipalValDir(principalVals, principalDirs, stress, principal_stress);
if(principalVals[0] > mStressThreshold) {
// printf("\nFound GP with stress above threshold.\n");
// printf("principalVals: "); principalVals.printYourself();
FloatArray crackNormal;
crackNormal.beColumnOf(principalDirs, 1);
// printf("crackNormal: "); crackNormal.printYourself();
FloatArray crackTangent = {-crackNormal(1), crackNormal(0)};
crackTangent.normalize();
// printf("crackTangent: "); crackTangent.printYourself();
// Create geometry
FloatArray pc = {gp->giveGlobalCoordinates()(0), gp->giveGlobalCoordinates()(1)};
// printf("Global coord: "); pc.printYourself();
FloatArray ps = pc;
ps.add(-0.5*mInitialCrackLength, crackTangent);
FloatArray pe = pc;
pe.add(0.5*mInitialCrackLength, crackTangent);
if(mCutOneEl) {
// If desired, ensure that the crack cuts exactly one element.
Line line(ps, pe);
std::vector<FloatArray> intersecPoints;
// line.computeIntersectionPoints(el.get(), intersecPoints);
for ( int i = 1; i <= el->giveNumberOfDofManagers(); i++ ) {
// int n1 = i;
// int n2 = 0;
// if ( i < el->giveNumberOfDofManagers() ) {
// n2 = i + 1;
// } else {
// n2 = 1;
// }
// const FloatArray &p1 = *(el->giveDofManager(n1)->giveCoordinates());
// const FloatArray &p2 = *(el->giveDofManager(n2)->giveCoordinates());
}
// printf("intersecPoints.size(): %lu\n", intersecPoints.size());
if(intersecPoints.size() == 2) {
ps = std::move(intersecPoints[0]);
pe = std::move(intersecPoints[1]);
}
else {
//.........这里部分代码省略.........