Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/xdg/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@ constexpr int BVH_MAX_DEPTH = 64;
// geometric property type (e.g. material assignment or boundary condition)
// TODO: separate into VolumeProperty and SurfaceProperty
enum class PropertyType {
NOT_FOUND = -2,
BOUNDARY_CONDITION = -1,
MATERIAL = 0,
DENSITY = 1,
TEMPERATURE = 2
};

static const Property PROPERTY_NOT_FOUND {PropertyType::NOT_FOUND, "NOT_FOUND"};

static const std::map<PropertyType, std::string> PROP_TYPE_TO_STR =
{
{PropertyType::BOUNDARY_CONDITION, "BOUNDARY_CONDITION"},
Expand Down
4 changes: 3 additions & 1 deletion src/mesh_manager_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,15 @@ MeshManager::surface_has_property(MeshID surface, PropertyType type) const
Property
MeshManager::get_volume_property(MeshID volume, PropertyType type) const
{
if (surface_metadata_.count({volume, type}) == 0)
return PROPERTY_NOT_FOUND;
return volume_metadata_.at({volume, type});
}

Property
MeshManager::get_surface_property(MeshID surface, PropertyType type) const
{
if (surface_metadata_.count({surface, type}) == 0)
if (surface_metadata_.count({surface, type}) == 0)
return {PropertyType::BOUNDARY_CONDITION, "transmission"};
return surface_metadata_.at({surface, type});
}
Expand Down