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

Method DefineModel

IO/IOSS/vtkIOSSModel.cxx:1256–1285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1254 Ioss::Region& region, const std::string& blockName) const = 0;
1255
1256 void DefineModel(Ioss::Region& region) const override
1257 {
1258 for (const auto& element : this->ElementCounts)
1259 {
1260 const int64_t elementCount = element.second;
1261 const unsigned char vtk_cell_type = element.first;
1262
1263 const Ioss::ElementTopology* elementTopology = nullptr;
1264 try
1265 {
1266 elementTopology = vtkIOSSUtilities::GetElementTopology(vtk_cell_type);
1267 }
1268 catch (std::runtime_error&)
1269 {
1270 continue;
1271 }
1272 const auto& elementType = elementTopology->name();
1273 const auto blockInfo = this->GetSubElementBlockInfo(vtk_cell_type, elementType);
1274
1275 auto entityBlock =
1276 this->CreateEntity(region.get_database(), blockInfo.second, elementType, elementCount);
1277 entityBlock->property_add(Ioss::Property("id", blockInfo.first));
1278 if (this->Writer->GetPreserveOriginalIds())
1279 {
1280 entityBlock->property_add(
1281 Ioss::Property("original_id", this->BlockId, Ioss::Property::ATTRIBUTE));
1282 }
1283 this->AddEntity(region, entityBlock);
1284 }
1285 }
1286
1287 void DefineTransient(Ioss::Region& region) const override
1288 {

Callers

nothing calls this directly

Calls 7

property_addMethod · 0.80
GetElementTopologyFunction · 0.70
PropertyClass · 0.50
nameMethod · 0.45
CreateEntityMethod · 0.45
AddEntityMethod · 0.45

Tested by

no test coverage detected