Bruno, it seems like you are attaching your faces to the *boundary* manifold. Let me try to explain what is happening.
In the code for step-54, there is a wire that is used to describe the manifold of the *boundary* of the surface (a curve of dimension one embedded in dimension three). This is generated by the wire that identifies the boundary of the TopoDS shape of the face. The manifold attached to it is an ArcLengthProjectionManifold, where mid points on the curve are added by computing the distance in arc length, and taking the point in the middle w.r.t. this length.
In your code with more than one cell, you are not assigning *just the boundary faces* to the wire, but *all* faces (including the one in the middle of your surface, delimitating the two cells). Intermediate points on those lines will be projected (correctly) on the boundary wire (that’s what your movie shows).
Of course any point that is in the middle of the surface does *not* belong to the *boundary wire*, and you’ll get an exception when trying to construct the midpoint of an *edge* that belongs to the interior of the domain, with manifold id 2 (which corresponds to a manifold that describes *the boundary* of your topology, not its surface).
With two cells, the internal edge (the only edge that does not belong to the boundary) should *not* have id 2. If you set its id to 2, the result is that a point which is in the middle of the edge, is actually in the midlle of the two points *when running along the curve that describes the boundary*, hence you get the distortion you show in the movie.
Try adding a check to the faces in which you set the manifold id to 2 only if the face is at the boundary.
The principle is:
1. start from the lowest codimension objects, identify how to deform them. In your case, cells of a Tria<2,3> are quads, that should deform as a TopoDS_FACE.
2. Attach your favorite manifold to the TopoDS_Face (I’d personally only use NormalToMeshProjectionManifold) using cell->set_all_manifold_ids(manifold_id) (Notice the use of set_all_manifold_ids, and **not** set_manifold_id: you want all children of these objects to belong to the same manifold, in particular you want all faces that are internal, i.e., that are shared between two obects with the same manifold id, to inherit the same manifold id).
3. Go one codimension lower: in your case, curves (for 3d meshes, surfaces). Follow the same rule as above, setting all_manifold_ids on faces that you know should follow a known codimension one geometry (a known TopoDS_EDGE, or TopoDS_WIRE). In this case I’d only use ArcLengthProjectionManifold objects, attached to the wires that identify your geometry.
Doing things in this order guarantees that internal edges get the correct manifold id, which, in your case, is not happening.
Best,
Luca.
> On 1 Apr 2020, at 17:32, Bruno Blais <
blais...@gmail.com> wrote:
>
> So my investigation on this issue continues...
> It seems the core of my issues stem from using a non-trivial mesh with more than one cell as a starting point.
> if I start with a 2 cell spacedim=2 dim=3 mesh such as:
>
>
> <start_point.png>
>
>
>
> Which is identical to the second step of the adaptation. I get an aberrant result (see attached out_wrong.mp4).
>
>
>
> I also get issues when I try to apply the manifold on a starting msh made with GMSH that has a similar topology such as in the following image:
>
> --
> The deal.II project is located at
http://www.dealii.org/
> For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
dealii+un...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/9decc8c5-0a99-44f1-aaa9-24deb26edc06%40googlegroups.com.
> <out_wrong.mp4><start_point.png><starting_mesh.png>