← Back to team overview

dolfin team mailing list archive

Re: Missing mesh data

 

On 3 May 2011 14:44, Anders Logg <logg@xxxxxxxxx> wrote:
> On Tue, May 03, 2011 at 02:29:40PM +0200, Benjamin Kehlet wrote:
>> On 3 May 2011 14:07, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>> >
>> >
>> > On 03/05/11 13:02, Anders Logg wrote:
>> >> Who removed the mesh data "vertex_map" and "cell_map", and why were
>> >> they removed?
>> >>
>> >
>> > It may have been me. It will have been moved rather than removed.
>> >
>> >> When I think of it now, the move to BoundaryMesh may be appropriate
>> >> since "vertex_map" is ambiguous (not clear that it refers to a mapping
>> >> from the boundary).
>> >>
>> >
>> > There were many ambiguities in the mesh data - I've been trying to
>> > straighten out the ones relate to parallel meshes so I can start on
>> > implementing missing functionality. The code was too confusing for me
>> > too implement new functionality without straightening things out first.
>>
>> There seems to be consensus to keep it in BoundaryMesh and as
>> functions ( cell_map() and vertex_map() ) rather than named mesh
>> functions. I'll update Meshbuilder then.
>
> Great.

While i*m on it: Here is a patch that update the comments in MeshData
and BoundarMyMesh.

Also, the class FacetCell now takes a BoundaryMesh as constructor
argument. Is this ok?

Benjamin

>
> --
> Anders
>
>
>> >
>> > Garth
>> >
>> >> In any case, docstrings are missing in MeshBoundary.h and MeshData.h
>> >> still list "vertex_map" and "cell_map".
>> >>
>> >>
>> >> _______________________________________________
>> >> Mailing list: https://launchpad.net/~dolfin
>> >> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
>> >> Unsubscribe : https://launchpad.net/~dolfin
>> >> More help   : https://help.launchpad.net/ListHelp
>> >
>> >
>> > _______________________________________________
>> > Mailing list: https://launchpad.net/~dolfin
>> > Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
>> > Unsubscribe : https://launchpad.net/~dolfin
>> > More help   : https://help.launchpad.net/ListHelp
>> >
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dolfin
>> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dolfin
>> More help   : https://help.launchpad.net/ListHelp
>
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: benjamik@xxxxxxxxxx-20110503141110-8j0uerdm6rm6pc30
# target_branch: bzr+ssh://bazaar.launchpad.net/%2Bbranch/dolfin/
# testament_sha1: 5d99550947469f62bd2c878ea74a48058739b4d4
# timestamp: 2011-05-03 16:15:23 +0200
# base_revision_id: logg@xxxxxxxxx-20110501220145-60ys4e77qbc0mq32
# 
# Begin patch
=== modified file 'dolfin/adaptivity/Extrapolation.cpp'
--- dolfin/adaptivity/Extrapolation.cpp	2011-03-30 17:42:48 +0000
+++ dolfin/adaptivity/Extrapolation.cpp	2011-05-03 14:11:10 +0000
@@ -22,7 +22,6 @@
 #include <dolfin/log/log.h>
 #include <dolfin/mesh/BoundaryMesh.h>
 #include <dolfin/mesh/Cell.h>
-#include <dolfin/mesh/FacetCell.h>
 #include "Extrapolation.h"
 
 using namespace dolfin;

=== modified file 'dolfin/mesh/BoundaryMesh.h'
--- dolfin/mesh/BoundaryMesh.h	2011-03-22 22:58:27 +0000
+++ dolfin/mesh/BoundaryMesh.h	2011-05-03 14:11:10 +0000
@@ -40,9 +40,11 @@
     MeshFunction<unsigned int>& cell_map()
     { return _cell_map; }
 
+    /// Get cell mapping from the boundary mesh to the original full mesh
     const MeshFunction<unsigned int>& cell_map() const
     { return _cell_map; }
 
+    /// Get vertex mapping from the boundary mesh to the original full mesh
     MeshFunction<unsigned int>& vertex_map()
     { return _vertex_map; }
 

=== modified file 'dolfin/mesh/FacetCell.cpp'
--- dolfin/mesh/FacetCell.cpp	2011-03-13 19:37:53 +0000
+++ dolfin/mesh/FacetCell.cpp	2011-05-03 14:11:10 +0000
@@ -13,18 +13,14 @@
 using namespace dolfin;
 
 //-----------------------------------------------------------------------------
-FacetCell::FacetCell(const Mesh& mesh, const Cell& facet)
+FacetCell::FacetCell(const BoundaryMesh& mesh, const Cell& facet)
   : Cell(mesh, 0), _facet_index(0)
 {
   // Get map from facets (boundary cells) to mesh cells
-  boost::shared_ptr<const MeshFunction<unsigned int> > cell_map = facet.mesh().data().mesh_function("cell map");
-
-  // Check that mapping exists
-  if (!cell_map)
-    error("Unable to create create cell corresponding to facet, missing cell map.");
+  const MeshFunction<unsigned int>& cell_map = mesh.cell_map();
 
   // Get mesh facet corresponding to boundary cell
-  Facet mesh_facet(mesh, (*cell_map)[facet]);
+  Facet mesh_facet(mesh, cell_map[facet]);
 
   // Get cell index (pick first, there is only one)
   const uint D = mesh.topology().dim();

=== modified file 'dolfin/mesh/FacetCell.h'
--- dolfin/mesh/FacetCell.h	2010-02-08 14:59:57 +0000
+++ dolfin/mesh/FacetCell.h	2011-05-03 14:11:10 +0000
@@ -8,6 +8,7 @@
 #define __FACET_CELL_H
 
 #include "Cell.h"
+#include "BoundaryMesh.h"
 
 namespace dolfin
 {
@@ -22,7 +23,7 @@
   public:
 
     /// Create cell on mesh corresponding to given facet (cell) on boundary
-    FacetCell(const Mesh& mesh, const Cell& facet);
+    FacetCell(const BoundaryMesh& mesh, const Cell& facet);
 
     /// Destructor
     ~FacetCell();

=== modified file 'dolfin/mesh/MeshData.h'
--- dolfin/mesh/MeshData.h	2011-04-08 13:53:18 +0000
+++ dolfin/mesh/MeshData.h	2011-05-03 14:11:10 +0000
@@ -54,8 +54,8 @@
   ///
   /// Boundary extraction
   ///
-  ///   "vertex map" - MeshFunction<uint> of dimension 0
-  ///   "cell map"   - MeshFunction<uint> of dimension D
+  ///   (moved to BoundaryMesh) "vertex map" - MeshFunction<uint> of dimension 0
+  ///   (moved to BoundaryMesh) "cell map"   - MeshFunction<uint> of dimension D
   ///
   /// Mesh partitioning
   ///

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWXwaZ6gABF7fgEAQWWf//1+K
Agq////wYAe/eNM+VAACrtSnNnIV69O94SiRpTxEZPRk1PU9J7U00T0NTIBppkMgykJk2kxDQMmE
AyAA0AYQ5piY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