long long Create_Pamgen_Mesh(const char * file_char_array, long long dimension, long long rank, long long num_procs, long long max_int) /*****************************************************************************/ { PAMGEN_NEVADA::Inline_Mesh_Desc * imd = NULL; PAMGEN_NEVADA::Inline_Mesh_Desc * fimd = NULL; std::string fn("PAMGEN LIBRARY"); PAMGEN_NEVADA::Partition::partition_count = 0; // copy input into stream, no file operations in library. std::stringstream input_stream; long long sfca = strlen(file_char_array); input_stream.write(file_char_array,sfca); long long pec = 0; fimd = PAMGEN_NEVADA::Parse_Inline_Mesh(fn, input_stream, pec, dimension, max_int); if(pec > 0)return ERROR_PARSING_DEFINITION; if(!fimd)return ERROR_CREATING_IMD; imd = fimd; ms_lt::Mesh_Specification * ams = NULL; while(imd){ ams = buildMeshSpecification_LT(imd, rank, num_procs); if(!ams)return ERROR_CREATING_MS; ms_lt::Mesh_Specification::Add_MS(ams); imd = imd->next; } ms_lt::Mesh_Specification * nms = ms_lt::Mesh_Specification::first_ms_static_storage->consolidateMS(); ms_lt::Mesh_Specification::Replace_MS(nms); return ERROR_FREE_CREATION; }
long long Create_Pamgen_Mesh(const char * file_char_array, long long dimension, long long rank, long long num_procs, long long max_int) /*****************************************************************************/ { PAMGEN_NEVADA::Inline_Mesh_Desc * imd = NULL; std::string fn("PAMGEN LIBRARY"); // copy input into stream, no file operations in library. std::stringstream input_stream; long long sfca = strlen(file_char_array); input_stream.write(file_char_array,sfca); long long pec = 0; imd = PAMGEN_NEVADA::Parse_Inline_Mesh(fn, input_stream, pec, dimension, max_int); if(pec > 0)return ERROR_PARSING_DEFINITION; if(!imd)return ERROR_CREATING_IMD; ms_lt::Mesh_Specification * ams = buildMeshSpecification_LT(imd, rank, num_procs); if(!ams)return ERROR_CREATING_MS; return ERROR_FREE_CREATION; }