本文整理汇总了C++中FloatArray::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatArray::resize方法的具体用法?C++ FloatArray::resize怎么用?C++ FloatArray::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatArray
的用法示例。
在下文中一共展示了FloatArray::resize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: N
void
FEI3dTetQuad :: local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
{
FloatArray N;
this->evalN(N, lcoords, cellgeo);
answer.resize(0);
for ( int i = 1; i <= N.giveSize(); i++ ) {
answer.add( N(i), *cellgeo.giveVertexCoordinates(i));
}
}
示例2: giveMicroplaneNormal
void
MicroplaneMaterial :: giveMicroplaneNormal(FloatArray &answer, Microplane *mplane)
{
int mnumber = mplane->giveNumber();
answer.resize(3);
answer.at(1) = microplaneNormals [ mnumber - 1 ] [ 0 ];
answer.at(2) = microplaneNormals [ mnumber - 1 ] [ 1 ];
answer.at(3) = microplaneNormals [ mnumber - 1 ] [ 2 ];
}
示例3:
void
PhaseFieldElement :: computeBStress_d(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, int useUpdatedGpRecord)
{
// computes g_c*l
// PhaseFieldCrossSection *cs = static_cast...
double l = this->giveInternalLength();
double g_c = this->giveCriticalEnergy();
answer.resize(1);
answer.at(1) = g_c*l;
}
示例4: giveIPValue
int
RankineMatNl :: giveIPValue(FloatArray &answer, GaussPoint *aGaussPoint, InternalStateType type, TimeStep *atTime)
{
if ( type == IST_CumPlasticStrain_2 ) {
answer.resize(1);
double dummy;
// this method also stores the nonlocal kappa in status ... kappa_nl
computeCumPlasticStrain(dummy, aGaussPoint, atTime);
RankineMatNlStatus *status = ( RankineMatNlStatus * ) this->giveStatus(aGaussPoint);
answer.at(1) = status->giveKappa_nl();
return 1;
} else if ( type == IST_MaxEquivalentStrainLevel ) {
answer.resize(1);
computeCumPlasticStrain(answer.at(1), aGaussPoint, atTime);
return 1;
} else {
return RankineMat :: giveIPValue(answer, aGaussPoint, type, atTime);
}
}
示例5: giveIPValue
int
SimpleCrossSection :: giveIPValue(FloatArray &answer, GaussPoint *ip, InternalStateType type, TimeStep *tStep)
{
if ( type == IST_CrossSectionNumber ) {
answer.resize(1);
answer.at(1) = this->giveNumber();
return 1;
}
return this->giveMaterial(ip)->giveIPValue(answer, ip, type, tStep);
}
示例6: surfaceEvalN
void
FEI3dWedgeLin :: surfaceEvalN(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
{
double ksi = lcoords.at(1);
double eta = lcoords.at(2);
if ( isurf <= 2 ) {
answer.resize(3);
answer.at(1) = ksi;
answer.at(2) = eta;
answer.at(3) = 1.0 - ksi - eta;
} else {
answer.resize(4);
answer.at(1) = ( 1. + ksi ) * ( 1. + eta ) * 0.25;
answer.at(2) = ( 1. - ksi ) * ( 1. + eta ) * 0.25;
answer.at(3) = ( 1. - ksi ) * ( 1. - eta ) * 0.25;
answer.at(4) = ( 1. + ksi ) * ( 1. - eta ) * 0.25;
}
}
示例7: computeGlobalCoordinates
int
InterfaceElem1d :: computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
{
answer.resize(3);
answer.at(1) = this->giveNode(1)->giveCoordinate(1);
answer.at(2) = this->giveNode(1)->giveCoordinate(2);
answer.at(3) = this->giveNode(1)->giveCoordinate(3);
return 1;
}
示例8: giveIPValue
int
DruckerPragerCutMat :: giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
{
//MaterialStatus *status = this->giveStatus(gp);
if ( type == IST_DamageScalar ) {
answer.resize(1);
answer.zero();
///@todo Actually export the relevant damage value here!
//answer.at(1) = status->giveDamage();
return 1;
} else if ( type == IST_DamageTensor ) {
answer.resize(6);
answer.zero();
//answer.at(1) = answer.at(2) = answer.at(3) = status->giveDamage();
return 1;
} else {
return MPlasticMaterial2 :: giveIPValue(answer, gp, type, tStep);
}
}
示例9: giveIPValue
int
MisesMat :: giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
{
MisesMatStatus *status = static_cast< MisesMatStatus * >( this->giveStatus(gp) );
if ( type == IST_PlasticStrainTensor ) {
answer = status->givePlasDef();
return 1;
} else if ( type == IST_MaxEquivalentStrainLevel ) {
answer.resize(1);
answer.at(1) = status->giveCumulativePlasticStrain();
return 1;
} else if ( ( type == IST_DamageScalar ) || ( type == IST_DamageTensor ) ) {
answer.resize(1);
answer.at(1) = status->giveDamage();
return 1;
} else {
return StructuralMaterial :: giveIPValue(answer, gp, type, tStep);
}
}
示例10: giveCharacteristicVector
void LineSurfaceTension :: giveCharacteristicVector(FloatArray &answer, CharType mtrx, ValueModeType mode, TimeStep *tStep)
{
if( mtrx == ExternalForcesVector ) {
this->computeLoadVector(answer, mode, tStep);
} else if ( mtrx == InternalForcesVector ){
answer.resize(0);
} else {
OOFEM_ERROR2("giveCharacteristicVector: Unknown CharType (%s).",__CharTypeToString(mtrx));
}
}
示例11: globTensor
void
TR_SHELL02 :: ZZErrorEstimatorI_computeLocalStress(FloatArray &answer, FloatArray &sig)
{
// sig is global ShellForceMomentumTensor
FloatMatrix globTensor(3, 3);
const FloatMatrix *GtoLRotationMatrix = plate->computeGtoLRotationMatrix();
FloatMatrix LtoGRotationMatrix;
answer.resize(8); // reduced, local form
LtoGRotationMatrix.beTranspositionOf(* GtoLRotationMatrix);
// Forces
globTensor.at(1, 1) = sig.at(1); //sxForce
globTensor.at(1, 2) = sig.at(6); //qxyForce
globTensor.at(1, 3) = sig.at(5); //qxzForce
globTensor.at(2, 1) = sig.at(6); //qxyForce
globTensor.at(2, 2) = sig.at(2); //syForce
globTensor.at(2, 3) = sig.at(4); //syzForce
globTensor.at(3, 1) = sig.at(5); //qxzForce
globTensor.at(3, 2) = sig.at(4); //syzForce
globTensor.at(3, 3) = sig.at(3); //szForce
globTensor.rotatedWith(LtoGRotationMatrix);
// Forces: now globTensoris transformed into local c.s
// answer should be in reduced, local form
answer.at(1) = globTensor.at(1, 1); //sxForce
answer.at(2) = globTensor.at(2, 2); //syForce
answer.at(3) = globTensor.at(1, 2); //qxyForce
answer.at(7) = globTensor.at(2, 3); //syzForce
answer.at(8) = globTensor.at(1, 3); //qxzForce
// Moments:
globTensor.at(1, 1) = sig.at(7); //mxForce
globTensor.at(1, 2) = sig.at(12); //mxyForce
globTensor.at(1, 3) = sig.at(11); //mxzForce
globTensor.at(2, 1) = sig.at(12); //mxyForce
globTensor.at(2, 2) = sig.at(8); //myForce
globTensor.at(2, 3) = sig.at(10); //myzForce
globTensor.at(3, 1) = sig.at(11); //mxzForce
globTensor.at(3, 2) = sig.at(10); //myzForce
globTensor.at(3, 3) = sig.at(9); //mzForce
globTensor.rotatedWith(LtoGRotationMatrix);
// now globTensoris transformed into local c.s
answer.at(4) = globTensor.at(1, 1); //mxForce
answer.at(5) = globTensor.at(2, 2); //myForce
answer.at(6) = globTensor.at(1, 2); //mxyForce
}
示例12: mapAndUpdate
int
EIPrimaryUnknownMapper :: mapAndUpdate(FloatArray &answer, ValueModeType mode,
Domain *oldd, Domain *newd, TimeStep *tStep)
{
int inode, nd_nnodes = newd->giveNumberOfDofManagers();
int nsize = newd->giveEngngModel()->giveNumberOfDomainEquations( newd->giveNumber(), EModelDefaultEquationNumbering() );
FloatArray unknownValues;
IntArray dofidMask, locationArray;
IntArray reglist;
#ifdef OOFEM_MAPPING_CHECK_REGIONS
ConnectivityTable *conTable = newd->giveConnectivityTable();
const IntArray *nodeConnectivity;
#endif
answer.resize(nsize);
answer.zero();
for ( inode = 1; inode <= nd_nnodes; inode++ ) {
DofManager *node = newd->giveNode(inode);
/* HUHU CHEATING */
if ( node->giveParallelMode() != DofManager_local ) {
continue;
}
#ifdef OOFEM_MAPPING_CHECK_REGIONS
// build up region list for node
nodeConnectivity = conTable->giveDofManConnectivityArray(inode);
reglist.resize( nodeConnectivity->giveSize() );
reglist.clear();
for ( int indx = 1; indx <= nodeConnectivity->giveSize(); indx++ ) {
reglist.insertSortedOnce( newd->giveElement( nodeConnectivity->at(indx) )->giveRegionNumber() );
}
#endif
///@todo Shouldn't we pass a primary field or something to this function?
if ( this->evaluateAt(unknownValues, dofidMask, mode, oldd, * node->giveCoordinates(), reglist, tStep) ) {
///@todo This doesn't respect local coordinate systems in nodes. Supporting that would require major reworking.
for ( int ii = 1; ii <= dofidMask.giveSize(); ii++ ) {
// exclude slaves; they are determined from masters
auto it = node->findDofWithDofId((DofIDItem)dofidMask.at(ii));
if ( it != node->end() ) {
Dof *dof = *it;
if ( dof->isPrimaryDof() ) {
int eq = dof->giveEquationNumber(EModelDefaultEquationNumbering());
answer.at( eq ) += unknownValues.at(ii);
}
}
}
} else {
OOFEM_ERROR("evaluateAt service failed for node %d", inode);
}
}
return 1;
}
示例13: computeInternalSourceVector
// returns hydration power [W/m3 of concrete]
void
HydratingConcreteMat :: computeInternalSourceVector(FloatArray &val, GaussPoint *gp, TimeStep *atTime, ValueModeType mode)
{
HydratingConcreteMatStatus *ms = ( HydratingConcreteMatStatus * ) this->giveStatus(gp);
val.resize(1);
if ( mode == VM_Total ) {
val.at(1) = ms->GivePower(atTime);
} else {
OOFEM_ERROR2( "Undefined mode %s\n", __ValueModeTypeToString(mode) );
}
}
示例14: giveIPValue
int IntMatBilinearCZ :: giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
{
IntMatBilinearCZStatus *status = static_cast< IntMatBilinearCZStatus * >( this->giveStatus(gp) );
if ( type == IST_DamageScalar ) {
answer.resize(1);
answer.at(1) = status->mDamageNew;
return 1;
} else {
return StructuralInterfaceMaterial :: giveIPValue(answer, gp, type, tStep);
}
}
示例15:
int LineSurfaceTension :: EIPrimaryUnknownMI_computePrimaryUnknownVectorAt(ValueModeType mode,
TimeStep *tStep, const FloatArray &gcoords, FloatArray &answer)
{
FloatArray lcoords;
if (!this->computeLocalCoordinates(lcoords, gcoords)) {
answer.resize(0);
return false;
}
this->EIPrimaryUnknownMI_computePrimaryUnknownVectorAtLocal(mode, tStep, lcoords, answer);
return true;
}