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


C++ IR_GIVE_OPTIONAL_FIELD函数代码示例

本文整理汇总了C++中IR_GIVE_OPTIONAL_FIELD函数的典型用法代码示例。如果您正苦于以下问题:C++ IR_GIVE_OPTIONAL_FIELD函数的具体用法?C++ IR_GIVE_OPTIONAL_FIELD怎么用?C++ IR_GIVE_OPTIONAL_FIELD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了IR_GIVE_OPTIONAL_FIELD函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: initializeFrom

IRResultType
ZZErrorEstimator :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                // Required by IR_GIVE_FIELD macro
    int n;

    ErrorEstimator :: initializeFrom(ir);
    n = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, n, _IFT_ZZErrorEstimator_normtype);
    if ( n == 1 ) {
        this->normType = EnergyNorm;
    } else {
        this->normType = L2Norm; // default
    }

    n = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, n, _IFT_ZZErrorEstimator_recoverytype);
    if ( n == 1 ) {
        this->nodalRecoveryType = SPRRecovery;
    } else {
        this->nodalRecoveryType = ZZRecovery; // default
    }

    return this->giveRemeshingCrit()->initializeFrom(ir);
}
开发者ID:rreissnerr,项目名称:oofem,代码行数:25,代码来源:zzerrorestimator.C

示例2: initializeFrom

IRResultType
SpoolesSolver :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
    IRResultType result;                // Required by IR_GIVE_FIELD macro

    int val;
    std::string msgFileName;

    val = -3;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_SpoolesSolver_msglvl);
    msglvl = val;
    IR_GIVE_OPTIONAL_FIELD(ir, msgFileName, _IFT_SpoolesSolver_msgfile);
    if ( !msgFileName.empty() ) {
        msgFile = fopen(msgFileName.c_str(), "w");
        msgFileCloseFlag = 1;
    } else {
        msgFile = stdout;
        msgFileCloseFlag = 0;
    }

    /*
     * IR_GIVE_OPTIONAL_FIELD (ir, tol, "lstol");
     * IR_GIVE_OPTIONAL_FIELD (ir, maxite, "lsiter");
     * val = 0;
     * IR_GIVE_OPTIONAL_FIELD (ir, val, "lsprecond");
     * precondType= (IMLPrecondType) val;
     *
     * this->precondAttributes = ir;
     */
    return IRRT_OK;
}
开发者ID:Benjamin-git,项目名称:OOFEM_LargeDef,代码行数:32,代码来源:spoolessolver.C

示例3: initializeFrom

// reads the model parameters from the input file
IRResultType
MisesMat :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                 // required by IR_GIVE_FIELD macro

    result = StructuralMaterial :: initializeFrom(ir);
    if ( result != IRRT_OK ) return result;

    result = linearElasticMaterial->initializeFrom(ir); // takes care of elastic constants
    if ( result != IRRT_OK ) return result;

    G = static_cast< IsotropicLinearElasticMaterial * >(linearElasticMaterial)->giveShearModulus();
    K = static_cast< IsotropicLinearElasticMaterial * >(linearElasticMaterial)->giveBulkModulus();

    IR_GIVE_FIELD(ir, sig0, _IFT_MisesMat_sig0); // uniaxial yield stress

    H = 0.;
    IR_GIVE_OPTIONAL_FIELD(ir, H, _IFT_MisesMat_h); // hardening modulus
    /*********************************************************************************************************/
    omega_crit = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, omega_crit, _IFT_MisesMat_omega_crit); // critical damage

    a = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, a, _IFT_MisesMat_a); // exponent in damage law
    /********************************************************************************************************/

    return IRRT_OK;
}
开发者ID:rainbowlqs,项目名称:oofem,代码行数:29,代码来源:misesmat.C

示例4: initializeFrom

IRResultType
TR_SHELL01 :: initializeFrom(InputRecord *ir)
{
    // proc tady neni return = this...   ??? termitovo
    IRResultType result = StructuralElement :: initializeFrom(ir);
    if ( result != IRRT_OK ) {
        return result;
    }

#if 0
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_Element_nip);
    if ( val != -1 ) {
        OOFEM_WARNING("key word NIP is not allowed for element TR_SHELL01");
        return result;
    }
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_TrPlaneStrRot_niprot, "niprot");
    if ( val != -1 ) {
        OOFEM_WARNING("key word NIProt is not allowed for element TR_SHELL01");
        return result;
    }
#endif

    result = plate->initializeFrom(ir);
    if ( result != IRRT_OK ) {
        return result;
    }
    result = membrane->initializeFrom(ir);
    if ( result != IRRT_OK ) {
        return result;
    }

    return IRRT_OK;
}
开发者ID:pcmagic,项目名称:oofem,代码行数:33,代码来源:tr_shell01.C

示例5: initializeFrom

IRResultType
SolutionbasedShapeFunction :: initializeFrom(InputRecord *ir)
{
    IRResultType result;

    // Load problem file
    this->filename = "";
    IR_GIVE_OPTIONAL_FIELD(ir, this->filename, _IFT_SolutionbasedShapeFunction_ShapeFunctionFile);
    useConstantBase = ( this->filename == "" ) ? true : false;

    externalSet = -1;
    IR_GIVE_OPTIONAL_FIELD(ir, externalSet, _IFT_SolutionbasedShapeFunction_Externalset);

    // use correction factors to ensure incompressibility
    useCorrectionFactors=false;
    IR_GIVE_OPTIONAL_FIELD(ir, useCorrectionFactors, _IFT_SolutionbasedShapeFunction_UseCorrectionFactors);

    dumpSnapshot = false;
    IR_GIVE_OPTIONAL_FIELD(ir, dumpSnapshot, _IFT_SolutionbasedShapeFunction_DumpSnapshots);


    // Set up master dofs
    ///@todo This should be in the constructor:
    myNode = new Node( 1, this->giveDomain() );

    for (int i = 1; i <= this->giveDomain()->giveNumberOfSpatialDimensions(); i++) {
        int DofID = this->domain->giveNextFreeDofID();
        MasterDof *newDof = new MasterDof( myNode, (DofIDItem) DofID );
        myNode->appendDof( newDof );
    }

    init();

    return ActiveBoundaryCondition :: initializeFrom(ir);
}
开发者ID:eudoxos,项目名称:oofem,代码行数:35,代码来源:solutionbasedshapefunction.C

示例6: initializeFrom

IRResultType StokesFlow :: initializeFrom(InputRecord *ir)
{
    IRResultType result;
    int val;

    val = ( int ) SMT_PetscMtrx;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_smtype);
    this->sparseMtrxType = ( SparseMtrxType ) val;

    val = ( int ) ST_Petsc;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_lstype);
    this->solverType = ( LinSystSolverType ) val;

    this->deltaT = 1.0;
    IR_GIVE_OPTIONAL_FIELD(ir, deltaT, _IFT_StokesFlow_deltat);

    this->velocityPressureField.reset( new DofDistributedPrimaryField(this, 1, FT_VelocityPressure, 1) );
    this->stiffnessMatrix.reset( NULL );
    this->meshqualityee.reset( NULL );

    this->ts = TS_OK;

    this->maxdef = 25; ///@todo Deal with this parameter (set to some reasonable value by default now)

    return FluidModel :: initializeFrom(ir);
}
开发者ID:aishugang,项目名称:oofem,代码行数:26,代码来源:stokesflow.C

示例7: initializeFrom

IRResultType
FreeWarping :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                // Required by IR_GIVE_FIELD macro

    result = StructuralEngngModel :: initializeFrom(ir);
    if ( result != IRRT_OK ) {
        return result;
    }

    int val = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_lstype);
    solverType = ( LinSystSolverType ) val;

    val = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_smtype);
    sparseMtrxType = ( SparseMtrxType ) val;

#ifdef __PARALLEL_MODE
    if ( isParallel() ) {
        commBuff = new CommunicatorBuff( this->giveNumberOfProcesses() );
        communicator = new NodeCommunicator(this, commBuff, this->giveRank(),
                                            this->giveNumberOfProcesses());
    }

#endif


    return IRRT_OK;
}
开发者ID:srinath-chakravarthy,项目名称:oofem_dd,代码行数:30,代码来源:freewarping.C

示例8: initializeFrom

IRResultType
EigenValueDynamic :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
    IRResultType result;                // Required by IR_GIVE_FIELD macro
    //EngngModel::instanciateFrom (ir);

    IR_GIVE_FIELD(ir, numberOfRequiredEigenValues, IFT_EigenValueDynamic_nroot, "nroot"); // Macro

    // numberOfSteps set artificially to numberOfRequiredEigenValues
    // in order to allow
    // use restoreContext function for different eigenValues
    // numberOfSteps = numberOfRequiredEigenValues;
    numberOfSteps = 1;

    IR_GIVE_FIELD(ir, rtolv, IFT_EigenValueDynamic_rtolv, "rtolv"); // Macro
    if ( rtolv < 1.e-12 ) {
        rtolv =  1.e-12;
    }

    if ( rtolv > 0.01 ) {
        rtolv =  0.01;
    }

    int val = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, val, IFT_EigenValueDynamic_stype, "stype"); // Macro
    solverType = ( GenEigvalSolverType ) val;

    val = 0; //Default Skyline
    IR_GIVE_OPTIONAL_FIELD(ir, val, IFT_EigenValueDynamic_smtype, "smtype");  // Macro
    sparseMtrxType = ( SparseMtrxType ) val;

    return IRRT_OK;
}
开发者ID:MartinFagerstrom,项目名称:oofem,代码行数:34,代码来源:eigenvaluedynamic.C

示例9: initializeFrom

IRResultType
J2plasticMaterial :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
    IRResultType result;                // Required by IR_GIVE_FIELD macro
    double value;

    PlasticMaterial :: initializeFrom(ir);
    linearElasticMaterial->initializeFrom(ir);

    IR_GIVE_FIELD(ir, value, IFT_J2plasticMaterial_ry, "ry"); // Macro
    k = value / sqrt(3.0);

    //  E = readDouble (initString,"e");
    // nu = readDouble (initString,"nu");
    kinematicModuli = 0.0;
    IR_GIVE_OPTIONAL_FIELD(ir, kinematicModuli, IFT_J2plasticMaterial_khm, "khm"); // Macro

    isotropicModuli = 0.0;
    IR_GIVE_OPTIONAL_FIELD(ir, isotropicModuli, IFT_J2plasticMaterial_ihm, "ihm"); // Macro

    if ( fabs(kinematicModuli) > 1.e-12 ) {
        kinematicHardeningFlag = 1;
    }

    if ( fabs(isotropicModuli) > 1.e-12 ) {
        isotropicHardeningFlag = 1;
    }

    return IRRT_OK;
}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:31,代码来源:j2plasticmaterial.C

示例10: initializeFrom

IRResultType
TrustRegionSolver3 :: initializeFrom(InputRecord *ir) {

    IRResultType result;                // Required by IR_GIVE_FIELD macro


    IR_GIVE_OPTIONAL_FIELD(ir, mTrustRegionSize, _IFT_TrustRegionSolver3_InitialSize);

	if ( engngModel->giveProblemScale() == macroScale ) {
		printf("mTrustRegionSize: %e\n", mTrustRegionSize);
	}


    IR_GIVE_OPTIONAL_FIELD(ir, mBeta, _IFT_TrustRegionSolver3_Beta);

	if ( engngModel->giveProblemScale() == macroScale ) {
		printf("mBeta: %e\n", mBeta);
	}


    IR_GIVE_OPTIONAL_FIELD(ir, mEigVecRecalc, _IFT_TrustRegionSolver3_EigVecRecompute);

	if ( engngModel->giveProblemScale() == macroScale ) {
		printf("mEigVecRecalc: %d\n", mEigVecRecalc);
	}

    return NRSolver :: initializeFrom(ir);

}
开发者ID:erisve,项目名称:oofem,代码行数:29,代码来源:trustregionsolver3.C

示例11: initializeFrom

IRResultType
BilinearCZMaterial :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom";  // Required by IR_GIVE_FIELD macro
    IRResultType result;                    // Required by IR_GIVE_FIELD macro

    IR_GIVE_FIELD(ir, kn0, _IFT_BilinearCZMaterial_kn);
    this->knc = kn0;                        // Defaults to the same stiffness in compression and tension
    IR_GIVE_OPTIONAL_FIELD(ir, this->knc, _IFT_BilinearCZMaterial_knc);
    
    this->ks0 = 0.0;                        // Defaults to no shear stiffness
    IR_GIVE_OPTIONAL_FIELD(ir, ks0, _IFT_BilinearCZMaterial_ks);

    IR_GIVE_FIELD(ir, GIc, _IFT_BilinearCZMaterial_g1c);

    this->sigfn = 1.0e50; // defaults to infinite strength @todo but then it will not be bilinear only linear
    this->sigfs = 1.0e50;
    IR_GIVE_OPTIONAL_FIELD(ir, sigfn, _IFT_BilinearCZMaterial_sigfn);

    this->gn0 = sigfn / (kn0 + tolerance);                   // normal jump at damage initiation 
    this->gs0 = sigfs / (ks0 + tolerance);                   // shear jump at damage initiation
    this->gnmax = 2.0 * GIc / sigfn;                         // @todo defaults to zero - will this cause problems?
    this->kn1 = - this->sigfn / ( this->gnmax - this->gn0 ); // slope during softening part in normal dir
    double kn0min = 0.5*sigfn*sigfn/GIc;
    this->checkConsistency();                                // check validity of the material paramters
    this->printYourself();
    return IRRT_OK;
}
开发者ID:Benjamin-git,项目名称:OOFEM_LargeDef,代码行数:28,代码来源:bilinearczmaterial.C

示例12: initializeFrom

IRResultType StokesFlow :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom";
    IRResultType result;
    int val;

    val = ( int ) SMT_PetscMtrx;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_smtype);
    this->sparseMtrxType = ( SparseMtrxType ) val;

    val = ( int ) ST_Petsc;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_lstype);
    this->solverType = ( LinSystSolverType ) val;

    this->deltaT = 1.0;
    IR_GIVE_OPTIONAL_FIELD(ir, deltaT, _IFT_StokesFlow_deltat);

    this->velocityPressureField = new PrimaryField(this, 1, FT_VelocityPressure, EID_MomentumBalance_ConservationEquation, 1);

    this->ts = TS_OK;

    this->maxdef = 25; ///@todo Deal with this parameter (set to some reasonable value by default now)

    return EngngModel :: initializeFrom(ir);
}
开发者ID:Benjamin-git,项目名称:OOFEM_LargeDef,代码行数:25,代码来源:stokesflow.C

示例13: initializeFrom

IRResultType
SolutionbasedShapeFunction :: initializeFrom(InputRecord *ir)
{
    IRResultType result;

    ActiveBoundaryCondition :: initializeFrom(ir);

    // Load problem file
    this->filename = "";
    IR_GIVE_OPTIONAL_FIELD(ir, this->filename, _IFT_SolutionbasedShapeFunction_ShapeFunctionFile);
    useConstantBase = ( this->filename == "" ) ? true : false;

    externalSet = -1;
    IR_GIVE_OPTIONAL_FIELD(ir, externalSet, _IFT_SolutionbasedShapeFunction_Externalset);

    // Set up master dofs
    myNode = new Node( 1, this->giveDomain() );

    for ( int i = 1; i <= this->giveDofIDs().giveSize(); i++ ) {
        int DofID = this->domain->giveNextFreeDofID();
        MasterDof *newDof = new MasterDof(i, myNode, ( DofIDItem ) DofID);
        myNode->appendDof(newDof);
        myDofIDs.followedBy(DofID);
    }

    init();

    return IRRT_OK;
}
开发者ID:xyuan,项目名称:oofem,代码行数:29,代码来源:solutionbasedshapefunction.C

示例14: initializeFrom

IRResultType
MisesMatNl :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                // Required by IR_GIVE_FIELD macro

    MisesMat :: initializeFrom(ir);
    StructuralNonlocalMaterialExtensionInterface :: initializeFrom(ir);

    averType = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, averType, _IFT_MisesMatNl_averagingtype);
    if ( averType == 2 ) {
        exponent = 0.5; // default value for averaging type 2
    }

    if ( averType == 3 ) {
        exponent = 1.; // default value for averaging type 3
    }

    if ( averType == 2 || averType == 3 ) {
        IR_GIVE_OPTIONAL_FIELD(ir, exponent, _IFT_MisesMatNl_exp);
    }

    if ( averType >= 2 && averType <= 5 ) {
        IR_GIVE_OPTIONAL_FIELD(ir, Rf, _IFT_MisesMatNl_rf);
    }

    return IRRT_OK;
}
开发者ID:vivianyw,项目名称:oofem,代码行数:28,代码来源:misesmatnl.C

示例15: initializeFrom

IRResultType
Q4Axisymm :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
    IRResultType result;                // Required by IR_GIVE_FIELD macro

    this->StructuralElement :: initializeFrom(ir);
    numberOfGaussPoints          = 4;
    IR_GIVE_OPTIONAL_FIELD(ir, numberOfGaussPoints, IFT_Q4Axisymm_nip, "nip"); // Macro
    numberOfFiAndShGaussPoints   = 1;
    IR_GIVE_OPTIONAL_FIELD(ir, numberOfFiAndShGaussPoints, IFT_Q4Axisymm_nipfish, "nipfish"); // Macro

    if ( !( ( numberOfGaussPoints == 1 ) ||
           ( numberOfGaussPoints == 4 ) ||
           ( numberOfGaussPoints == 9 ) ||
           ( numberOfGaussPoints == 16 ) ) ) {
        numberOfGaussPoints = 4;
    }

    if ( !( ( numberOfFiAndShGaussPoints == 1 ) ||
           ( numberOfFiAndShGaussPoints == 4 ) ||
           ( numberOfFiAndShGaussPoints == 9 ) ||
           ( numberOfFiAndShGaussPoints == 16 ) ) ) {
        numberOfFiAndShGaussPoints = 1;
    }


    this->computeGaussPoints();

    return IRRT_OK;
}
开发者ID:MartinFagerstrom,项目名称:oofem,代码行数:31,代码来源:q4axisymm.C


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