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
11 changes: 11 additions & 0 deletions include/mesh/mesh_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,17 @@ class MeshBase : public ParallelObject
std::string & subdomain_name(subdomain_id_type id);
const std::string & subdomain_name(subdomain_id_type id) const;

/**
* Sets the \p name for the provided \p id
* @param id The subdomain id to set the name for
* @param name The subdomain name
* @param synchronous Whether this method is being called across all mesh ranks. If this is true,
* then we don't have to register this collective container as being out of sync
*/
void set_subdomain_name(subdomain_id_type id,
const std::string & name,
bool synchronous = false);

/**
* \returns The id of the named subdomain if it exists,
* \p Elem::invalid_subdomain_id otherwise.
Expand Down
9 changes: 8 additions & 1 deletion src/mesh/mesh_base.C
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,14 @@ const std::string & MeshBase::subdomain_name(subdomain_id_type id) const
return iter->second;
}


void MeshBase::set_subdomain_name(const subdomain_id_type id,
const std::string & name,
const bool synchronous)
{
if (synchronous)
parallel_object_only();
_block_id_to_name[id] = name;
}


subdomain_id_type MeshBase::get_id_by_name(std::string_view name) const
Expand Down