bool BoundaryRestrictable::hasBoundaryMaterialPropertyHelper(const std::string & prop_name) const { // Reference to MaterialWarehouse for testing and retrieving boundary ids const MaterialWarehouse & warehouse = _bnd_feproblem->getMaterialWarehouse(); // Complete set of BoundaryIDs that this object is defined const std::set<BoundaryID> & ids = hasBoundary(Moose::ANY_BOUNDARY_ID) ? meshBoundaryIDs() : boundaryIDs(); // Loop over each BoundaryID for this object for (const auto & id : ids) { // Storage of material properties that have been DECLARED on this BoundaryID std::set<std::string> declared_props; // If boundary materials exist, populated the set of properties that were declared if (warehouse.hasActiveBoundaryObjects(id)) { const std::vector<MooseSharedPointer<Material> > & mats = warehouse.getActiveBoundaryObjects(id); for (const auto & mat : mats) { const std::set<std::string> & mat_props = mat->getSuppliedItems(); declared_props.insert(mat_props.begin(), mat_props.end()); } } // If the supplied property is not in the list of properties on the current id, return false if (declared_props.find(prop_name) == declared_props.end()) return false; } // If you get here the supplied property is defined on all boundaries return true; }
bool BoundaryRestrictable::hasBoundaryMaterialPropertyHelper(const std::string & prop_name) const { // Reference to MaterialWarehouse for testing and retrieving boundary ids MaterialWarehouse & material_warehouse = _bnd_feproblem->getMaterialWarehouse(_bnd_tid); // Complete set of BoundaryIDs that this object is defined const std::set<BoundaryID> & ids = hasBoundary(Moose::ANY_BOUNDARY_ID) ? meshBoundaryIDs() : boundaryIDs(); // Loop over each BoundaryID for this object for (std::set<BoundaryID>::const_iterator id_it = ids.begin(); id_it != ids.end(); ++id_it) { // Storage of material properties that have been DECLARED on this BoundaryID std::set<std::string> declared_props; // If boundary materials exist, populated the set of properties that were declared if (material_warehouse.hasBoundaryMaterials(*id_it)) { std::vector<Material *> mats = material_warehouse.getBoundaryMaterials(*id_it); for (std::vector<Material *>::iterator mat_it = mats.begin(); mat_it != mats.end(); ++mat_it) { const std::set<std::string> & mat_props = (*mat_it)->getSuppliedItems(); declared_props.insert(mat_props.begin(), mat_props.end()); } } // If the supplied property is not in the list of properties on the current id, return false if (declared_props.find(prop_name) == declared_props.end()) return false; } // If you get here the supplied property is defined on all boundaries return true; }