当前位置: 首页>>代码示例>>C++>>正文


C++ FloatArray::resize方法代码示例

本文整理汇总了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));
    }
}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:10,代码来源:fei3dtetquad.C

示例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 ];
}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:10,代码来源:microplanematerial.C

示例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;
}
开发者ID:aishugang,项目名称:oofem,代码行数:10,代码来源:phasefieldelement.C

示例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);
    }
}
开发者ID:MartinFagerstrom,项目名称:oofem,代码行数:19,代码来源:rankinematnl.C

示例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);
}
开发者ID:rreissnerr,项目名称:oofem,代码行数:10,代码来源:simplecrosssection.C

示例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;
    }
}
开发者ID:rreissnerr,项目名称:oofem,代码行数:19,代码来源:fei3dwedgelin.C

示例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;
}
开发者ID:Benjamin-git,项目名称:OOFEM_LargeDef,代码行数:10,代码来源:interfaceelement1d.C

示例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);
    }
}
开发者ID:vivianyw,项目名称:oofem,代码行数:19,代码来源:druckerpragercutmat.C

示例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);
    }
}
开发者ID:rainbowlqs,项目名称:oofem,代码行数:19,代码来源:misesmat.C

示例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));
    }
}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:10,代码来源:linesurfacetension.C

示例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
}
开发者ID:rainbowlqs,项目名称:oofem,代码行数:55,代码来源:tr_shell02.C

示例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;
}
开发者ID:Benjamin-git,项目名称:OOFEM_Jim,代码行数:55,代码来源:eleminterpunknownmapper.C

示例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) );
    }
}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:12,代码来源:hydratingconcretemat.C

示例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);
    }
}
开发者ID:JimBrouzoulis,项目名称:OOFEM_Jim,代码行数:11,代码来源:intmatbilinearcz.C

示例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;
}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:11,代码来源:linesurfacetension.C


注:本文中的FloatArray::resize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。