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


C++ StringT::FilePath方法代码示例

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


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

示例1: RunBatch

/* Batch file processing */
void ExecutionManagerT::RunBatch(ifstreamT& in, ostream& status)
{
	/* mark status */
	status << "\n Processing batch file: " << in.filename() << '\n';
	
	/* start day/date info */
	time_t starttime;
	time(&starttime);

	/* get 1st entry */
	StringT nextinfilename;
	in >> nextinfilename;
	
	/* repeat to end of file */
	while (in.good())
	{
		/* adjusting execution options */
		if (nextinfilename[0] == '-')
			AddCommandLineOption(nextinfilename);
		else /* execute regular file */
		{	
			/* file path format */
			nextinfilename.ToNativePathName();

			/* path to source file */
			StringT path;
			path.FilePath(in.filename());
	
			/* open new input stream */
			nextinfilename.Prepend(path);
			ifstreamT nextin('#', nextinfilename);
	
			/* process if valid */
			if (nextin.is_open())
				JobOrBatch(nextin, cout);
			else
				cout << " File not found: " << nextinfilename << '\n';
		}
			
		/* get next entry */
		in >> nextinfilename;
	}

	/* stop day/date info */
	time_t stoptime;
	time(&stoptime);
	cout << "\n Batch start time  : " << ctime(&starttime);
	cout <<   " Batch stop time   : " << ctime(&stoptime);
}
开发者ID:samanseifi,项目名称:Tahoe,代码行数:50,代码来源:ExecutionManagerT.cpp

示例2: IsotropicT

EVPFDBaseT::EVPFDBaseT(ifstreamT& in, const FSMatSupportT& support) :
	ParameterInterfaceT("EVPFDBase"),
//  FDHookeanMatT(in, support),
  IsotropicT  (in),
  //fdt         (element.FEManager().TimeStep()),
  //ftime       (element.ElementSupport().Time()),
  //fStatus     (element.RunState()),
  fLocDisp    (support.LocalArray(LocalArrayT::kDisp)),
  fLocLastDisp(support.LocalArray(LocalArrayT::kLastDisp)),
  fKineticEqn (NULL),
  fSolver     (NULL),
  fSolverPtr  (new SolverWrapperEVPBase(*this)),
  fFtot       (kNSD),
  fs_ij       (kNSD),
  fc_ijkl     (dSymMatrixT::NumValues(kNSD))
{
ExceptionT::GeneralFail("EVPFDBaseT::EVPFDBaseT", "out of date");

  // input file
  StringT filename;
  in >> filename;
  
  // generate relative path in native format
  filename.ToNativePathName();
  StringT path;
  path.FilePath(in.filename());
  filename.Prepend(path);
  
  OpenExternal(fInput, filename, "EVPFDBaseT data");
  if (in.skip_comments())
    fInput.set_marker(in.comment_marker());

  // Lame's constants
  fmu     = Mu();
  flambda = Lambda();
  fbulk   = flambda + 2./3.*fmu;
}
开发者ID:samanseifi,项目名称:Tahoe,代码行数:37,代码来源:EVPFDBaseT.cpp

示例3: TakeParameterList

/* accept parameter list */
void ThermomechanicalCouplingManagerT::TakeParameterList(const ParameterListT& list)
{
	const char caller[] = "ThermomechanicalCouplingManagerT::TakeParameterList";

	/* inherited */
//	MultiManagerT::TakeParameterList(list);

	/* inherited - don't call direct base class method */
	ParameterInterfaceT::TakeParameterList(list);

	/* path to parameters file */
	StringT path;
	path.FilePath(fInputFile);
	TaskT task = kRun;

	/* parse/validate continuum input */
	StringT continuum_input = list.GetParameter("continuum_input");
	continuum_input.ToNativePathName();
	continuum_input.Prepend(path);
	ParameterListT continuum_params;
	ParseInput(continuum_input, continuum_params, true, true, true, fArgv);
			
	/* construct continuum solver */
	if (fCoarseComm->Size() != 1)
		ExceptionT::GeneralFail(caller, "parallel execution error");
	if (Size() > 1) /* change file name so output files are unique */  {
		StringT suffix;
		suffix.Suffix(continuum_input);
		continuum_input.Root();
		continuum_input.Append(".p", Rank());
		continuum_input.Append(suffix);
	}
	StringT continuum_output_file;
	continuum_output_file.Root(continuum_input);
	continuum_output_file.Append(".out");
	fCoarseOut.open(continuum_output_file);
	fCoarse = TB_DYNAMIC_CAST(FEManagerT_bridging*, FEManagerT::New(continuum_params.Name(), continuum_input, fCoarseOut, *fCoarseComm, fArgv, task));
	if (!fCoarse) ExceptionT::GeneralFail(caller, "could not construct continuum solver");
	fCoarse->TakeParameterList(continuum_params);

	/* parse/validate atomistic input */
	StringT atom_input = list.GetParameter("atom_input");
	atom_input.ToNativePathName();
	atom_input.Prepend(path);
	ParameterListT atom_params;
	ParseInput(atom_input, atom_params, true, true, true, fArgv);

	/* construct atomistic solver */
	if (Size() != fFineComm->Size())
		ExceptionT::GeneralFail(caller, "parallel execution error");
	StringT atom_output_file;
	atom_output_file.Root(atom_input);
	if (Size() > 1) atom_output_file.Append(".p", Rank());
	atom_output_file.Append(".out");
	fFineOut.open(atom_output_file);
	fFine = TB_DYNAMIC_CAST(FEManagerT_bridging*, FEManagerT::New(atom_params.Name(), atom_input, fFineOut, *fFineComm, fArgv, task));
	if (!fFine) ExceptionT::GeneralFail(caller, "could not construct atomistic solver");
	fFine->TakeParameterList(atom_params);

	/* check consistency between time managers */
	TimeManagerT* atom_time = fFine->TimeManager();
	TimeManagerT* continuum_time = fCoarse->TimeManager();

	/* use parameters from coarse scale solver */
	fTimeManager = fCoarse->TimeManager();
	fOutputFormat = fCoarse->OutputFormat();

	/* don't compute initial conditions */
	fFine->SetComputeInitialCondition(false);
	fCoarse->SetComputeInitialCondition(false);

	/* resolve bridging fields */
	const StringT& bridging_field = list.GetParameter("bridging_field");
	fFineField = fFine->NodeManager()->Field(bridging_field);
	if (!fFineField) ExceptionT::GeneralFail(caller, "could not resolve fine scale \"%s\" field", bridging_field.Pointer());
	fCoarseField = fCoarse->NodeManager()->Field(bridging_field);
	if (!fFineField) ExceptionT::GeneralFail(caller, "could not resolve coarse scale \"%s\" field", bridging_field.Pointer());

	/* resolve integrator types */
//	if (fFineField->Integrator().ImplicitExplicit() != fCoarseField->Integrator().ImplicitExplicit())
//		ExceptionT::GeneralFail(caller, "time integrator mismatch");
	fImpExp = fFineField->Integrator().ImplicitExplicit();

	/* collect the ghost atom ID list */
	ArrayT<StringT> ghost_atom_ID;
	const ParameterListT* ghosts = list.List("ghost_atom_ID_list");
	if (ghosts)	StringListT::Extract(*ghosts, ghost_atom_ID);

	/* configure projection/interpolation */
	NodeManagerT& fine_node_manager = *(fFine->NodeManager());	
	int group = 0;
	int order1 = 0;
	bool make_inactive = true;
	bool node_to_node = false;
	fFine->InitGhostNodes(fFineField->FieldName(), ghost_atom_ID, fCoarse->ProjectImagePoints());
	fCoarse->InitInterpolation(fFineField->FieldName(), fFine->GhostNodes(), fine_node_manager.InitialCoordinates());
	fCoarse->InitProjection(fFineField->FieldName(), *(fFine->CommManager()), fFine->NonGhostNodes(), fine_node_manager, make_inactive, node_to_node);

	/* send coarse/fine output through the fFine output */
//.........这里部分代码省略.........
开发者ID:samanseifi,项目名称:Tahoe,代码行数:101,代码来源:ThermomechanicalCouplingManagerT.cpp

示例4: TakeParameterList

/* accept parameter list */
void ABAQUS_UMAT_SS_BaseT::TakeParameterList(const ParameterListT& list)
{
	const char caller[] = "ABAQUS_UMAT_SS_BaseT::TakeParameterList";

	/* inherited */
	SSIsotropicMatT::TakeParameterList(list);

	fDebug = list.GetParameter("debug");
	fUseUMATModulus = list.GetParameter("use_UMAT_modulus");
	fNumElasticIterations = list.GetParameter("elastic_iterations");

	/* dimension work space */
	int nsd = NumSD();
	fStress.Dimension(nsd);
	fIPCoordinates.Dimension(nsd);
	fmat_nsd.Dimension(nsd);
	fsym_mat_nsd.Dimension(dSymMatrixT::int2DimensionT(nsd));

	/* open UMAT parameters file */
	StringT path;
	path.FilePath(MaterialSupport().InputFile());
	StringT params = list.GetParameter("UMAT_parameter_file");
	params.ToNativePathName();
	params.Prepend(path);
	ifstreamT in('#', params);
	if (!in.is_open())
		ExceptionT::GeneralFail(caller, "could not open file \"%s\"",
			params.Pointer());

	/* read ABAQUS-format input */
	bool nonsym = false;	
	Read_ABAQUS_Input(in, fUMAT_name, fProperties, fDensity, nstatv, nonsym);
	if (nonsym)
		fTangentType = GlobalT::kNonSymmetric;

	/* notify */
	if (fThermal->IsActive())
		cout << "\n ABAQUS_UMAT_SS_BaseT::Initialize: thermal strains must\n"
		     <<   "    be handled within the UMAT\n" << endl;
	
	/* UMAT dimensions */
	ndi = 3; // always 3 direct components
	if (nsd == 2)
		nshr = 1;
	else if (nsd == 3)
		nshr = 3;
	else
		ExceptionT::GeneralFail(caller, "unexpected dimension %d", nsd);
	ntens = ndi + nshr;

	/* modulus storage */
	if (fTangentType == GlobalT::kDiagonal)
		fModulusDim = ntens;
	else if (fTangentType == GlobalT::kSymmetric)
	{
		if (nsd == 2) fModulusDim = 10;
		else if (nsd == 3) fModulusDim = 21;
		else ExceptionT::GeneralFail(caller);
	}
	else if (fTangentType == GlobalT::kNonSymmetric)
		fModulusDim = ntens*ntens;
	else
		ExceptionT::GeneralFail(caller);

	/* storage block size (per ip) */
	fBlockSize = 0;
	fBlockSize += ntens;       // fstress
	fBlockSize += ntens;       // fstrain
	fBlockSize += 3;           // fsse_pd_cd
	fBlockSize += nstatv;      // fstatv
	fBlockSize += fModulusDim; // fmodulus
	fBlockSize += ntens;       // fstress_last
	fBlockSize += ntens;       // fstrain_last
	fBlockSize += 3;           // fsse_pd_cd_last
	fBlockSize += nstatv;      // fstatv_last
	
	/* argument array */
	fArgsArray.Dimension(fBlockSize);

	/* assign pointers */
	doublereal* parg = fArgsArray.Pointer();
	fstress.Set(ntens, parg);        parg += ntens;
	fstrain.Set(ntens, parg);        parg += ntens;
	fsse_pd_cd.Set(3, parg);         parg += 3;
	fstatv.Set(nstatv, parg);        parg += nstatv;
	fmodulus.Set(fModulusDim, parg); parg += fModulusDim;
	fstress_last.Set(ntens, parg);   parg += ntens;
	fstrain_last.Set(ntens, parg);   parg += ntens;
	fsse_pd_cd_last.Set(3, parg);    parg += 3;
	fstatv_last.Set(nstatv, parg);

	/* UMAT array arguments */
	fddsdde.Dimension(ntens);
	fddsdde = 0.0;
	fdstran.Dimension(ntens);
	fdstran = 0.0;
	fdrot.Dimension(3);   // always 3
	fdrot.Identity();
	fdfgrd0.Dimension(3); // always 3
//.........这里部分代码省略.........
开发者ID:samanseifi,项目名称:Tahoe,代码行数:101,代码来源:ABAQUS_UMAT_SS_BaseT.cpp


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