Praveen,
This all raises very good questions we eventually have to tackle.
I think your four- (or actually five-)point plan looks at the problem from too
low a level. Let's do a bit of software design here:
1/ Let's say we have a mesh that -- somehow -- can encode geometry that goes
beyond just the locations for vertices. This may be a CAD file (which can be
treated in the way Luca shows in step-54) or something less structured like
the mesh you showed.
2/ We want to use the geometry encoded in this file for mesh refinement,
curved boundary descriptions, etc. In deal.II, this is done using objects of
type Manifold.
3/ It would be nice if we managed to do all of this in a way that allowed us
to be backward compatible. This means, that the functions in GridIn should
learn to deal with this in a way that would be applicable to all of the
functions in that class (to the degree that the file formats support it).
So what if, for example, GridIn::read_msh() did the following:
* If it's a plain old mesh as always, simply read vertex and cell information,
create the cells, and put them into a triangulation.
* If it's a mesh that has associated geometry
- read vertex and cell information
- read geometry information
+ for each separate part of the geometry (in your example, that
would likely be each cell, given that it's a bi-quartic patch),
create an object of an appropriate class derived from class
Manifold
+ for each manifold object, claim a manifold_id and associate
the manifold with the triangulation using that manifold_id
+ associate the relevant cells with this manifold_id
- create triangulation
+ return the collection of manifold objects to the user, for
example via a std::set<std::unique_ptr<Manifold*>> or
similar.
Only steps marked with a '+' are actually new.
This would be backward compatible: existing calls to GridIn::read_msh() would
simply ignore the returned set of manifold objects -- which would, because
users expected to read files without associated geometry information, be an
empty set anyway.
What would be necessary to implement is then:
* A class QuarticManifold (or maybe more generally PolynomialManifold)
that you would give 5x5 points (in 2d) and that would describe the
curved geometry of one (coarse) cell of the mesh (and its children).
This should not be terribly complicated to do if you derived it from
ChartManifold.
* Implement the approach outlined above to extend the mesh readers.
Would you like to give this a go? We'd of course be happy to assist where
necessary. I would do it in pieces, i.e., in particular start with the
PolynomialManifold description first.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@math.tamu.edu
www:
http://www.math.tamu.edu/~bangerth/