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


C++ ExoII_Read::File_ID方法代码示例

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


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

示例1: Create_File

int Create_File(ExoII_Read& file1, ExoII_Read& file2,
                const string& diffile_name, bool *diff_found)
{
  // Multiple modes:
  // summary_flag == true   --> Single file, output summary and variable names, return
  // diffile_name == ""     --> Dual file, output summary, variable names, check compatability,
  // diffile_name != ""     --> Three files (2 in, 1 out)
  //                            create output file which is diff of input.
  //                            output summary, variable names, check compatability
  // quiet_flag == true     --> don't output summary information


  SMART_ASSERT(!specs.summary_flag);
  //========================================================================
  // From here on down, have two input files and possibly 1 output file...
  // Create output file.

  int out_file_id = -1;
  if (!diffile_name.empty()) {

    // Take minimum word size for output file.
    int iows = file1.IO_Word_Size() < file2.IO_Word_Size()
      ? file1.IO_Word_Size() : file2.IO_Word_Size();
    int compws = sizeof(double);

    out_file_id = ex_create(diffile_name.c_str(), EX_CLOBBER, &compws, &iows);
    SMART_ASSERT(out_file_id >= 0);
    ex_copy(file1.File_ID(), out_file_id);
  }

  if (!specs.quiet_flag) {
    if (out_file_id >= 0) {  // The files are to be differenced .. just list names.
      if (specs.coord_tol.type != IGNORE) {
	SMART_ASSERT(specs.coord_tol.type == RELATIVE ||
                     specs.coord_tol.type == ABSOLUTE ||
		     specs.coord_tol.type == COMBINED ||
		     specs.coord_tol.type == EIGEN_REL ||
                     specs.coord_tol.type == EIGEN_ABS ||
		     specs.coord_tol.type == EIGEN_COM);
	sprintf(buf, "Coordinates:  tol: %8g %s, floor: %8g",
		specs.coord_tol.value, specs.coord_tol.typestr(), specs.coord_tol.floor);
	std::cout << buf << std::endl;
      }
      else
	std::cout << "Locations of nodes will not be considered.\n";

      if (specs.time_tol.type != IGNORE) {
	SMART_ASSERT(specs.time_tol.type == RELATIVE ||
                     specs.time_tol.type == ABSOLUTE ||
		     specs.time_tol.type == COMBINED ||
		     specs.time_tol.type == EIGEN_REL ||
                     specs.time_tol.type == EIGEN_ABS ||
		     specs.time_tol.type == EIGEN_COM);
	sprintf(buf, "Time step values:  tol: %8g %s, floor: %8g",
		specs.time_tol.value,	specs.time_tol.typestr(), specs.time_tol.floor);
	std::cout << buf << std::endl;
      }
      else
	std::cout << "Time step time values will not be differenced.\n";

      output_diff_names("Global",  specs.glob_var_names);
      output_diff_names("Nodal",   specs.node_var_names);
      output_diff_names("Element", specs.elmt_var_names);
      output_diff_names("Element Attribute", specs.elmt_att_names);
      output_diff_names("Nodeset", specs.ns_var_names);
      output_diff_names("Sideset", specs.ss_var_names);
    }
    else {  // The files are to be compared .. echo additional info.
      if (Tolerance::use_old_floor) {
	std::cout << "WARNING: Using old definition of floor tolerance. |a-b|<floor.\n\n";
      }
      if (specs.coord_tol.type != IGNORE) {
	SMART_ASSERT(specs.coord_tol.type == RELATIVE ||
                     specs.coord_tol.type == ABSOLUTE ||
		     specs.coord_tol.type == COMBINED ||
		     specs.coord_tol.type == EIGEN_REL ||
                     specs.coord_tol.type == EIGEN_ABS ||
		     specs.coord_tol.type == EIGEN_COM);
	sprintf(buf, "Coordinates will be compared .. tol: %8g (%s), floor: %8g",
		specs.coord_tol.value, specs.coord_tol.typestr(), specs.coord_tol.floor);
	std::cout << buf << std::endl;
      } else {
	std::cout << "Locations of nodes will not be compared." << std::endl;
      }

      if (specs.time_tol.type != IGNORE) {
	SMART_ASSERT(specs.time_tol.type == RELATIVE ||
                     specs.time_tol.type == ABSOLUTE ||
		     specs.time_tol.type == COMBINED ||
		     specs.time_tol.type == EIGEN_REL ||
                     specs.time_tol.type == EIGEN_ABS ||
		     specs.time_tol.type == EIGEN_COM);
	sprintf(buf, "Time step values will be compared .. tol: %8g (%s), floor: %8g",
		specs.time_tol.value, specs.time_tol.typestr(), specs.time_tol.floor);
	std::cout << buf << std::endl;
      } else {
	std::cout << "Time step time values will not be compared." << std::endl;
      }

      output_compare_names("Global",  specs.glob_var_names, specs.glob_var,
//.........这里部分代码省略.........
开发者ID:IoannisSt,项目名称:moose,代码行数:101,代码来源:create_file.C


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