MCPcopy Create free account
hub / github.com/Kitware/VTK / update

Method update

IO/Geometry/vtkOpenFOAMReader.cxx:5870–5991  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Set contents from dictionary information read from the polyMesh/boundary file

Source from the content-addressed store, hash-verified

5868//------------------------------------------------------------------------------
5869// Set contents from dictionary information read from the polyMesh/boundary file
5870bool vtkFoamBoundaries::update(const vtkFoamDict& dict)
5871{
5872 auto& patches = *this;
5873 patches.clearAll();
5874 patches.resize(dict.size());
5875 auto& inGroups = patches.groups;
5876
5877 const auto nBoundaries = static_cast<vtkIdType>(patches.size());
5878
5879 vtkIdType endFace = -1; // for sanity check
5880 vtkTypeInt64 nBoundaryFaces = 0;
5881
5882 for (vtkIdType patchi = 0; patchi < nBoundaries; ++patchi)
5883 {
5884 // The name/dictionary, from "polyMesh/boundary" entry
5885 const vtkFoamEntry* eptr = dict[patchi];
5886 const std::string& patchName = eptr->GetKeyword();
5887 const vtkFoamDict& patchDict = eptr->Dictionary();
5888
5889 // The patch entry to populate
5890 vtkFoamPatch& patch = patches[patchi];
5891 patch.index_ = patchi;
5892 patch.offset_ = nBoundaryFaces;
5893 patch.type_ = vtkFoamPatch::GEOMETRICAL;
5894 patch.owner_ = true; // Patch owner (processor patch)
5895
5896 patch.name_ = patchName;
5897 if ((eptr = patchDict.Lookup("type")) == nullptr)
5898 {
5899 this->error() // Report errors
5900 << "No 'type' entry found for patch: " << patch.name_;
5901 return false;
5902 }
5903 const std::string patchTypeName(eptr->ToString());
5904
5905 if ((eptr = patchDict.Lookup("startFace")) == nullptr)
5906 {
5907 this->error() // Report errors
5908 << "No 'startFace' entry found for patch: " << patch.name_;
5909 return false;
5910 }
5911 patch.start_ = eptr->ToInt();
5912
5913 if ((eptr = patchDict.Lookup("nFaces")) == nullptr)
5914 {
5915 this->error() // Report errors
5916 << "No 'nFaces' entry found for patch: " << patch.name_;
5917 return false;
5918 }
5919 patch.size_ = eptr->ToInt();
5920
5921 // Size, consistency sanity checks
5922 if (patch.start_ < 0 || patch.size_ < 0)
5923 {
5924 this->error() // Report errors
5925 << "The startFace:" << patch.start_ << " or nFaces:" << patch.size_
5926 << " are negative for patch " << patch.name_;
5927 return false;

Callers 15

paintEventMethod · 0.45
frameFunction · 0.45
scheduleRenderMethod · 0.45
handleScreenChangeMethod · 0.45
UpdateMethod · 0.45
UpdateMethod · 0.45
UpdateMethod · 0.45
SetUseColumnViewMethod · 0.45
UpdateMethod · 0.45
setupUIFunction · 0.45

Calls 13

LookupMethod · 0.80
clearAllMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
errorMethod · 0.45
ToStringMethod · 0.45
ToIntMethod · 0.45
endFaceMethod · 0.45
IsLabelMethod · 0.45
GetTypeMethod · 0.45
GetNumberOfValuesMethod · 0.45
GetValueMethod · 0.45

Tested by 15

add_actionMethod · 0.36
add_toggleMethod · 0.36
DoItMethod · 0.36
testvtkTkRenderWidgetMethod · 0.36
testAllMaskBitsMethod · 0.36
testAllBlendsFloatMethod · 0.36
testAllBlendsMethod · 0.36
testAllShrinksMethod · 0.36
testWipeMethod · 0.36
checkSideRoundTripMethod · 0.36
testSideRoundTripMethod · 0.36