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


C++ ModelData::SetModelId方法代码示例

本文整理汇总了C++中ModelData::SetModelId方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelData::SetModelId方法的具体用法?C++ ModelData::SetModelId怎么用?C++ ModelData::SetModelId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModelData的用法示例。


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

示例1: InputData


//.........这里部分代码省略.........
    solverData->mNonlinearSolverDataList[0]->mRlxList[0]       = solverData->mNonlinearSolverDataList[0]->mRelaxation;
    solverData->mNonlinearSolverDataList[0]->mTotResNormDrop   = 1.0e-3;
    solverData->mNonlinearSolverDataList[0]->mTotResNorm       = 1.0e-20;

/// Linear solver options
	solverData->mLinearSolverDataList[0]->mSparseMatrixType    = SPARSE_MATRIX_TRILINOS_EPETRA_FECRS;

//	solverData->mLinearSolverDataList[0]->mType                = LINSOL_TRILINOS_AMESOS;
//#ifdef PARALLEL
//	solverData->mLinearSolverDataList[0]->mMethod              = LINSOL_AMESOS_MUMPS;
//#else
//	solverData->mLinearSolverDataList[0]->mMethod              = LINSOL_AMESOS_UMFPACK;
//#endif
//	solverData->mLinearSolverDataList[0]->mExport          = LINSOL_EXPORT_MATLAB;

	solverData->mLinearSolverDataList[0]->mType             = LINSOL_TRILINOS_AZTEC;
	solverData->mLinearSolverDataList[0]->mMethod           = LINSOL_AZTEC_GMRES;
	solverData->mLinearSolverDataList[0]->mPreconditioner   = LINSOL_PREC_AZTEC_DD_ILUT;
	solverData->mLinearSolverDataList[0]->mKrylovSpace      = 500;
	solverData->mLinearSolverDataList[0]->mMaxIts           = 3000;
	solverData->mLinearSolverDataList[0]->mDropTol          = 1.0e-09;
	solverData->mLinearSolverDataList[0]->mGraphFill        = 1;
	solverData->mLinearSolverDataList[0]->mIlutFill         = 7.0;
	solverData->mLinearSolverDataList[0]->mPolyOrder        = 3;
	solverData->mLinearSolverDataList[0]->mAlphaThresh      = 0.0;
	solverData->mLinearSolverDataList[0]->mRhoThresh        = 0.0;
	solverData->mLinearSolverDataList[0]->mEpsilon          = 1.0e-09;
	solverData->mLinearSolverDataList[0]->mOverlap          = 1;
	solverData->mLinearSolverDataList[0]->mReorder          = 1;

	solverData->mLinearSolverDataList[0]->mHardBreak        = false;
	solverData->mLinearSolverDataList[0]->mOutput           = LINSOL_OUTPUT_ALL;



/// Model Data
    modelData->SetModelId( 1 );
    modelData->mMeshId                        = 1;
    modelData->mSolverId                      = 1;
    modelData->mModelFileData->mModelFileType = MODEL_FEMDOC;
    modelData->mStrucModelData->mRedDimType   = PLANE_STRAIN;
//    strcpy(modelData->mModelFileData->mIniLevelSetFile,"./IniLSStrucBeam.so");

	modelData->mXFemCurvatureSearchRadius = sCurvatureSearchRadius;
	modelData->mXFemCurvatureSpringStiff = sCurvatureSpringStiff;
    modelData->mdScalar_ds_byAdv = false;

/// Solution writing format
    solutionData->mSolnFormatType = SF_EXODUS;
    const char* OutputMeshBase   = "beam2D.e-s";
    solutionData->mSaveIC         = sSaveIC;
    solutionData->mOptSaveFreq    = 1;
    solutionData->mSaveOpt        = true;
    solutionData->mIsXFem         = (sXfemBlockElemType!=NON_XFEM_ELEMENT);
    strcpy(solutionData->mSolnFileBase,OutputMeshBase);
    strcpy(solutionData->mSolnFileName,OutputMeshBase);
#ifdef PARALLEL
	std::sprintf(solutionData->mSolnFileBase, "%s%s", nemFolder, OutputMeshBase );
	std::sprintf(solutionData->mSolnFileName, "%s%s", nemFolder, OutputMeshBase );
#else
	std::sprintf(solutionData->mSolnFileBase, "%s", OutputMeshBase );
	std::sprintf(solutionData->mSolnFileName, "%s", OutputMeshBase );
#endif

/// Post Processing Output Variables
    parseInputHelper.CreateNodalOutputVariables   (solutionData, SOL_UX               , ELEM_VAR, 1, sBSetIds );
    parseInputHelper.CreateNodalOutputVariables   (solutionData, SOL_UY               , ELEM_VAR, 1, sBSetIds );
    parseInputHelper.CreateNodalOutputVariables   (solutionData, SOL_UX_XFEM          , ELEM_VAR, 1, sBSetIds );
    parseInputHelper.CreateNodalOutputVariables   (solutionData, SOL_UY_XFEM          , ELEM_VAR, 1, sBSetIds );
    parseInputHelper.CreateNodalOutputVariables   (solutionData, SOL_NP_LEVELSET      , ELEM_VAR, 1, sBSetIds );
    parseInputHelper.CreateNodalOutputVariables   (solutionData, SOL_STRUC_SXX        , ELEM_VAR, 1, sBSetIds  );
    parseInputHelper.CreateNodalOutputVariables   (solutionData, SOL_STRUC_SYY        , ELEM_VAR, 1, sBSetIds  );
    parseInputHelper.CreateNodalOutputVariables   (solutionData, SOL_STRUC_SZZ        , ELEM_VAR, 1, sBSetIds  );
    parseInputHelper.CreateNodalOutputVariables   (solutionData, SOL_STRUC_SXY        , ELEM_VAR, 1, sBSetIds  );
    parseInputHelper.CreateNodalOutputVariables   (solutionData, SOL_STRUC_SHY        , ELEM_VAR, 1, sBSetIds  );
    parseInputHelper.CreateNodalOutputVariables   (solutionData, SOL_STRUC_SVM        , ELEM_VAR, 1, sBSetIds  );

	parseInputHelper.CreateNodalOutputVariables( solutionData,     SOL_OBJ_SENS, ELEM_VAR, 1, sBSetIds );
	parseInputHelper.CreateNodalOutputVariables( solutionData, SOL_CONST_1_SENS, ELEM_VAR, 1, sBSetIds );
	parseInputHelper.CreateNodalOutputVariables( solutionData, SOL_INTERFACE_CURVATURE_BEAM_LAGRANGE, ELEM_VAR, 1, sBSetIds );

//    for (UInt ie = 0; ie <(sNumDofsPerNodeMax*MAX_NUM_ENRICHMENTS); ++ie)
//    for (UInt ie = 0; ie <(sNumDofsPerNodeMax*MAX_NUM_ENRICHMENTS_2D); ++ie)  // NOTE:: Only use if code was compiled with the hack MAX_NUM_ENRICHMENTS=MAX_NUM_ENRICHMENTS_2D
//        parseInputHelper.CreateNodalOutputVariables   (solutionData, (SolVarType) (SOL_XFEM000+ie), ELEM_VAR, 1, sBSetIds);

    parseInputHelper.CreateBlockSetOutputVariables(solutionData, SOL_EP_MAIN_PHASE    ,           1, sBSetIds );
    parseInputHelper.CreateBlockSetOutputVariables(solutionData, SOL_STRUC_STEN       ,           1, sBSetIds );

    parseInputHelper.CreateGlobalOutputVariables  (solutionData, GSOL_VOLUME_PHASE_1, ELEM_VAR, 1, sBSetIds , 0, NULL);
    parseInputHelper.CreateGlobalOutputVariables  (solutionData, GSOL_VOLUME_PHASE_2, ELEM_VAR, 1, sBSetIds , 0, NULL);
    parseInputHelper.CreateGlobalOutputVariables  (solutionData,  GSOL_STRAIN_ENERGY, ELEM_VAR, 1, sBSetIds , 0, NULL);
    parseInputHelper.CreateGlobalOutputVariables  (solutionData,      GSOL_PERIMETER, ELEM_VAR, 1, sBSetIds , 0, NULL);
    parseInputHelper.CreateGlobalOutputVariables  (solutionData, GSOL_CURVATURE_TYPE, ELEM_VAR, 1, sBSetIds , 0, NULL);
    parseInputHelper.CreateGlobalOutputVariables  (solutionData,             GSOL_UX, ELEM_VAR, 1, sBSetIds , 1, (sNSetIds+sLoadNSSetIndx));
    parseInputHelper.CreateGlobalOutputVariables  (solutionData,             GSOL_UY, ELEM_VAR, 1, sBSetIds , 1, (sNSetIds+sLoadNSSetIndx));
    parseInputHelper.CreateGlobalOutputVariables  (solutionData,          GSOL_UX_SQ, ELEM_VAR, 1, sBSetIds , 1, (sNSetIds+sLoadNSSetIndx));
    parseInputHelper.CreateGlobalOutputVariables  (solutionData,          GSOL_UY_SQ, ELEM_VAR, 1, sBSetIds , 1, (sNSetIds+sLoadNSSetIndx));

    return pd;
}
开发者ID:chvillanuevap,项目名称:thesis-defense,代码行数:101,代码来源:beam2D.C


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