From 334623e288d8335ad6a9f32b39a82748bfcc406e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com>
Date: Wed, 26 Feb 2025 11:16:32 +0100
Subject: [PATCH] Add simple doc for the get_mesh: Vh -> mesh function

---
 doc/userdoc.org | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/doc/userdoc.org b/doc/userdoc.org
index 5650f0a50..6144f5a9a 100644
--- a/doc/userdoc.org
+++ b/doc/userdoc.org
@@ -4495,6 +4495,24 @@ to different meshes.
 
 A good example of the use of this kind of function is mass fractions.
 
+***** ~get_mesh:Vh -> mesh~
+
+This function allows to retrieve the mesh that is used to define a
+discrete function.
+#+BEGIN_SRC pugs :exports both :results none
+  import mesh;
+  import scheme;
+
+  let m:mesh, m = cartesianMesh(0, [1,1], (10,10));
+
+  let f: R^2 -> R, x -> 2*x[0]+x[1];
+  let fh:Vh, fh = interpolate(m, P0(), f);
+
+  let m2: mesh, m2 = get_mesh(sum);
+#+END_SRC
+Observe that in this example the two variables refer to the same exact
+mesh. There is no duplication.
+
 ***** ~load_balance: (Vh) -> (Vh)~
 
 This function performs a parallel load balancing of a list of ~Vh~
-- 
GitLab