From 6cbae8e0698ff2e89c515bcf217e40d774b7051a Mon Sep 17 00:00:00 2001
From: JeanPaul Pelteret
Date: Fri, 3 Apr 2020 22:08:45 +0200
Subject: [PATCH] Add segment explaining best practices for CAD geometries

FrequentlyAskedQuestions.md  33 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+), 2 deletions()
diff git a/FrequentlyAskedQuestions.md b/FrequentlyAskedQuestions.md
index 71665fc..e1d30f8 100644
 a/FrequentlyAskedQuestions.md
+++ b/FrequentlyAskedQuestions.md
@@ 50,6 +50,7 @@ This page collects a few answers to questions that have frequently been asked ab
* [Questions about specific behavior of parts of deal.II](#questionsaboutspecificbehaviorofpartsofdealii)
* [How do I create the mesh for my problem?](#howdoicreatethemeshformyproblem)
* [How do I describe complex boundaries?](#howdoidescribecomplexboundaries)
+ * [How do I ensure that my refined grid is correct when using CAD geometry?](#howdoiensurethatmyrefinedgridiscorrectwhenusingcadgeometry)
* [How do I get the degree of freedom indices at vertices?](#howdoigetthedegreeoffreedomindicesatvertices)
* [I am using discontinuous Lagrange elements (FE_DGQ) but they don't seem to have vertex degrees of freedom!?](#iamusingdiscontinuouslagrangeelementsfe_dgqbuttheydontseemtohavevertexdegreesoffreedom)
* [How do I access values of discontinuous elements at vertices?](#howdoiaccessvaluesofdiscontinuouselementsatvertices)
@@ 1432,8 +1433,36 @@ In deal.II releases after 8.1, the way geometry is described has been made
much more flexible. In particular, it is no longer only possible to
describe the boundary, but it is also possible to describe where points in
the interior lie. The step53 tutorial program explains how this is done
for a realistic example.

+for a realistic example. Additionally, the step54 tutorial highlights how
+boundary points can be mapped to CAD geometry.
+
+#### How do I ensure that my refined grid is correct when using CAD geometry?
+When using CAD geometries, it is critical that the manifold ID's for objects
+in the mesh (that is, faces and lines) are correctly set such that, upon refinement,
+the child elements are projected to the correct CAD entities. The mesh that
+results when this is not done correctly will not only be wrong, but may also
+difficult to interpret the source of the error.
+
+The principles that constitute the current best practice are as follows:
+1. Start from the lowest codimension objects, and identify how to deform them.
+For the case of a codimension one triangulation, the cells of a `Triangulation<2,3>`
+are quadrilaterals, that should deform as a `TopoDS_FACE`. (For a pure 3d triangulation,
+you might start by setting the manifold IDs of the cells themselves.)
+2. For the codimension one case, attach your favourite manifold to the `TopoDS_Face` using
+`cell>set_all_manifold_ids(manifold_id)`. Notice the use of `set_all_manifold_ids()`,
+and **not** `set_manifold_id()`. This is necessary because you want all children
+of these objects to belong to the same manifold. In particular, for this want all faces
+that are internal (i.e., that are shared between two objects with the same manifold
+ID) to inherit the same manifold ID. For the choice of manifold to apply here,
+it is often most appropriate to employ a `NormalToMeshProjectionManifold`.
+3. Now go one codimension lower. For this codimension one example, that would mean setting
+the manifold IDs on curves (and for pure 3d meshes, surfaces). Follow the same rule as
+before, setting all manifold IDs on faces that you know should follow a known
+codimension one geometry (for curves, a known `TopoDS_EDGE`, or `TopoDS_WIRE`) using
+calls to `set_all_manifold_ids()`. Here it is often most appropriate to choose
+`ArcLengthProjectionManifold` objects, attached to the wires that identify your geometry.
+
+Doing things in this order guarantees that internal edges get the correct manifold ID.
### How do I get the degree of freedom indices at vertices?

2.20.1