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

Function GetFacesBinary

Examples/Plugins/VisItReader/avtFluentFileFormat.C:2585–2642  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2583
2584//----------------------------------------------------------------------------
2585void avtFluentFileFormat::GetFacesBinary()
2586{
2587 int start = CaseBuffer.find('(', 1);
2588 int end = CaseBuffer.find(')',1);
2589 string info = CaseBuffer.substr(start+1,end-start-1 );
2590 auto result = vtk::scan<int, int, int, int, int>(info, "{:x} {:x} {:x} {:x} {:x}");
2591 auto& [zoneId, firstIndex, lastIndex, bcType, faceType] = result->values();
2592
2593 int dstart = CaseBuffer.find('(', 7);
2594 int dend = CaseBuffer.find(')', dstart+1);
2595 int numberOfNodesInFace = 0;
2596 int ptr = dstart + 1;
2597 for (int i = firstIndex; i <=lastIndex; i++)
2598 {
2599 if ((faceType == 0) || (faceType == 5))
2600 {
2601 numberOfNodesInFace = GetCaseBufferInt(ptr);
2602 ptr = ptr + 4;
2603 }
2604 else
2605 {
2606 numberOfNodesInFace = faceType;
2607 }
2608
2609 Faces[i-1].nodes.resize(numberOfNodesInFace);
2610
2611 for (int k = 0; k<numberOfNodesInFace; k++)
2612 {
2613 Faces[i-1].nodes[k] = GetCaseBufferInt(ptr);
2614 Faces[i-1].nodes[k]--;
2615 ptr = ptr + 4;
2616 }
2617
2618 Faces[i-1].c0 = GetCaseBufferInt(ptr);
2619 ptr = ptr + 4;
2620 Faces[i-1].c1 = GetCaseBufferInt(ptr);
2621 ptr = ptr + 4;
2622 Faces[i-1].c0--;
2623 Faces[i-1].c1--;
2624 Faces[i-1].type = numberOfNodesInFace;
2625 Faces[i-1].zone = zoneId;
2626 Faces[i-1].periodicShadow = 0;
2627 Faces[i-1].parent = 0;
2628 Faces[i-1].child = 0;
2629 Faces[i-1].interfaceFaceParent = 0;
2630 Faces[i-1].ncgParent = 0;
2631 Faces[i-1].ncgChild = 0;
2632 Faces[i-1].interfaceFaceChild = 0;
2633 if (Faces[i-1].c0 >= 0)
2634 {
2635 Cells[Faces[i-1].c0].faces.push_back(i-1);
2636 }
2637 if (Faces[i-1].c1 >= 0)
2638 {
2639 Cells[Faces[i-1].c1].faces.push_back(i-1);
2640 }
2641 }
2642}

Callers 1

ParseCaseFileFunction · 0.85

Calls 6

GetCaseBufferIntFunction · 0.85
substrMethod · 0.80
push_backMethod · 0.80
findMethod · 0.45
valuesMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected