本文整理汇总了C++中FloatArray::containsOnlyZeroes方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatArray::containsOnlyZeroes方法的具体用法?C++ FloatArray::containsOnlyZeroes怎么用?C++ FloatArray::containsOnlyZeroes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatArray
的用法示例。
在下文中一共展示了FloatArray::containsOnlyZeroes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sigmaCr
void
RCM2Material :: giveRealPrincipalStressVector3d(FloatArray &answer, GaussPoint *gp,
FloatArray &principalStrain,
FloatMatrix &tempCrackDirs,
TimeStep *atTime)
//
// returns real principal stress vector in 3d stress space of receiver according to
// previous level of stress and current
// strain increment, the only way, how to correctly update gp records
// updates principal strain and stress of the receiver's status.
//
{
int i, iter, ind;
double maxErr;
FloatArray crackStrainVector, reducedTotalStrainVector;
FloatArray strainIncrement, crackStrainIterativeIncrement;
FloatArray prevPrincipalStrain;
FloatArray dSigma;
FloatArray elastStrain, sigmaEl, sigmaCr(3);
FloatArray fullDSigma;
IntArray activatedCracks, crackMapping;
FloatMatrix dcr, de, decr, fullDecr, crackDirs;
RCM2MaterialStatus *status = ( RCM2MaterialStatus * ) this->giveStatus(gp);
/*
* if (status -> giveStressVector() == NULL) status->letStressVectorBe(new FloatArray(this->giveSizeOfReducedStressStrainVector(gp->giveMaterialMode())));
* if (status -> giveStrainVector() == NULL) status->letStrainVectorBe(new FloatArray(this->giveSizeOfReducedStressStrainVector(gp->giveMaterialMode())));
* // if (status -> givePlasticStrainVector() == NULL) status->letPlasticStrainVectorBe(new FloatArray(6));
* if (status -> giveStressIncrementVector() == NULL) status->letStressIncrementVectorBe(new FloatArray(this->giveSizeOfReducedStressStrainVector(gp->giveMaterialMode())));
* if (status -> giveStrainIncrementVector() == NULL) status->letStrainIncrementVectorBe(new FloatArray(this->giveSizeOfReducedStressStrainVector(gp->giveMaterialMode())));
* // if (status -> givePlasticStrainIncrementVector() == NULL) status->letPlasticStrainIncrementVectorBe(new FloatArray(6));
*/
/*
* // totalStressVector = gp -> giveStressVector()->GiveCopy();
* reducedTotalStrainVector = status -> giveStrainVector();
* reducedTotalStrainVector.add(fullStrainIncrement);
* crossSection->giveFullCharacteristicVector(totalStrainVector, gp, reducedTotalStrainVector);
* //delete reducedTotalStrainVector;
* // plasticStrainVector = status -> givePlasticStrainVector()->GiveCopy();
*
*
* // already cracked - next directions are determined
* // according to principal strain directions
* status->giveTempCrackDirs(tempCrackDirs);
* this->computePrincipalValDir (principalStrain, tempCrackDirs,
* totalStrainVector,
* principal_strain);
* status->letTempCrackDirsBe (tempCrackDirs);
*/
status->giveCrackStrainVector(crackStrainVector); // local one
status->giveCrackDirs(crackDirs);
if ( principalStrain.containsOnlyZeroes() ) {
// keep old principal values
status->letTempCrackDirsBe(crackDirs);
} else {
this->sortPrincDirAndValCloseTo(& principalStrain,
& tempCrackDirs, & crackDirs);
status->letTempCrackDirsBe(tempCrackDirs);
}
// compute de in local system
// for iso materials no transformation if stiffness required
//
// local strain increment
status->givePrevPrincStrainVector(prevPrincipalStrain);
strainIncrement.beDifferenceOf(principalStrain, prevPrincipalStrain);
status->letPrincipalStrainVectorBe(principalStrain);
this->giveNormalElasticStiffnessMatrix(de, FullForm, TangentStiffness,
gp, atTime, tempCrackDirs);
//
// construct mapping matrix of active cracks
// this mapping will dynamically change as
// some crack can unlo or reload
//
this->updateActiveCrackMap(gp);
status->giveCrackMap(crackMapping);
// start iteration until stress computed from elastic increment
// is equal to stress computed from cracking strain increment
// we do this computation in reduced stress strain space
dSigma.resize(0);
for ( iter = 1; iter <= 20; iter++ ) {
//
// first check if already cracked
//
if ( status->giveNumberOfTempActiveCracks() ) {
// active crack exist
this->giveCrackedStiffnessMatrix(dcr, TangentStiffness, gp, atTime);
fullDecr = de;
fullDecr.add(dcr);
decr.beSubMatrixOf(fullDecr, crackMapping);
if ( dSigma.giveSize() == 0 ) {
fullDSigma.beProductOf(de, strainIncrement);
dSigma.beSubArrayOf(fullDSigma, crackMapping);
}
decr.solveForRhs(dSigma, crackStrainIterativeIncrement);
for ( i = 1; i <= 3; i++ ) {
//.........这里部分代码省略.........