本文整理汇总了C++中StructuralElement::computeConstitutiveMatrixAt方法的典型用法代码示例。如果您正苦于以下问题:C++ StructuralElement::computeConstitutiveMatrixAt方法的具体用法?C++ StructuralElement::computeConstitutiveMatrixAt怎么用?C++ StructuralElement::computeConstitutiveMatrixAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StructuralElement
的用法示例。
在下文中一共展示了StructuralElement::computeConstitutiveMatrixAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FEIElementGeometryWrapper
void
ZZErrorEstimatorInterface :: ZZErrorEstimatorI_computeElementContributions(double &eNorm, double &sNorm,
ZZErrorEstimator :: NormType norm,
InternalStateType type,
TimeStep *tStep)
{
int nDofMans;
FEInterpolation *interpol = element->giveInterpolation();
const FloatArray *recoveredStress;
FloatArray sig, lsig, diff, ldiff, n;
FloatMatrix nodalRecoveredStreses;
nDofMans = element->giveNumberOfDofManagers();
// assemble nodal recovered stresses
for ( int i = 1; i <= element->giveNumberOfNodes(); i++ ) {
element->giveDomain()->giveSmoother()->giveNodalVector( recoveredStress,
element->giveDofManager(i)->giveNumber() );
if ( i == 1 ) {
nodalRecoveredStreses.resize( nDofMans, recoveredStress->giveSize() );
}
for ( int j = 1; j <= recoveredStress->giveSize(); j++ ) {
nodalRecoveredStreses.at(i, j) = recoveredStress->at(j);
}
}
/* Note: The recovered stresses should be in global coordinate system. This is important for shells, for example, to make
* sure that forces and moments in the same directions are averaged. For elements where local and global coordina systems
* are the same this does not matter.
*/
eNorm = sNorm = 0.0;
// compute the e-norm and s-norm
if ( norm == ZZErrorEstimator :: L2Norm ) {
for ( GaussPoint *gp: *this->ZZErrorEstimatorI_giveIntegrationRule() ) {
double dV = element->computeVolumeAround(gp);
interpol->evalN( n, * gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(element) );
diff.beTProductOf(nodalRecoveredStreses, n);
element->giveIPValue(sig, gp, type, tStep);
/* the internal stress difference is in global coordinate system */
diff.subtract(sig);
eNorm += diff.computeSquaredNorm() * dV;
sNorm += sig.computeSquaredNorm() * dV;
}
} else if ( norm == ZZErrorEstimator :: EnergyNorm ) {
FloatArray help, ldiff_reduced, lsig_reduced;
FloatMatrix D, DInv;
StructuralElement *selem = static_cast< StructuralElement * >(element);
for ( GaussPoint *gp: *this->ZZErrorEstimatorI_giveIntegrationRule() ) {
double dV = element->computeVolumeAround(gp);
interpol->evalN( n, * gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(element) );
selem->computeConstitutiveMatrixAt(D, TangentStiffness, gp, tStep);
DInv.beInverseOf(D);
diff.beTProductOf(nodalRecoveredStreses, n);
element->giveIPValue(sig, gp, type, tStep); // returns full value now
diff.subtract(sig);
/* the internal stress difference is in global coordinate system */
/* needs to be transformed into local system to compute associated energy */
this->ZZErrorEstimatorI_computeLocalStress(ldiff, diff);
StructuralMaterial :: giveReducedSymVectorForm( ldiff_reduced, ldiff, gp->giveMaterialMode() );
help.beProductOf(DInv, ldiff_reduced);
eNorm += ldiff_reduced.dotProduct(help) * dV;
this->ZZErrorEstimatorI_computeLocalStress(lsig, sig);
StructuralMaterial :: giveReducedSymVectorForm( lsig_reduced, lsig, gp->giveMaterialMode() );
help.beProductOf(DInv, lsig_reduced);
sNorm += lsig_reduced.dotProduct(help) * dV;
}
} else {
OOFEM_ERROR("unsupported norm type");
}
eNorm = sqrt(eNorm);
sNorm = sqrt(sNorm);
}