Skip to content
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

Merged
merged 15 commits into from
Jun 14, 2018
Merged

Move bc meshes #2141

merged 15 commits into from
Jun 14, 2018

Conversation

endJunction
Copy link
Member

Succeeding the "Move BC meshes; preparations #2140" PR.

Three major parts:

  • Introduction of construct mesh from geometry function (which is mainly a copy from the Neumann BCs mesh creation with some generalizations).
  • Passing the meshes to the BCs and STs in ProcessVariable construction and choosing the meshes based on the geometry name from the config tree.
  • Updating creation of derived DOF table using the bulk and the boundary meshes.

@endJunction endJunction force-pushed the MoveBCMeshes branch 4 times, most recently from 6206851 to 3475743 Compare June 12, 2018 08:34

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(
Copy link
Member

@TomFischer TomFischer Jun 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MeshComponentMap const cmap_subset = ...? ✔️

Copy link
Member

@TomFischer TomFischer left a 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. 👍

@endJunction endJunction force-pushed the MoveBCMeshes branch 2 times, most recently from 8c72274 to ea71b6b Compare June 12, 2018 11:04
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";
Copy link
Member

@TomFischer TomFischer Jun 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output should use logog. ✔️

Copy link
Collaborator

@chleh chleh left a 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(
Copy link
Collaborator

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;
Copy link
Collaborator

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]);
Copy link
Collaborator

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(); });
Copy link
Collaborator

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; });
Copy link
Collaborator

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,
Copy link
Collaborator

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,
Copy link
Collaborator

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,
Copy link
Collaborator

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.
Copy link
Collaborator

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(
Copy link
Collaborator

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.

@endJunction
Copy link
Member Author

@chleh All valid points, thanks! I'll fix them today.
@TomFischer you can start rebasing your ConstraintBCs branch tomorrow, on top of this one---I don't expect any significant changes before merge.

endJunction and others added 15 commits June 14, 2018 11:51
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
@TomFischer TomFischer merged commit 0ef6239 into ufz:master Jun 14, 2018
@TomFischer TomFischer deleted the MoveBCMeshes branch June 14, 2018 10:32
@ogsbot
Copy link
Member

ogsbot commented Jun 19, 2020

OpenGeoSys development has been moved to GitLab.

See this pull request on GitLab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants