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

Mortar methods generalizations and fixes #305

Merged
merged 36 commits into from
Jan 21, 2020
Merged

Mortar methods generalizations and fixes #305

merged 36 commits into from
Jan 21, 2020

Conversation

kinnala
Copy link
Owner

@kinnala kinnala commented Jan 11, 2020

This branch contains my work related to mortar methods.

@kinnala
Copy link
Owner Author

kinnala commented Jan 11, 2020

I'm still trying to figure out what changes are needed in order to support more general cases (such as contact problems where the boundaries do not initially match) in the future.

@gdmcbain
Copy link
Contributor

Indeed... I guess just trying increasingly trickier examples might reveal what works and what else might be needed?

Is one still fairly simple example that does have a discretely nonmatching interface the insulted wire, with the wire and insulation meshed independently at different mesh-sizes so that the two sides of the interface are different polygonal approximations of the one geometric circle?

@kinnala
Copy link
Owner Author

kinnala commented Jan 11, 2020

Thanks for the idea of circular mortar boundary. I'll try to support it also.

Uses a completely new logic for evaluating the global basis functions in
MortarBasis constructor. The idea is to use an explicit d-1 dimensional
space for the mortaring mesh.

In this d-1 dimensional space we have three meshes: two helper meshes created
from the original facet meshes via projection and one additional supermesh which
contains all nodes from both helper meshes.

Quadrature rule is generated for the supermesh and then inverse mapped using the
helper mesh reference mappings.  Next, the reference (facet) mapping for the
original mesh is used to get global quadrature points. Finally, these global
quadrature points are inverse mapped to the reference (volume) element of the
original mesh and basis functions evaluated.

This elaborate technique hopefully allows enough flexibility for general use
cases in the future.
@kinnala
Copy link
Owner Author

kinnala commented Jan 11, 2020

Now it's on a really ugly temporary state but I think the idea is now there. See the latest commit message for some spoilers. I'll continue on this next week.

@kinnala
Copy link
Owner Author

kinnala commented Jan 14, 2020

Fixes #215 .

@kinnala
Copy link
Owner Author

kinnala commented Jan 14, 2020

Instead of having explicit interface meshes, I've decided to use so-called mortar mappings that use similar interface meshes underneath. Then the syntax becomes quite nice since you only need to initialize two MortarBasis objects like this:

mb = [
    MortarBasis(m, e, mapping = mortar[0], intorder=2),
    MortarBasis(M, E, mapping = mortar[1], intorder=2)
]

where mortar[0] and mortar[1] correspond to the different sides of the interface. Here (m,e) and (M,E) are the two meshes and their elements.

@kinnala
Copy link
Owner Author

kinnala commented Jan 14, 2020

This is still in very raw state. I'll continue tomorrow. First I create a new example with "real" contact problem and then I tidy up the code.

@kinnala
Copy link
Owner Author

kinnala commented Jan 15, 2020

kontakti

@kinnala
Copy link
Owner Author

kinnala commented Jan 15, 2020

mises_p2_vs_q2

von Mises stress when calculating with TriP2 and Quad2 elements.

@kinnala
Copy link
Owner Author

kinnala commented Jan 15, 2020

Remaining work:

  • Separate MortarMapping code into a separate file and delete mesh_mortar.py
  • Make creation of MortarMapping more robust to various edge cases
  • Add tests

@kinnala kinnala changed the title WIP: Mortar methods generalizations and fixes Mortar methods generalizations and fixes Jan 18, 2020
@kinnala
Copy link
Owner Author

kinnala commented Jan 19, 2020

Circular mortar boundary is not yet working/tested but it should be as simple as adding a new constructor to MortarPair with slightly different definition for the projection (functions proj and param).

@kinnala kinnala requested a review from gdmcbain January 19, 2020 12:39
@kinnala
Copy link
Owner Author

kinnala commented Jan 19, 2020

I'm still writing ex04.rst but it will take a while because even writing down the equations for contact problems takes some meditation.

@kinnala
Copy link
Owner Author

kinnala commented Jan 20, 2020

Copy link
Contributor

@gdmcbain gdmcbain left a comment

Choose a reason for hiding this comment

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

I don't necessarily understand all of this, but it's impressive!

I might try to reproduce the solution for the insulated wire ex17 using this, then I might understand it better. The confusing part is how the bilinear and linear forms for the mortar matrices relate to the operators on the two meshes, probably because I'm less familiar with elasticity than heat transfer and fluid mechanics.

@kinnala
Copy link
Owner Author

kinnala commented Jan 21, 2020

I might try to reproduce the solution for the insulated wire ex17 using this

We would need to first add support for other projections than onto a predefined linear function.

In principle, it should be as easy as using different proj and param (local functions used in MortarPair.init_2D). In the case of insulated wire, you should probably do the projection via arctan of the angle of the point in polar coordinates.

In the literature, there are also ways to generalize this (such as closest point search) but I have not looked into it. I just know that it is possible.

My next goal is to create MortarPair.init_3D for mortaring 3D problems. It is somewhat more involved to create the integration mesh. My current plan is to use libsupermesh (https://bitbucket.org/libsupermesh/libsupermesh/src) and possibly create Python bindings for it. The idea is same: project points into d-1 dimensional domain, create integration mesh (or "supermesh", in MortarPair.init_2D it is simply one call to np.unique), generate d point quadrature rule in the integration mesh and map them into the global coordinate system to check that the orientation of the points matches over the global mortaring interface. If orientation does not match, perturb index columns in the auxiliary meshes so that they match.

@kinnala kinnala merged commit 110f7a2 into master Jan 21, 2020
@kinnala kinnala deleted the mortar-methods-fix branch January 21, 2020 10:14
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.

2 participants