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

Method InsertCellTypeAttributeInfo

IO/CellGrid/vtkCellGridIOQuery.cxx:106–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106bool vtkCellGridIOQuery::InsertCellTypeAttributeInfo(vtkCellGrid* grid,
107 const vtkCellAttribute::CellTypeInfo& cellTypeInfo, nlohmann::json& jsonInfo,
108 vtkStringToken cellTypeName)
109{
110 (void)grid;
111 bool ok = true;
112 nlohmann::json jCellTypeInfo;
113 nlohmann::json jCellBlock;
114 nlohmann::json arraysByRole;
115 for (const auto& entry : cellTypeInfo.ArraysByRole)
116 {
117 auto groupIt = this->ArrayLocations.find(entry.second);
118 if (groupIt == this->ArrayLocations.end())
119 {
120 ok = false;
121 std::string name = entry.second ? entry.second->GetName() : "null";
122 vtkWarningMacro("Unmanaged array " << entry.second << " (" << name << ") in role "
123 << entry.first.Data() << " skipped.");
124 continue;
125 }
126 arraysByRole[entry.first.Data()] =
127 nlohmann::json::array({ groupIt->second.Data(), entry.second->GetName() });
128 }
129 jCellBlock = { { "function-space", cellTypeInfo.FunctionSpace.Data() },
130 { "basis", cellTypeInfo.Basis.Data() }, { "order", cellTypeInfo.Order } };
131 if (!arraysByRole.empty())
132 {
133 jCellBlock["arrays"] = arraysByRole;
134 }
135 if (cellTypeInfo.DOFSharing.IsValid())
136 {
137 jCellBlock["dof-sharing"] = cellTypeInfo.DOFSharing.Data();
138 }
139 jCellTypeInfo[cellTypeName.Data()] = jCellBlock;
140 jsonInfo["cell-info"] = jCellTypeInfo;
141 return ok;
142}
143
144nlohmann::json& vtkCellGridIOQuery::AddMetadataEntry(vtkStringToken cellTypeName)
145{

Callers 1

QueryMethod · 0.80

Calls 7

arrayClass · 0.85
findMethod · 0.45
endMethod · 0.45
GetNameMethod · 0.45
DataMethod · 0.45
emptyMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected