MCPcopy Create free account
hub / github.com/Kitware/ParaView / GetCellsAscii

Function GetCellsAscii

Examples/Plugins/VisItReader/avtFluentFileFormat.C:2433–2478  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2431
2432//----------------------------------------------------------------------------
2433void avtFluentFileFormat::GetCellsAscii()
2434{
2435 if (CaseBuffer.at(5) == '0')
2436 { // Cell Info
2437 int start = CaseBuffer.find('(', 1);
2438 int end = CaseBuffer.find(')',1);
2439 string info = CaseBuffer.substr(start+1,end-start-1 );
2440 auto result = vtk::scan<int, int, int, int>(info, "{:x} {:x} {:x} {:d}");
2441 auto& [zoneId, firstIndex, lastIndex, type] = result->values();
2442 Cells.resize(lastIndex);
2443 }
2444 else
2445 { // Cell Definitions
2446 int start = CaseBuffer.find('(', 1);
2447 int end = CaseBuffer.find(')',1);
2448 string info = CaseBuffer.substr(start+1,end-start-1 );
2449 auto result = vtk::scan<int, int, int, int, int>(info, "{:x} {:x} {:x} {:d} {:d}");
2450 auto& [zoneId, firstIndex, lastIndex, type, elementType] = result->values();
2451
2452 if (elementType == 0)
2453 {
2454 int dstart = CaseBuffer.find('(', 5);
2455 int dend = CaseBuffer.find(')', dstart+1);
2456 string pdata = CaseBuffer.substr(dstart+1, dend-start-1);
2457 istringstream pdatastream;
2458 pdatastream.str(pdata);
2459 for (int i = firstIndex; i <=lastIndex; i++)
2460 {
2461 pdatastream >> Cells[i].type;
2462 Cells[i-1].zone = zoneId;
2463 Cells[i-1].parent = 0;
2464 Cells[i-1].child = 0;
2465 }
2466 }
2467 else
2468 {
2469 for (int i = firstIndex; i <=lastIndex; i++)
2470 {
2471 Cells[i-1].type = elementType;
2472 Cells[i-1].zone = zoneId;
2473 Cells[i-1].parent = 0;
2474 Cells[i-1].child = 0;
2475 }
2476 }
2477 }
2478}
2479
2480//----------------------------------------------------------------------------
2481void avtFluentFileFormat::GetCellsBinary()

Callers 1

ParseCaseFileFunction · 0.85

Calls 4

substrMethod · 0.80
findMethod · 0.45
valuesMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected