-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move bc meshes #2141
Move bc meshes #2141
Conversation
6206851
to
3475743
Compare
|
||
int const selected_component_id = 1; | ||
|
||
// Subset the original cmap. | ||
MeshComponentMap cmap_subset = | ||
cmap->getSubset({selected_component_id}, selected_component); | ||
MeshComponentMap cmap_subset = cmap->getSubset( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MeshComponentMap const cmap_subset = ...
? ✔️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope the changes will make the use of BoundaryConditions more easy. 👍
8c72274
to
ea71b6b
Compare
NumLib/DOF/LocalToGlobalIndexMap.cpp
Outdated
auto mesh_component_map = _mesh_component_map.getSubset( | ||
global_component_ids, _mesh_subsets, new_mesh_subset); | ||
#ifndef NDEBUG | ||
std::cout << "bc mesh component map:\n" << mesh_component_map << "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Output should use logog. ✔️
ea71b6b
to
2c72750
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only small things.
MeshLib/Mesh.h
Outdated
@@ -285,4 +286,7 @@ PropertyVector<T>* getOrCreateMeshProperty(Mesh& mesh, | |||
return result; | |||
} | |||
|
|||
std::unique_ptr<MeshLib::Mesh> createMeshFromElementSelection( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation missing.
DBUG("Found %d elements in the mesh", elements.size()); | ||
|
||
// Store bulk element ids for each of the new elements. | ||
std::vector<std::size_t> bulk_element_ids; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe reserve capacity.
MeshLib/Mesh.cpp
Outdated
nodes_map[n] = new MeshLib::Node(*n); | ||
} | ||
|
||
e->setNode(i, nodes_map[n]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: it
could be reused here if it's not end()
.
MeshLib/Mesh.cpp
Outdated
std::vector<std::size_t> bulk_node_ids; | ||
std::transform(begin(nodes_map), end(nodes_map), | ||
std::back_inserter(bulk_node_ids), | ||
[&](auto const& pair) { return pair.first->getID(); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No capture needed.
MeshLib/Mesh.cpp
Outdated
std::vector<MeshLib::Node*> element_nodes; | ||
std::transform(begin(nodes_map), end(nodes_map), | ||
std::back_inserter(element_nodes), | ||
[&](auto const& pair) { return pair.second; }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no capture needed.
BaseLib::ConfigTree const& config, | ||
const NumLib::LocalToGlobalIndexMap& dof_table, std::size_t const mesh_id, | ||
std::size_t const node_id, const int variable_id, const int component_id, | ||
BaseLib::ConfigTree const& config, MeshLib::Mesh& st_mesh, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const ref mesh?
@@ -15,9 +15,9 @@ | |||
namespace ProcessLib | |||
{ | |||
std::unique_ptr<NodalSourceTerm> createNodalSourceTerm( | |||
BaseLib::ConfigTree const& config, | |||
BaseLib::ConfigTree const& config, MeshLib::Mesh& st_mesh, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const ref mesh?
std::size_t const node_id, | ||
const int variable_id, const int component_id, | ||
std::size_t const bulk_mesh_id, | ||
MeshLib::Mesh& st_mesh, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const ref mesh? and so on :-)
{ | ||
std::vector<MeshLib::Mesh*> additional_meshes; | ||
|
||
// TODO (naumov) add config for search length algorithms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious how long it takes until the first users will complain, because their BCs are too "shitty" 😄
/// For each named geometry in the give geo_objects (defined on the given \c | ||
/// mesh) constructs a mesh corresponding to the geometry with mappings to the | ||
/// bulk mesh elements and nodes. | ||
std::vector<MeshLib::Mesh*> constructAdditionalMeshesFromGeoObjects( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also maybe vector of unique_ptrs.
@chleh All valid points, thanks! I'll fix them today. |
46cd101
to
50602dc
Compare
A mesh is constructed from (cloned) elements preserving original element and node ids in two mesh properties.
All named geometries are converted to meshes (with same names). These meshes will be used by the boundary conditions and source term constructors.
Find a boundary mesh in the list of meshes instead of using GeoObjects and pass it to the boundary condition creation.
If the boundary mesh is larger then the definition region of the bulk component, then a nop is returned. This usually indicates wrong geometry or something horrible.
The mid point is not available on all meshes.
warning: explicit link request to '_elements' could not be resolved doxygen 1.8.14
50602dc
to
a88f3f9
Compare
OpenGeoSys development has been moved to GitLab. |
Succeeding the "Move BC meshes; preparations #2140" PR.
Three major parts: