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


C++ MeshData::SetMeshId方法代码示例

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


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

示例1: InputData

    ProblemData* InputData ( Problem *problem )
{
#ifdef PARALLEL
	// Get the run suffix to enable viewing with paraview
	int myPID = 0, numProcs=1, strSize=30;
	MPI_Comm_rank(MPI_COMM_WORLD, &myPID), MPI_Comm_size(MPI_COMM_WORLD, &numProcs);
	int numDigits = std::floor(std::log10(numProcs))+1;
	char *exoSuffix=(char*) alloca(sizeof(char)*strSize), formatStr[] = ".%i.%0\0\0\0\0\0\0\0\0", *nemFolder=(char*) alloca(sizeof(char)*strSize);
	std::strncpy(exoSuffix,"\0",strSize), std::strncpy(nemFolder,"\0",strSize);
	std::sprintf(formatStr+6,"%ii",numDigits);
	std::sprintf(exoSuffix,formatStr,numProcs,myPID);
	std::sprintf(nemFolder,"./nem-%i/",numProcs);
#endif

    // Local variables
    ParseInputHelper parseInputHelper = ParseInputHelper();

    // Create the ProblemData,MeshData,SolverData, and ModelData
    ProblemData* pd        = problem->GetProblemData();
    MeshData*   meshData   = pd->CreateMeshDataStruct();
    SolverData* solverData = pd->CreateSolverDataStruct();
    ModelData*  modelData  = pd->CreateModelDataStruct();
    meshData->mMeshFileData           = new MeshFileData();
    solverData->mTimeSolverData       = new TimeSolverData();
    solverData->mNonlinearSolverDataList.push_back(new NonlinearSolverData());
    solverData->mLinearSolverDataList.push_back(new LinearSolverData());
    modelData->mModelFileData         = new ModelFileData();
    modelData->mStrucModelData        = new StrucModelData();
    SolutionData* solutionData        = new SolutionData();
    modelData->mSolutionData.push_back( solutionData );


///Set Problem and Mesh
    meshData->SetMeshId ( 1 );
    meshData->mMeshFileData->mMeshFileType = MESH_EXODUS;
    const char* InputMeshName             = "beam2D.g";
#ifdef PARALLEL
	std::sprintf(meshData->mMeshFileData->mMeshFileBase, "%s%s"  , nemFolder, InputMeshName );
	std::sprintf(meshData->mMeshFileData->mMeshFile    , "%s%s%s", nemFolder, InputMeshName, exoSuffix );
#else
	std::sprintf(meshData->mMeshFileData->mMeshFileBase, "%s", InputMeshName );
	std::sprintf(meshData->mMeshFileData->mMeshFile    , "%s", InputMeshName );
#endif


/// Time Integration options
    solverData->SetSolverId ( 1 );
    solverData->mTimeSolverData->mType           = TIME_SOLVER_FEMDOC_BDF;
    solverData->mTimeSolverData->mBdfOrder       = 2;
    solverData->mTimeSolverData->mTime           = 0.0;
    solverData->mTimeSolverData->mTimeIts        = sNumIts;
    solverData->mTimeSolverData->mTimeItList[0]  = solverData->mTimeSolverData->mTimeIts;
    solverData->mTimeSolverData->mDt             = sTimeStep;
    solverData->mTimeSolverData->mDtList[0]      = solverData->mTimeSolverData->mDt;
//    solverData->mTimeSolverData->mMaxTime         = solverData->mTimeSolverData->mTimeIts*solverData->mTimeSolverData->mDt;
    solverData->mTimeSolverData->mBeta           = 0.25;           // Newmark Alpha
    solverData->mTimeSolverData->mGamma          = 0.5;            // Newmark Delta
    solverData->mTimeSolverData->mAlphaF         = 0.0;
    solverData->mTimeSolverData->mAlphaM         = 0.0;
    solverData->mTimeSolverData->mTotResNorm     = 1.0e-12;
    solverData->mTimeSolverData->mTotResNormDrop = 1.0e-12;
    solverData->mTimeSolverData->mNondimDivisor  = 1.0;

    solverData->mTimeSolverData->mJacCheck = false;
    solverData->mTimeSolverData->mNaNCheck = false;
    
        solverData->mTimeSolverData->mReinitByStandaloneFile = true;
    const char* tempPath = "tempDir/";
    solverData->mTimeSolverData->mSolVecDir = new char[200];
    strcpy(solverData->mTimeSolverData->mSolVecDir,tempPath);


/// Newton solver and linear solver options
    solverData->mNonlinearSolverDataList[0]->mType             = NONLINEAR_SOLVER_FEMDOC_NEWTON;
    solverData->mNonlinearSolverDataList[0]->mMaxItsList[0]    = 10;
    solverData->mNonlinearSolverDataList[0]->mRelaxation       = 1.0;
    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;
//.........这里部分代码省略.........
开发者ID:chvillanuevap,项目名称:thesis-defense,代码行数:101,代码来源:beam2D.C


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