Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Periodic 3D mesh aligned with bounding cube cgal-discuss

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Periodic 3D mesh aligned with bounding cube cgal-discuss


Chronological Thread 
  • From: Mael Rouxel-Labbé <>
  • To:
  • Subject: Re: [cgal-discuss] Periodic 3D mesh aligned with bounding cube cgal-discuss
  • Date: Wed, 17 Mar 2021 09:23:23 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-hdrordr: A9a23:inRdBqEzF4hNhybZpLqF65HXdLJzesId70hD6mlYVQFVfsuEl8qngfQc0lvOhCwMXWw78OrsBICrR3TA+ZlppawYOrm/VAfr0VHYVL1Kx43k3jHmBmnC7eZbz6htaOxTD9f3AFh8g6/BkXCFOvwnx8SK973tuPfGwx5WPGdXQoxp8gsRMHf4LmRYXw9DbKBYKLO94Y59qyOkaTAraK2Adx44dszig/GOq578ex4BAHccmW2zpBel8qTzHRTd/jp2aUIt/Z4Y/WLIkxP068yY2pnRoCP07GPd449bn9Hs0LJ4ZfCksNQfKTnnl2+TC7hJZrvqhl4Iid205E1vuNfBpApIBbUX11rhOkeLoF/G3gnt1ysP8hbZpWOwsD/Evs28eSkzAcZbwaJVGyGpkHYIjZVC6+Zw5kq8nbJqNz+oplWA2/H4Ey5Q0nCMiV4Zu8gpoxVkIPYjQY4Ukrdaxnp8NK08NB/XgbpXatVTMA==
  • Ironport-phdr: A9a23:Dm4hvxAjeyMkojWU+AplUyQUDkYY04WcBSYlr6E/grcLSJyIuqrYVGTh7PlgxGXEQZ/co6odzbaP4ua5AjdLsM7JmUtBWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYdFRrlKAV6OPn+FJLMgMSrzeCy/IDYbxlViDanbr5+MRG7oR/MusQYj4ZuJaI8xgfUqXZUZupawn9lK0iOlBjm/Mew+5Bj8yVUu/0/8sNLTLv3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d1KY9klkmWdBPOHa9hq9/8gjTH5TGn1+Yl6asb6Qc3TTC+H2NzWqUpE1YVQlwXrjbUn0HfUvWqMj55lvbQ7+pFLQnLhNNyc6cJatObd3klU1GRPP5N9XefW2xgWW9CBiVyr+WbIrlYX8R3CLDCEgEiQwT+2iJNRQmCiegpWLREiBuGErzb0/27eVysm+3QlUoww2SdU1uy6K1+gIJhfybU/4cwr0Etz0lqzltAVm93snWBMadpwp6Z6VRetI94FFd1WLYrQNxJJKgL7oxzmMYaBl96kPyyw1sWMIHitkvtHpszQxoKKve3kkGbCKdxZm3O7vZLS758xmrLqLXwVrDy83Fx6EU9f4EpkX/6QG1ClI5oTIgyMhQy3La55PQDQNUX4i2SVcy7xE9prfUZW426IrQkHFtKqKpqSSR59V8D+QszlOsfsxULbifPA70CcwTQca0e8IwnF38SxsJONdo87MkMsfjU/KM0i/jaONpkTbgl2Na8I15lEaF/SBxYuHF2JMI3+uJ0AKMSzDmnRGqtcWhytMMXi0bAmfqkXusP4VWfKAnIddjIVfrGNW+w5BFv7CoQ2RRnHasClQD1dOzaBSbZED6xxwW3kMS8yTPsRv99CR9lnQSloTa3CHKxIzKKFwCPTAaAmxrjFOpJpWoydcEXA6uYhR7zHON1QPB36Fe4Z9HASzWSEZMcTLxKglKXaa3s7eeed9B4Zg0tj9GFu+7ZALCIoM=

Hello,

Assuming you cannot modify your FEM formulation to simply use a single mesh as Iordan was describing, do you wish to have the facets to be aligned on the side of the cube to identify them as boundary, or because it is necessary in your FEM formulation that they geometrically lie on the cube's side ? If it's not a geometrical constraint, extracting a canonical block of tetrahedral elements with well-identified boundary faces that reproduces periodically in all three directions (basically, what you see in the drawing in the manual) is very easy to do.

Best,
Mael

Does the FEM formulation require the boundary tets to have their boundary face fully aligned with a side of the cube? After all,

On 17/03/2021 01:19, Matthew Russell ( via cgal-discuss Mailing List) wrote:
Dear Iordan,

Thanks for this, and, as far as I'm concerned, no need to apologise.
It's an interesting way to look at the the problem and it makes a lot
of sense conceptually. However, in my experience, it is not how PBCs
are usually implemented in finite element solvers. Do you know of any
examples describing how to reformulate a periodic problem as a problem
on a torus or it's numerical implementation? The problem I'm solving
is Stokes flow in a periodic unit cell, with no-slip on the
non-periodic part of the boundary (the part that's kind-of
"inward-facing"; see `gmsh.jpg` in my first post).

Thanks,
Matt

On Tue, 16 Mar 2021 at 23:30, Iordan Iordanov <> wrote:
Dear Matthew, Monique, all,

Sorry to appear out of nowhere like this, but I would like to offer another
perspective, perhaps.

Matthew, you mention that in your FEM problem you want to define periodic
boundary conditions.
The need for specifying periodic boundary conditions in FEM problems comes
from the fact that
traditional meshes do not have a way to represent the periodic medium over
which the equation
to be solved is defined. In other words, you need to discretize your domain
so that the vertices and
faces coincide neatly, so that you know how to compute interactions and value
propagations
periodically, from one side to the other.

The thing is, with a periodic mesh, you don't need to specify any boundary
conditions, because there
is no boundary. The CGAL periodic 3D mesh package represents a domain that "wraps
around" in
3 dimensions, as the name implies, so the only things you need to define are
the equation itself and the
initial conditions. In this setting, boundary conditions actually do not make
sense -- if you try to apply
boundary conditions, you would end up splitting a torus only to glue it back
together.

Why not just use the torus? :)

I am guessing it will require some re-formulating of your problem, but you
will get much better results
in the end, and your computation will be more efficient. The reason is that,
when you define a traditional
mesh, you need to store the boundary elements (vertices/faces) twice.
Moreover, you need to keep track
of which vertices coincide and when not to count interactions twice, so it is
a bit messy. With the periodic
mesh, you really don't save anything extra, and all the elements are unique.
Every element knows its
neighbors so computations are much more straightforward conceptually.

I hope this has some meaning for you, and, once more, sorry for butting in
like this.

Best of luck and best regards,
- Iordan

On Wed, Mar 17, 2021 at 3:29 AM Matthew Russell <> wrote:
Dear Monique,

Thanks - I saw that example and have tried using a unit cube (defined
implicitly) as the second function in the vector but I don't think it
solves my problem. Is this what you had in mind? The resulting mesh is
similar to the example attached to my original email, except that it
can also include the region with the opposite sign (which I don't
require), depending on the chosen sign vectors.

Apologies if I described the problem poorly! I would like to create a
collection of different meshes, one for each of a collection of
implicitly-defined regions, so I don't think it's a multiple domains
problem. On each mesh I will run a separate finite element simulation
with periodic boundary conditions. We can ignore the multiple meshes
here and consider just one. To make it easy to identify the periodic
boundaries in the FEM code, my first thought was to try to create
meshes where the cells at the boundaries lie on the facets of the
bounding cube as I mentioned earlier. It seems this isn't possible
with the periodic mesh package, but there may be a workaround using
the regular 3D mesh package as Mael suggested. I was wondering if
someone had any further hints on how to achieve this? It seems like a
difficult problem to manually place vertices on the intersection
between the bound cube's facets and the implicit region. I really
appreciate all your help with this!

Thanks,
Matt

On Tue, 16 Mar 2021 at 15:44, Monique Teillaud



On Tue, 16 Mar 2021 at 15:44, Monique Teillaud

<> wrote:
Dear Matthew,

If I understand correctly (I am not sure) you would like to mesh multiple
domains.
Does this example help you?
https://doc.cgal.org/latest/Periodic_3_mesh_3/index.html#title19

Best,
--
Monique Teillaud
https://members.loria.fr/Monique.Teillaud/
INRIA Nancy - Grand Est, LORIA
Institut National de Recherche en Informatique et Automatique

----- Le 16 Mar 21, à 15:48, cgal-discuss a écrit :

Dear Monique,

I agree that adding points on the facets of the bounding cube in the
right places would be a way to solve this. But this technique requires
a description of the regions on each facet that should be
triangulated. This is difficult because many of the surfaces I am
dealing with are defined implicitly and do not cover the entirety of
the cube's facets. Is there something in CGAL that would help do this?

However, I suppose my actual issue is being able to accurately specify
boundary conditions. I was trying to make this easy by forcing the
boundaries of the mesh to align with bounding cube.

With a triangulation generated by the periodic mesh package, is there
a way to colour or otherwise somehow mark the cell faces on each
boundary? I'm not sure this is a meaningful question given the
irregular nature of the boundaries!

Sorry for the basic questions - I'm new to CGAL and still finding my way
around!

Many thanks,
Matt


On Tue, 16 Mar 2021 at 10:54, Monique Teillaud
<> wrote:
Dear Matthew,

In fact, if you add points on the facets of the cube and you ensure that the
facets are triangulated as mael suggests, then you are enforcing the
periodicity through these points. You are not using the functionality that is
offered by the periodic mesh package.
In other words, this should rather be done with the non-periodic meshing
package.

(In fact I would be curious why you need the facets to be triangulated... Our
algorithm is precisely designed to avoid adding such artificial points...)

Best regards,
--
Monique Teillaud
https://members.loria.fr/Monique.Teillaud/
INRIA Nancy - Grand Est, LORIA
Institut National de Recherche en Informatique et Automatique

----- Le 15 Mar 21, à 17:21, cgal-discuss <> a écrit :

Hi Mael,

Thanks for your reply.

It's a shame the periodic mesher can't do this currently. Would you be able to
give some hints on how to implement your idea of using the standard 3D mesh
package? I'm slightly wary about manually moving vertices around - won't this
reduce the quality of the resulting mesh?

Thanks,
Matt

On Mon, 15 Mar 2021, 08:04 Mael Rouxel-Labbé,
<> wrote:
Hello,

This is not currently possible in a straightforward manner in the
periodic mesh generator, as there is no 3D constrained Delaunay
triangulations in CGAL yet.

In a less straight forward manner, if you wish your elements to lie
exactly on the boundary of the periodic domain, you might be able to do
away with the periodic mesh generation algorithm: generate a 3D mesh of
the implicit function clipped by the periodic domain, and then ensure
that the vertices are identical on both sides.

Best,
Mael

On 15/03/2021 02:05, Matthew Russell ( via
cgal-discuss Mailing List) wrote:
Dear all,

I would like to generate periodic 3D meshes of regions bounded by
implicit functions and so I was pleased to find examples such as [1]
that do almost exactly what I want. The problem that I'm having is
that cells in the meshes generated from this example are able to lie
across the bounding unit cube, but to use the meshes in finite element
simulations I need the faces of the cells to align with the boundaries
of the cube.

For example, the CGAL example [1] (with a different implciit function)
generates meshes like [cgal.jpg], but I would like one like
[gmsh.jpg].

I haven't been able to find a way to do this in CGAL. Is it possible?

Many thanks,
Matt

[1]
https://doc.cgal.org/latest/Periodic_3_mesh_3/Periodic_3_mesh_3_2mesh_implicit_shape_8cpp-example.html

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss



--
Iordan Iordanov, PhD
https://imiordanov.github.io/



--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss




Archive powered by MHonArc 2.6.19+.

Top of Page