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

Conversation

Projects
None yet
3 participants
@endJunction
Copy link
Member

endJunction commented Jun 9, 2018

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 endJunction:MoveBCMeshes branch 4 times, most recently from 6206851 to 3475743 Jun 9, 2018


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(

This comment has been minimized.

@TomFischer

TomFischer Jun 12, 2018

Member

MeshComponentMap const cmap_subset = ...? ✔️

@TomFischer
Copy link
Member

TomFischer left a comment

Hope the changes will make the use of BoundaryConditions more easy. 👍

@endJunction endJunction force-pushed the endJunction:MoveBCMeshes branch 2 times, most recently from 8c72274 to ea71b6b Jun 12, 2018

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";

This comment has been minimized.

@TomFischer

TomFischer Jun 12, 2018

Member

Output should use logog. ✔️

@endJunction endJunction force-pushed the endJunction:MoveBCMeshes branch from ea71b6b to 2c72750 Jun 12, 2018

@chleh

chleh approved these changes Jun 13, 2018

Copy link
Collaborator

chleh left a comment

Only small things.

@@ -285,4 +286,7 @@ PropertyVector<T>* getOrCreateMeshProperty(Mesh& mesh,
return result;
}

std::unique_ptr<MeshLib::Mesh> createMeshFromElementSelection(

This comment has been minimized.

@chleh

chleh Jun 13, 2018

Collaborator

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;

This comment has been minimized.

@chleh

chleh Jun 13, 2018

Collaborator

Maybe reserve capacity.

nodes_map[n] = new MeshLib::Node(*n);
}

e->setNode(i, nodes_map[n]);

This comment has been minimized.

@chleh

chleh Jun 13, 2018

Collaborator

Minor: it could be reused here if it's not end().

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

This comment has been minimized.

@chleh

chleh Jun 13, 2018

Collaborator

No capture needed.

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; });

This comment has been minimized.

@chleh

chleh Jun 13, 2018

Collaborator

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,

This comment has been minimized.

@chleh

chleh Jun 13, 2018

Collaborator

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,

This comment has been minimized.

@chleh

chleh Jun 13, 2018

Collaborator

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,

This comment has been minimized.

@chleh

chleh Jun 13, 2018

Collaborator

const ref mesh? and so on :-)

{
std::vector<MeshLib::Mesh*> additional_meshes;

// TODO (naumov) add config for search length algorithms.

This comment has been minimized.

@chleh

chleh Jun 13, 2018

Collaborator

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(

This comment has been minimized.

@chleh

chleh Jun 13, 2018

Collaborator

Also maybe vector of unique_ptrs.

@endJunction

This comment has been minimized.

Copy link
Member Author

endJunction commented Jun 13, 2018

@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 endJunction force-pushed the endJunction:MoveBCMeshes branch from 46cd101 to 50602dc Jun 13, 2018

endJunction added some commits May 28, 2018

[MeL] Add createMeshFromElementSelection.
A mesh is constructed from (cloned) elements preserving
original element and node ids in two mesh properties.
[App] Construct additional meshes from geometries.
All named geometries are converted to meshes (with
same names).

These meshes will be used by the boundary conditions
and source term constructors.
[PL] Pass meshes to ProcessVariable construction.
Find a boundary mesh in the list of meshes instead of using GeoObjects
and pass it to the boundary condition creation.
[T] GWF. Add square_1x1 geometry with mid point.
The mid point is not available on all meshes.
[NL] MCM: getSubset checks for valid global idx.
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.
[PL] BCs: Fix doxygen warning seeing # as link.
warning: explicit link request to '_elements' could not be resolved
doxygen 1.8.14

@endJunction endJunction force-pushed the endJunction:MoveBCMeshes branch from 50602dc to a88f3f9 Jun 14, 2018

@TomFischer TomFischer merged commit 0ef6239 into ufz:master Jun 14, 2018

2 of 3 checks passed

continuous-integration/jenkins/pr-merge This commit cannot be built
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
deploy/netlify Deploy preview ready!
Details

@TomFischer TomFischer deleted the endJunction:MoveBCMeshes branch Jun 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.