<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p></p>
<div>Hi dune-devs,<br>
<br>
here I share my thoughts regarding the dune-grid concepts that I want to open for a discussion on Friday:<br>
<br>
<blockquote>My proposal is to move the dune grid towards a grid concept. That is, any grid that looks syntactically like a grid, is assumed to fulfill the grid semantics, i.e. duck-typing. In other words, syntax implies semantics. I already showed that it is
possible to create such a concept <span>in a merge request[1]</span> even for generic dimensions. I want to highlight that I don't want to discuss this specific implementation but the _idea_ of detaching from the duck-typing made in Dune::Grid and move towards
dune-grid as a concept.<br>
<div><br>
Pros:<br>
* The concept definition is much smaller and "cleaner" than Dune::Grid.<br>
* Real duck-typing. The current one depends on some instantiations of the Dune::Grid base class.<br>
* Grid implementations may not be related to dune.<br>
* Special type of grids concepts may be refined in downstream projects. Such refinements are very simple and would define the grid interface and capabilities (e.g. multi-domain grids, axial-parallel, thread-safe grids). Again, syntax conveys semantic.<br>
* Creation of new grids is currently very tedious. The grid can only be checked to be a dune grid if the whole grid passes the duck typing from dune-grid. This is not necessary with concepts, as one can check against smaller building blocks of the grid (entities,
index sets, intersections, etc.).<br>
* For the most of dune, I hope, it is backwards compatible.<br>
<br>
Cons:<br>
* Harder to document! (Doxygen does not know the concept concept)<br>
* Template functions cannot be constrained (e.g. communicate). This means that a concept will not be able to tell whether objects that fulfill a concept are instantiable. A solution for this might be to check only some instantiations and assume that the implementation
is generic.<br>
* There will be legacy "bugs" where functions are expecting child classes of Dune::Grid</div>
<div><br>
<span class="sewv00jqvqm4j85"></span>
<div>Discussion about the current implementation:<br>
* Two implementations for the same purpose: C++20 and dune concepts. Bad because is repeating code (?)<br>
* const-correctnes of the grid interface is not implemented.<br>
* Currently, clang has no C++20 concepts library...<br>
</div>
<br>
</div>
<p>[1]: <a href="https://gitlab.dune-project.org/core/dune-grid/-/merge_requests/377" class="OWAAutoLink" id="LPlnk920768" previewremoved="true">
https://gitlab.dune-project.org/core/dune-grid/-/merge_requests/377</a></p>
</blockquote>
</div>
<div id="LPBorder_GT_16110692924210.7745740640310966" style="margin-bottom:20px; overflow:auto; width:100%; text-indent:0px">
<table id="LPContainer_16110692924130.7984428170744643" style="width:90%; background-color:rgb(255,255,255); overflow:auto; padding-top:20px; padding-bottom:20px; margin-top:20px; border-top:1px dotted rgb(200,200,200); border-bottom:1px dotted rgb(200,200,200)" cellspacing="0">
<tbody>
<tr style="border-spacing:0px" valign="top">
<td id="ImageCell_16110692924140.381121703364805" colspan="1" style="width:250px; display:table-cell; padding-right:20px">
<div id="LPImageContainer_16110692924150.32849606251142016" style="background-color:rgb(255,255,255); height:128px; margin:auto; display:table; width:128px">
<a id="LPImageAnchor_16110692924160.5229846767232509" href="https://gitlab.dune-project.org/core/dune-grid/-/merge_requests/377" target="_blank" style="display:table-cell; text-align:center"><img id="LPThumbnailImageID_16110692924160.5148562924655575" style="display:inline-block; max-width:250px; max-height:250px; height:128px; width:128px; border-width:0px; vertical-align:bottom" width="128" height="128" src="https://gitlab.dune-project.org/assets/gitlab_logo-7ae504fe4f68fdebb3c2034e36621930cd36ea87924c11ff65dbcb8ed50dca58.png"></a></div>
</td>
<td id="TextCell_16110692924170.5562699830056109" colspan="2" style="vertical-align: top; padding: 0px; display: table-cell; position: relative;">
<div id="LPRemovePreviewContainer_16110692924170.18185257842431313"></div>
<div id="LPTitle_16110692924170.79277556183868" style="top:0px; color:rgb(0,120,215); font-weight:400; font-size:21px; font-family:"wf_segoe-ui_light","Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; line-height:21px">
<a id="LPUrlAnchor_16110692924170.6120360387010986" href="https://gitlab.dune-project.org/core/dune-grid/-/merge_requests/377" target="_blank" style="text-decoration:none">Feature/concepts (!377) · Merge Requests · Core Modules / dune-grid · GitLab</a></div>
<div id="LPMetadata_16110692924190.4929832932675072" style="margin:10px 0px 16px; color:rgb(102,102,102); font-weight:400; font-family:"wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size:14px; line-height:14px">
gitlab.dune-project.org</div>
<div id="LPDescription_16110692924200.7886492179234178" style="display:block; color:rgb(102,102,102); font-weight:400; font-family:"wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size:14px; line-height:20px; max-height:100px; overflow:hidden">
@santiago.ospina has put together a set of concept checks for a `Dune::Grid` using @carsten.graeser's implementation of concepts. I would be glad t have this in master.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<p></p>
<p>Best Regards,</p>
<p>Santiago Ospina</p>
<p><br>
</p>
<p><font style="font-family: Calibri, Arial, Helvetica, sans-serif, serif, "EmojiFont";" size="3" face="Calibri,Arial,Helvetica,sans-serif" color="black"><span style="font-size:12pt;background-color:white;" dir="ltr">--------------------------------<br>
Santiago Ospina De Los Rios<br>
</span></font></p>
<p><font style="font-family: Calibri, Arial, Helvetica, sans-serif, serif, "EmojiFont";" size="3" face="Calibri,Arial,Helvetica,sans-serif" color="black"><span style="font-size:12pt;background-color:white;" dir="ltr">Interdisciplinary Center for Scientific
Computing<br>
Heidelberg University<br>
<br>
Im Neuenheimer Feld 205<br>
69120 Heidelberg<br>
Germany</span></font></p>
</div>
</body>
</html>