[Dune-devel] VTK writer for intersection or codim=1 entity data?

Simon Praetorius simon.praetorius at tu-dresden.de
Thu Jun 22 15:41:53 CEST 2023


Hi Santiago,

Maybe this is also similar in dune-vtk. There, the "extractor" is called 
"datacollector". You can implement an interface where you can 
essentially collect whatever you want. But there is no example for 
intersection grids.

In the simplest form you could follow the ContinuousDataCollector. If 
you do not have a parallel grid it can even be simplified. The 
numPoints() function should return the number of vertices in the grid 
and the numCells() function the number of edges. The points() 
implementation is the same as in the continuous data-collector and the 
cells() function just iterates over the edges instead of the elements. 
The only thing where you need to be a bit careful is the pointData() (or 
cellData()) function. The input is a grid-function. The abstraction is 
currently not general enough to allow grid-functions to be bound to 
entity sets that are not the elements of the grid. Thus, the 
implementation for the pointData() should be the same as a the 
ContinuousDataCollector and for the cellData() you just need to evaluate 
in e.g. the edge centers instead of the element centers.

I hope you got an idea of how to implement it. As I said, it is not yet 
tested and I cannot give any guarantees that it works. But if it does, 
it would be great if you could contribute this to the repository.

Best,
Simon

On 6/22/23 08:05, Christian Engwer wrote:
> Dear Santiago,
>
> long ago I implemented something like that to visualise data of a UDG 
> discretization. I'm partially using the dune-grid vtk writer, but 
> defined a different "extractor" to collect the data.
>
> We never polished it, if you want, I can give you access.
>
> Best Christian
>
>
> Am 22. Juni 2023 06:40:14 MESZ schrieb "Ospina De Los Rios, Santiago" 
> <santiago.ospina at iwr.uni-heidelberg.de>:
>
>     Dear Dune Developers,
>
>     I was wondering if any of you had faced the problem of writing
>     data for intersection data for VTK? In particular, I am interested
>     in 0D/1D/2D VTK meshes+data (not C++ grids) resulting from the
>     intersection between the 1D/2D/3D non-overlapping domains of a
>     grid. So far, I only use conforming grids, so either interesection
>     or codim:=1 entity writers would do for me.
>
>     I could not see any hint to these kind of writers in the dune-grid
>     and dune-vtk modules. Maybe I missed it? So I was wondering if any
>     of you already had similar problem/solution or if you see an easy
>     way to re-use the existing writers for this purpose? Any pointer
>     would be appreciated, thanks!
>
>     Best,
>     Santiago 
>
>
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at lists.dune-project.org
> https://lists.dune-project.org/mailman/listinfo/dune-devel

-- 
Dr. Simon Praetorius
Institut für Wissenschaftliches Rechnen
Fakultät Mathematik
Technische Universität Dresden
Tel.: TUD-34432
Mail:simon.praetorius at tu-dresden.de
Web:https://tu-dresden.de/Members/simon.praetorius
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20230622/0f289d23/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5785 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20230622/0f289d23/attachment.bin>


More information about the Dune-devel mailing list