MFEM v4.10.0
Finite element discretization library
Loading...
Searching...
No Matches
findpts.cpp
Go to the documentation of this file.
1// Copyright (c) 2010-2026, Lawrence Livermore National Security, LLC. Produced
2// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3// LICENSE and NOTICE for details. LLNL-CODE-806117.
4//
5// This file is part of the MFEM library. For more information and source code
6// availability visit https://mfem.org.
7//
8// MFEM is free software; you can redistribute it and/or modify it under the
9// terms of the BSD-3 license. We welcome feedback and contributions, see file
10// CONTRIBUTING.md for details.
11//
12// -------------------------------------------------------------
13// Find Points Miniapp: Evaluate grid function in physical space
14// -------------------------------------------------------------
15//
16// This miniapp demonstrates the interpolation of a high-order grid function on
17// a set of points in physical-space. The miniapp is based on GSLIB-FindPoints,
18// which provides two key functionalities. First, for a given set of points in
19// the physical-space, it determines the computational coordinates (element
20// number, reference-space coordinates inside the element, and processor number
21// [in parallel]) for each point. Second, based on computational coordinates, it
22// interpolates a grid function in the given points. Inside GSLIB, computation
23// of the coordinates requires use of a Hash Table to identify the candidate
24// processor and element for each point, followed by the Newton's method to
25// determine the reference-space coordinates inside the candidate element.
26//
27// Compile with: make findpts
28//
29// Sample runs:
30// findpts -m ../../data/rt-2d-p4-tri.mesh -o 8 -mo 4
31// findpts -m ../../data/inline-tri.mesh -o 3
32// findpts -m ../../data/inline-quad.mesh -o 3
33// findpts -m ../../data/inline-quad.mesh -o 3 -po 1
34// findpts -m ../../data/inline-quad.mesh -o 3 -po 1 -fo 1 -nc 2
35// findpts -m ../../data/inline-quad.mesh -o 3 -hr -pr -mpr -mo 2
36// findpts -m ../../data/inline-quad.mesh -o 3 -hr -pr -mpr -mo 3
37// findpts -m ../../data/inline-tet.mesh -o 3
38// findpts -m ../../data/inline-hex.mesh -o 3
39// findpts -m ../../data/inline-wedge.mesh -o 3
40// findpts -m ../../data/amr-quad.mesh -o 2
41// findpts -m ../../data/rt-2d-q3.mesh -o 8 -mo 4 -ft 2
42// findpts -m ../../data/square-mixed.mesh -o 2 -mo 2
43// findpts -m ../../data/square-mixed.mesh -o 2 -mo 2 -hr -pr -mpr
44// findpts -m ../../data/square-mixed.mesh -o 2 -mo 3 -ft 2
45// findpts -m ../../data/fichera-mixed.mesh -o 3 -mo 2
46// findpts -m ../../data/inline-pyramid.mesh -o 1 -mo 1
47// findpts -m ../../data/tinyzoo-3d.mesh -o 1 -mo 1
48// Surface meshes:
49// findpts -m ../../data/ref-square.mesh -o 2 -mo 1 -random 1 -surf
50// findpts -m ../../data/ref-cube.mesh -o 2 -mo 1 -random 1 -surf
51// findpts -m ../../data/square-disc-p2.mesh -o 4 -mo 2 -random 1 -surf
52// Surface meshes + bounding box size increase:
53// findpts -m ../../data/square-disc-p2.mesh -o 4 -mo 2 -random 1 -surf -sabs 0.1
54// findpts -m ../../data/tinyzoo-3d.mesh -o 4 -mo 2 -random 1 -surf -sabs 0.1
55
56#include "mfem.hpp"
58
59using namespace mfem;
60using namespace std;
61
63 const char *title, int locx)
64{
65 Mesh *mesh = fespace.GetMesh();
66 L2_FECollection order_coll = L2_FECollection(0, mesh->Dimension());
67 FiniteElementSpace order_space = FiniteElementSpace(mesh, &order_coll);
68 GridFunction order_gf = GridFunction(&order_space);
69
70 for (int e = 0; e < mesh->GetNE(); e++)
71 {
72 order_gf(e) = fespace.GetElementOrder(e);
73 }
74
75 socketstream vis1;
76 common::VisualizeField(vis1, "localhost", 19916, order_gf, title,
77 locx, 0, 400, 400, "RjmAcp");
78}
79
81
82// Scalar function to project
83double field_func(const Vector &x)
84{
85 const int dim = x.Size();
86 double res = 0.0;
87 for (int d = 0; d < dim; d++) { res += std::pow(x(d), func_order); }
88 return res;
89}
90
91void F_exact(const Vector &p, Vector &F)
92{
93 F(0) = field_func(p);
94 for (int i = 1; i < F.Size(); i++) { F(i) = (i+1)*F(0); }
95}
96
97int main (int argc, char *argv[])
98{
99 // Set the method's default parameters.
100 const char *mesh_file = "../../data/rt-2d-q3.mesh";
101 int order = 3;
102 int mesh_poly_deg = 3;
103 int rs_levels = 0;
104 bool visualization = true;
105 int fieldtype = 0;
106 int ncomp = 1;
107 bool hrefinement = false;
108 bool prefinement = false;
109 int point_ordering = 0;
110 int gf_ordering = 0;
111 bool mesh_prefinement = false;
112 int randomization = 0;
113 int npt = 100;
114 bool surface = false;
115 double surf_aabb_sz_inc = 0.0;
116
117 // Parse command-line options.
118 OptionsParser args(argc, argv);
119 args.AddOption(&mesh_file, "-m", "--mesh",
120 "Mesh file to use.");
121 args.AddOption(&order, "-o", "--order",
122 "Finite element order (polynomial degree).");
123 args.AddOption(&mesh_poly_deg, "-mo", "--mesh-order",
124 "Polynomial degree of mesh finite element space.");
125 args.AddOption(&rs_levels, "-rs", "--refine-serial",
126 "Number of times to refine the mesh uniformly in serial.");
127 args.AddOption(&fieldtype, "-ft", "--field-type",
128 "Field type: 0 - H1, 1 - L2, 2 - H(div), 3 - H(curl).");
129 args.AddOption(&ncomp, "-nc", "--ncomp",
130 "Number of components for H1 or L2 GridFunctions");
131 args.AddOption(&visualization, "-vis", "--visualization", "-no-vis",
132 "--no-visualization",
133 "Enable or disable GLVis visualization.");
134 args.AddOption(&hrefinement, "-hr", "--h-refinement", "-no-hr",
135 "--no-h-refinement",
136 "Do random h refinements to mesh (does not work for pyramids).");
137 args.AddOption(&prefinement, "-pr", "--p-refinement", "-no-pr",
138 "--no-p-refinement",
139 "Do random p refinements to solution field (does not work for pyramids).");
140 args.AddOption(&point_ordering, "-po", "--point-ordering",
141 "Ordering of points to be found."
142 "0 (default): byNodes, 1: byVDIM");
143 args.AddOption(&gf_ordering, "-fo", "--fespace-ordering",
144 "Ordering of fespace that will be used for grid function to be interpolated."
145 "0 (default): byNodes, 1: byVDIM");
146 args.AddOption(&mesh_prefinement, "-mpr", "--mesh-p-refinement", "-no-mpr",
147 "--no-mesh-p-refinement",
148 "Do random p refinements to mesh Nodes.");
149 args.AddOption(&randomization, "-random", "--random",
150 "0: generate points randomly in the bounding box of domain, "
151 "1: generate points randomly inside each element in mesh.");
152 args.AddOption(&npt, "-npt", "--npt",
153 "Number of points per element when -random 1 is used.");
154 args.AddOption(&surface, "-surf", "--surface", "-no-surf",
155 "--no-surface",
156 "Extract surface mesh from volume mesh.");
157 args.AddOption(&surf_aabb_sz_inc, "-sabs", "--surface-aabb-size-inc",
158 "Absolute AABB expansion applied to surface-search "
159 "axis-aligned bounding boxes in FindPointsGSLIB surface meshes.");
160
161 args.Parse();
162 if (!args.Good())
163 {
164 args.PrintUsage(cout);
165 return 1;
166 }
167 args.PrintOptions(cout);
168
169 func_order = std::min(order, 2);
170
171 // Initialize and optionally extract the surface mesh.
172 Mesh input_mesh(mesh_file, 1, 1, false);
173 Mesh *mesh = surface ? nullptr : &input_mesh;
174 if (surface)
175 {
176 MFEM_VERIFY(input_mesh.bdr_attributes.Size() > 0,
177 "--surface requires a mesh with boundary attributes.");
178 mesh = new Mesh(SubMesh::CreateFromBoundary(input_mesh,
179 input_mesh.bdr_attributes));
180 }
181
182 MFEM_VERIFY(!(surface && prefinement),
183 "Surface interpolation does not support variable-order "
184 "solution spaces; use -no-pr with --surface.");
185
186 for (int lev = 0; lev < rs_levels; lev++) { mesh->UniformRefinement(); }
187 const int dim = mesh->Dimension(),
188 sdim = mesh->SpaceDimension();
189 cout << "Mesh curvature of the original mesh: ";
190 if (mesh->GetNodes()) { cout << mesh->GetNodes()->OwnFEC()->Name(); }
191 else { cout << "(NONE)"; }
192 cout << endl;
193
194 // Mesh bounding box.
195 Vector pos_min, pos_max;
196 MFEM_VERIFY(mesh_poly_deg > 0, "The order of the mesh must be positive.");
197 mesh->GetBoundingBox(pos_min, pos_max, mesh_poly_deg);
198 if (hrefinement || prefinement || mesh_prefinement)
199 {
200 mesh->EnsureNCMesh(true);
201 }
202
203 cout << "--- Generating points for:\n"
204 << "x in [" << pos_min(0) << ", " << pos_max(0) << "]\n";
205 if (sdim >= 2)
206 {
207 cout << "y in [" << pos_min(1) << ", " << pos_max(1) << "]" << std::endl;
208 }
209 if (sdim == 3)
210 {
211 cout << "z in [" << pos_min(2) << ", " << pos_max(2) << "]\n";
212 }
213
214 // Random h-refinements to mesh
215 if (hrefinement) { mesh->RandomRefinement(0.5); }
216
217 // Curve the mesh based on the chosen polynomial degree.
218 H1_FECollection fecm(mesh_poly_deg, dim);
219 FiniteElementSpace fespace(mesh, &fecm, sdim);
220 mesh->SetNodalFESpace(&fespace);
221 GridFunction Nodes(&fespace);
222 mesh->SetNodalGridFunction(&Nodes);
223 cout << "Mesh curvature of the curved mesh: " << fecm.Name() << endl;
224
225 if (mesh_prefinement)
226 {
228 for (int e = 0; e < mesh->GetNE(); e++)
229 {
230 if ((double) rand() / RAND_MAX < 0.2)
231 {
232 refs.Append(pRefinement(e,1));
233 }
234 }
235 std::cout << refs.Size() << " elements will be p-refined for the mesh." <<
236 std::endl;
237 fespace.PRefineAndUpdate(refs);
238 Nodes.Update();
239 }
240
241 MFEM_VERIFY(ncomp > 0, "Invalid number of components.");
242 int vec_dim = ncomp;
243 FiniteElementCollection *fec = NULL;
244 if (fieldtype == 0)
245 {
246 fec = new H1_FECollection(order, dim);
247 cout << "H1-GridFunction\n";
248 }
249 else if (fieldtype == 1)
250 {
251 fec = new L2_FECollection(order, dim);
252 cout << "L2-GridFunction\n";
253 }
254 else if (fieldtype == 2)
255 {
256 fec = new RT_FECollection(order, dim);
257 ncomp = 1;
258 vec_dim = sdim;
259 cout << "H(div)-GridFunction\n";
260 }
261 else if (fieldtype == 3)
262 {
263 fec = new ND_FECollection(order, dim);
264 ncomp = 1;
265 vec_dim = sdim;
266 cout << "H(curl)-GridFunction\n";
267 }
268 else
269 {
270 MFEM_ABORT("Invalid field type.");
271 }
272 FiniteElementSpace sc_fes(mesh, fec, ncomp, gf_ordering);
273 GridFunction field_vals(&sc_fes);
274
275 // Random p-refinements to the solution field
276 if (prefinement)
277 {
279 for (int e = 0; e < mesh->GetNE(); e++)
280 {
281 if ((double) rand() / RAND_MAX < 0.5)
282 {
283 refs.Append(pRefinement(e,1));
284 }
285 }
286 sc_fes.PRefineAndUpdate(refs);
287 field_vals.Update();
288 }
289
290 std::unique_ptr<GridFunction> mesh_nodes_max;
291 if (mesh_prefinement) { mesh_nodes_max = Nodes.ProlongateToMaxOrder(); }
292 GridFunction *mesh_nodes_pref = mesh_prefinement ?
293 mesh_nodes_max.get() : &Nodes;
294
295 if (mesh_prefinement && visualization)
296 {
297 mesh->SetNodalGridFunction(mesh_nodes_pref);
298 VisualizeFESpacePolynomialOrder(fespace, "Mesh Polynomial Order", 400);
299 mesh->SetNodalGridFunction(&Nodes);
300 }
301
302 if (prefinement && visualization)
303 {
304 mesh->SetNodalGridFunction(mesh_nodes_pref);
305 VisualizeFESpacePolynomialOrder(sc_fes, "Solution Polynomial Order", 800);
306 mesh->SetNodalGridFunction(&Nodes);
307 }
308
309 // Project the GridFunction using VectorFunctionCoefficient.
311 field_vals.ProjectCoefficient(F);
312
313 std::unique_ptr<GridFunction> field_vals_max;
314 if (prefinement) { field_vals_max = field_vals.ProlongateToMaxOrder(); }
315 GridFunction *field_vals_pref = prefinement ?
316 field_vals_max.get() : &field_vals;
317
318 // Display the mesh and the field through glvis.
319 if (visualization)
320 {
321 if (mesh_prefinement) { mesh->SetNodalGridFunction(mesh_nodes_pref); }
322 socketstream vis1;
323 common::VisualizeField(vis1, "localhost", 19916, *field_vals_pref,
324 "Solution",
325 0, 0, 400, 400, "RmjA*****");
326 if (mesh_prefinement) { mesh->SetNodalGridFunction(&Nodes); }
327 }
328
329 // Generate random points in physical coordinates over the whole mesh.
330 // Note that some points might be outside if the mesh is not a box.
331 int pts_cnt = npt;
332 Vector vxyz;
333 int npt_face_per_elem = 4; // number of pts on faces when randomization != 0
334 int npt_total_face = 0;
335 if (randomization == 0)
336 {
337 vxyz.SetSize(pts_cnt * sdim);
338 vxyz.Randomize(1);
339
340 // Scale based on min/max dimensions
341 for (int i = 0; i < pts_cnt; i++)
342 {
343 for (int d = 0; d < sdim; d++)
344 {
345 if (point_ordering == Ordering::byNODES)
346 {
347 vxyz(i + d*pts_cnt) =
348 pos_min(d) + vxyz(i + d*pts_cnt) * (pos_max(d) - pos_min(d));
349 }
350 else
351 {
352 vxyz(i*sdim + d) =
353 pos_min(d) + vxyz(i*sdim + d) * (pos_max(d) - pos_min(d));
354 }
355 }
356 }
357 }
358 else // randomization == 1
359 {
360 pts_cnt = npt * mesh->GetNE();
361 vxyz.SetSize(pts_cnt * sdim);
362 for (int i = 0; i < mesh->GetNE(); i++)
363 {
365 const Geometry::Type geom = mesh->GetElementGeometry(i);
366 for (int j = 0; j < npt; j++)
367 {
369 Geometry::GetRandomPoint(geom, ip);
370 if (j < npt_face_per_elem)
371 {
372 ip.x = 0.0; // force point to be on the face
373 npt_total_face++;
374 }
375 Vector pos_i(sdim);
376 transf->Transform(ip, pos_i);
377 for (int d = 0; d < sdim; d++)
378 {
379 if (point_ordering == Ordering::byNODES)
380 {
381 vxyz(j + npt*i + d*pts_cnt) = pos_i(d);
382 }
383 else
384 {
385 vxyz((j + npt*i)*sdim + d) = pos_i(d);
386 }
387 }
388 }
389 }
390 }
391
392 // Find and Interpolate FE function values on the desired points.
393 Vector interp_vals(pts_cnt*vec_dim);
394 FindPointsGSLIB finder;
395 if (surface && surf_aabb_sz_inc > 0.0)
396 {
397 Vector bb_size({surf_aabb_sz_inc});
398 finder.SetupSurfWithAABBExpansion(*mesh, bb_size);
399 }
400 else
401 {
402 finder.Setup(*mesh);
403 // finder.SetDistanceToleranceForPointsFoundOnBoundary(10);
404 }
406 finder.Interpolate(vxyz, field_vals, interp_vals, point_ordering);
407 Array<unsigned int> code_out = finder.GetCode();
408 Vector dist_p_out = finder.GetDist();
409
410 int face_pts = 0, not_found = 0, found = 0;
411 double error = 0.0, max_err = 0.0, max_dist = 0.0;
412 Vector pos(sdim);
413 for (int j = 0; j < vec_dim; j++)
414 {
415 for (int i = 0; i < pts_cnt; i++)
416 {
417 if (code_out[i] < 2)
418 {
419 if (j == 0) { found++; }
420 for (int d = 0; d < sdim; d++)
421 {
422 pos(d) = point_ordering == Ordering::byNODES ?
423 vxyz(d*pts_cnt + i) :
424 vxyz(i*sdim + d);
425 }
426 Vector exact_val(vec_dim);
427 F_exact(pos, exact_val);
428 error = gf_ordering == Ordering::byNODES ?
429 fabs(exact_val(j) - interp_vals[i + j*pts_cnt]) :
430 fabs(exact_val(j) - interp_vals[i*vec_dim + j]);
431 max_err = std::max(max_err, error);
432 max_dist = std::max(max_dist, dist_p_out(i));
433 if (code_out[i] == 1 && j == 0) { face_pts++; }
434 }
435 else { if (j == 0) { not_found++; } }
436 }
437 }
438
439 cout << setprecision(16)
440 << "Searched points: " << pts_cnt
441 << "\nFound points: " << found
442 << "\nMax interp error: " << max_err
443 << "\nMax dist^2 (of found): " << max_dist
444 << "\nPoints not found: " << not_found;
445 if (randomization == 1)
446 {
447 cout << "\nPoints on faces: " << face_pts << " out of "
448 << npt_total_face << endl;
449 }
450 else
451 {
452 cout << "\nPoints on faces: " << face_pts << endl;
453 }
454
455 delete fec;
456 if (surface) { delete mesh; }
457
458 return 0;
459}
int Size() const
Return the logical size of the array.
Definition array.hpp:192
int Append(const T &el)
Append element 'el' to array, resize if necessary.
Definition array.hpp:941
virtual void Transform(const IntegrationPoint &, Vector &)=0
Transform integration point from reference coordinates to physical coordinates and store them in the ...
FindPointsGSLIB can robustly evaluate a GridFunction on an arbitrary collection of points....
Definition gslib.hpp:115
virtual const Vector & GetDist() const
Return distance between the sought and the found point in physical space.
Definition gslib.hpp:614
void Setup(Mesh &m, const double bbox_rel_size_inc=0.1, const double newt_tol=1.0e-12, const int npt_max=256)
Preprocess the internal mesh in gslib.
Definition gslib.cpp:321
virtual void Interpolate(const GridFunction &field_in, Vector &field_out)
Interpolation of field values at prescribed reference space positions.
Definition gslib.cpp:3679
virtual const Array< unsigned int > & GetCode() const
Return code for each point searched by FindPoints: inside element (0), element boundary (1),...
Definition gslib.hpp:606
void SetupSurfWithAABBExpansion(Mesh &m, const Vector &aabb_sz_inc, const double newt_tol=1.0e-12)
Preprocess the surface mesh to compute data for FindPoints using absolute AABB expansion.
Definition gslib.cpp:1200
virtual void SetL2AvgType(AvgType avgtype_)
Average type to be used for L2 functions in-case a point is located at an element boundary where the ...
Definition gslib.hpp:565
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
Definition fe_coll.hpp:27
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition fespace.hpp:210
int GetElementOrder(int i) const
Returns the order of the i'th finite element.
Definition fespace.cpp:195
Mesh * GetMesh() const
Returns the mesh.
Definition fespace.hpp:639
virtual void PRefineAndUpdate(const Array< pRefinement > &refs, bool want_transfer=true)
Definition fespace.cpp:4315
static void GetRandomPoint(int GeomType, IntegrationPoint &ip)
Get a random point in the reference element specified by GeomType.
Definition geom.cpp:314
Class for grid function - Vector with associated FE space.
Definition gridfunc.hpp:53
virtual void Update()
Transform by the Space UpdateMatrix (e.g., on Mesh change).
Definition gridfunc.cpp:169
std::unique_ptr< GridFunction > ProlongateToMaxOrder() const
Return a GridFunction with the values of this, prolongated to the maximum order of all elements in th...
virtual void ProjectCoefficient(Coefficient &coeff, ProjectType type=ProjectType::DEFAULT)
Project coeff Coefficient to this GridFunction. The projection computation depends on the choice of t...
Arbitrary order H1-conforming (continuous) finite elements.
Definition fe_coll.hpp:291
const char * Name() const override
Definition fe_coll.hpp:313
Class for integration point with weight.
Definition intrules.hpp:35
Arbitrary order "L2-conforming" discontinuous finite elements.
Definition fe_coll.hpp:369
Mesh data type.
Definition mesh.hpp:67
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
Definition mesh.hpp:309
Geometry::Type GetElementGeometry(int i) const
Definition mesh.hpp:1548
int GetNE() const
Returns number of elements.
Definition mesh.hpp:1390
void GetBoundingBox(Vector &min, Vector &max, int ref=2)
Returns the minimum and maximum corners of the mesh bounding box.
Definition mesh.cpp:142
int Dimension() const
Dimension of the reference space used within the elements.
Definition mesh.hpp:1314
void RandomRefinement(real_t prob, bool aniso=false, int nonconforming=-1, int nc_limit=0)
Refine each element with given probability. Uses GeneralRefinement.
Definition mesh.cpp:11805
void GetElementTransformation(int i, IsoparametricTransformation *ElTr) const
Builds the transformation defining the i-th element in ElTr. ElTr must be allocated in advance and wi...
Definition mesh.cpp:361
int SpaceDimension() const
Dimension of the physical space containing the mesh.
Definition mesh.hpp:1317
void SetNodalGridFunction(GridFunction *nodes, bool make_owner=false)
Definition mesh.cpp:7200
void GetNodes(Vector &node_coord) const
Definition mesh.cpp:10112
virtual void SetNodalFESpace(FiniteElementSpace *nfes)
Definition mesh.cpp:7153
void EnsureNCMesh(bool simplices_nonconforming=false)
Definition mesh.cpp:11781
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
Definition mesh.cpp:12125
Arbitrary order H(curl)-conforming Nedelec finite elements.
Definition fe_coll.hpp:526
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
void PrintUsage(std::ostream &out) const
Print the usage message.
void PrintOptions(std::ostream &out) const
Print the options.
void AddOption(bool *var, const char *enable_short_name, const char *enable_long_name, const char *disable_short_name, const char *disable_long_name, const char *description, bool required=false)
Add a boolean option and set 'var' to receive the value. Enable/disable tags are used to set the bool...
Definition optparser.hpp:82
bool Good() const
Return true if the command line options were parsed successfully.
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
Definition fe_coll.hpp:430
static SubMesh CreateFromBoundary(const Mesh &parent, const Array< int > &boundary_attributes)
Create a surface SubMesh from its parent.
Definition submesh.cpp:27
A general vector function coefficient.
Vector data type.
Definition vector.hpp:82
void Randomize(int seed=0)
Set random values in the vector.
Definition vector.cpp:955
int Size() const
Returns the size of the vector.
Definition vector.hpp:234
void SetSize(int s)
Resize the vector to size s.
Definition vector.hpp:633
int dim
Definition ex24.cpp:53
double field_func(const Vector &x)
Definition findpts.cpp:83
double func_order
Definition findpts.cpp:80
void F_exact(const Vector &p, Vector &F)
Definition findpts.cpp:91
void VisualizeFESpacePolynomialOrder(FiniteElementSpace &fespace, const char *title, int locx)
Definition findpts.cpp:62
int main()
void VisualizeField(socketstream &sock, const char *vishost, int visport, GridFunction &gf, const char *title, int x, int y, int w, int h, const char *keys, bool vec)
STL namespace.
real_t p(const Vector &x, real_t t)