MFEM v4.8.0
Finite element discretization library
Loading...
Searching...
No Matches
ex6p.cpp
Go to the documentation of this file.
1// MFEM Example 6 - Parallel Version
2//
3// Compile with: make ex6p
4//
5// Sample runs: mpirun -np 4 ex6p -m ../data/star-hilbert.mesh -o 2
6// mpirun -np 4 ex6p -m ../data/star-hilbert.mesh -pref
7// mpirun -np 4 ex6p -m ../data/square-disc.mesh -rm 1 -o 1
8// mpirun -np 4 ex6p -m ../data/square-disc.mesh -rm 1 -o 2 -h1
9// mpirun -np 4 ex6p -m ../data/square-disc.mesh -o 2 -cs
10// mpirun -np 4 ex6p -m ../data/square-disc-nurbs.mesh -o 2
11// mpirun -np 4 ex6p -m ../data/fichera.mesh -o 2
12// mpirun -np 4 ex6p -m ../data/escher.mesh -rm 2 -o 2
13// mpirun -np 4 ex6p -m ../data/escher.mesh -o 2 -cs
14// mpirun -np 4 ex6p -m ../data/disc-nurbs.mesh -o 2
15// mpirun -np 4 ex6p -m ../data/ball-nurbs.mesh
16// mpirun -np 4 ex6p -m ../data/pipe-nurbs.mesh
17// mpirun -np 4 ex6p -m ../data/star-surf.mesh -o 2
18// mpirun -np 4 ex6p -m ../data/square-disc-surf.mesh -rm 2 -o 2
19// mpirun -np 4 ex6p -m ../data/inline-segment.mesh -o 1 -md 200
20// mpirun -np 4 ex6p -m ../data/amr-quad.mesh
21// mpirun -np 4 ex6p --restart
22//
23// Device sample runs:
24// mpirun -np 4 ex6p -pa -d cuda
25// mpirun -np 4 ex6p -pa -d occa-cuda
26// mpirun -np 4 ex6p -pa -d raja-omp
27// mpirun -np 4 ex6p -pa -d ceed-cpu
28// * mpirun -np 4 ex6p -pa -d ceed-cuda
29// mpirun -np 4 ex6p -pa -d ceed-cuda:/gpu/cuda/shared
30//
31// Description: This is a version of Example 1 with a simple adaptive mesh
32// refinement loop. The problem being solved is again the Poisson
33// equation -Delta u = 1 with homogeneous Dirichlet boundary
34// conditions. The problem is solved on a sequence of meshes which
35// are locally refined in a conforming (triangles, tetrahedrons)
36// or non-conforming (quadrilaterals, hexahedra) manner according
37// to a simple ZZ error estimator.
38//
39// The example demonstrates MFEM's capability to work with both
40// conforming and nonconforming refinements, in 2D and 3D, on
41// linear, curved and surface meshes. Interpolation of functions
42// from coarse to fine meshes, restarting from a checkpoint, as
43// well as persistent GLVis visualization are also illustrated.
44//
45// There is also the option to use hp-refinement. Real
46// applications should use some problem-dependent criteria for
47// selecting between h- and p-refinement, but in this example, we
48// simply alternate between refinement types to demonstrate the
49// capabilities.
50//
51// We recommend viewing Example 1 before viewing this example.
52
53#include "mfem.hpp"
54#include <fstream>
55#include <iostream>
56
57using namespace std;
58using namespace mfem;
59
60int main(int argc, char *argv[])
61{
62 // 1. Initialize MPI and HYPRE.
63 Mpi::Init(argc, argv);
64 int num_procs = Mpi::WorldSize();
65 int myid = Mpi::WorldRank();
67
68 // 2. Parse command-line options.
69 const char *mesh_file = "../data/star.mesh";
70 int order = 1;
71 bool pa = false;
72 const char *device_config = "cpu";
73 bool nc_simplices = true;
74 int reorder_mesh = 0;
75 int max_dofs = 100000;
76 bool smooth_rt = true;
77 bool restart = false;
78 bool visualization = true;
79 bool rebalance = true;
80 bool usePRefinement = false;
81
82 OptionsParser args(argc, argv);
83 args.AddOption(&mesh_file, "-m", "--mesh",
84 "Mesh file to use.");
85 args.AddOption(&order, "-o", "--order",
86 "Finite element order (polynomial degree).");
87 args.AddOption(&pa, "-pa", "--partial-assembly", "-no-pa",
88 "--no-partial-assembly", "Enable Partial Assembly.");
89 args.AddOption(&device_config, "-d", "--device",
90 "Device configuration string, see Device::Configure().");
91 args.AddOption(&reorder_mesh, "-rm", "--reorder-mesh",
92 "Reorder elements of the coarse mesh to improve "
93 "dynamic partitioning: 0=none, 1=hilbert, 2=gecko.");
94 args.AddOption(&nc_simplices, "-ns", "--nonconforming-simplices",
95 "-cs", "--conforming-simplices",
96 "For simplicial meshes, enable/disable nonconforming"
97 " refinement");
98 args.AddOption(&max_dofs, "-md", "--max-dofs",
99 "Stop after reaching this many degrees of freedom.");
100 args.AddOption(&smooth_rt, "-rt", "--smooth-rt", "-h1", "--smooth-h1",
101 "Represent the smooth flux in RT or vector H1 space.");
102 args.AddOption(&usePRefinement, "-pref", "--p-refine", "-no-pref",
103 "--no-p-refine", "Alternate between h- and p-refinement.");
104 args.AddOption(&rebalance, "-reb", "--rebalance", "-no-reb",
105 "--no-rebalance", "Load balance the nonconforming mesh.");
106 args.AddOption(&restart, "-res", "--restart", "-no-res", "--no-restart",
107 "Restart computation from the last checkpoint.");
108 args.AddOption(&visualization, "-vis", "--visualization", "-no-vis",
109 "--no-visualization",
110 "Enable or disable GLVis visualization.");
111 args.Parse();
112 if (!args.Good())
113 {
114 if (myid == 0)
115 {
116 args.PrintUsage(cout);
117 }
118 return 1;
119 }
120 if (myid == 0)
121 {
122 args.PrintOptions(cout);
123 }
124
125 if (usePRefinement && rebalance)
126 {
127 rebalance = false;
128 if (myid == 0)
129 {
130 cout << "Load balancing is not performed with p-refinements.\n";
131 }
132 }
133
134 // 3. Enable hardware devices such as GPUs, and programming models such as
135 // CUDA, OCCA, RAJA and OpenMP based on command line options.
136 Device device(device_config);
137 if (myid == 0) { device.Print(); }
138
139 ParMesh *pmesh;
140 if (!restart)
141 {
142 // 4. Read the (serial) mesh from the given mesh file on all processors.
143 // We can handle triangular, quadrilateral, tetrahedral, hexahedral,
144 // surface and volume meshes with the same code.
145 Mesh mesh(mesh_file, 1, 1);
146
147 // 5. A NURBS mesh cannot be refined locally so we refine it uniformly
148 // and project it to a standard curvilinear mesh of order 2.
149 if (mesh.NURBSext)
150 {
151 mesh.UniformRefinement();
152 mesh.SetCurvature(2);
153 }
154
155 // 6. MFEM supports dynamic partitioning (load balancing) of parallel non-
156 // conforming meshes based on space-filling curve (SFC) partitioning.
157 // SFC partitioning is extremely fast and scales to hundreds of
158 // thousands of processors, but requires the coarse mesh to be ordered,
159 // ideally as a sequence of face-neighbors. The mesh may already be
160 // ordered (like star-hilbert.mesh) or we can order it here. Ordering
161 // type 1 is a fast spatial sort of the mesh, type 2 is a high quality
162 // optimization algorithm suitable for ordering general unstructured
163 // meshes.
164 if (reorder_mesh)
165 {
166 Array<int> ordering;
167 switch (reorder_mesh)
168 {
169 case 1: mesh.GetHilbertElementOrdering(ordering); break;
170 case 2: mesh.GetGeckoElementOrdering(ordering); break;
171 default: MFEM_ABORT("Unknown mesh reodering type " << reorder_mesh);
172 }
173 mesh.ReorderElements(ordering);
174 }
175
176 // 7. Make sure the mesh is in the non-conforming mode to enable local
177 // refinement of quadrilaterals/hexahedra, and the above partitioning
178 // algorithm. Simplices can be refined either in conforming or in non-
179 // conforming mode. The conforming mode however does not support
180 // dynamic partitioning.
181 mesh.EnsureNCMesh(nc_simplices);
182
183 // 8. Define a parallel mesh by partitioning the serial mesh.
184 // Once the parallel mesh is defined, the serial mesh can be deleted.
185 pmesh = new ParMesh(MPI_COMM_WORLD, mesh);
186 }
187 else
188 {
189 // 9. We can also restart the computation by loading the mesh from a
190 // previously saved check-point.
191 string fname(MakeParFilename("ex6p-checkpoint.", myid));
192 ifstream ifs(fname);
193 MFEM_VERIFY(ifs.good(), "Checkpoint file " << fname << " not found.");
194 pmesh = new ParMesh(MPI_COMM_WORLD, ifs);
195 }
196
197 int dim = pmesh->Dimension();
198 int sdim = pmesh->SpaceDimension();
199
200 MFEM_VERIFY(pmesh->bdr_attributes.Size() > 0,
201 "Boundary attributes required in the mesh.");
202 Array<int> ess_bdr(pmesh->bdr_attributes.Max());
203 ess_bdr = 1;
204
205 // 10. Define a finite element space on the mesh. The polynomial order is
206 // one (linear) by default, but this can be changed on the command line.
207 H1_FECollection fec(order, dim);
208 ParFiniteElementSpace fespace(pmesh, &fec);
209
210 // 11. As in Example 1p, we set up bilinear and linear forms corresponding to
211 // the Poisson problem -\Delta u = 1. We don't assemble the discrete
212 // problem yet, this will be done in the main loop.
213 ParBilinearForm a(&fespace);
214 if (pa)
215 {
216 a.SetAssemblyLevel(AssemblyLevel::PARTIAL);
217 a.SetDiagonalPolicy(Operator::DIAG_ONE);
218 }
219 ParLinearForm b(&fespace);
220
221 ConstantCoefficient one(1.0);
222
224 a.AddDomainIntegrator(integ);
225 b.AddDomainIntegrator(new DomainLFIntegrator(one));
226
227 // 12. The solution vector x and the associated finite element grid function
228 // will be maintained over the AMR iterations. We initialize it to zero.
229 ParGridFunction x(&fespace);
230 x = 0;
231
232 // 13. Connect to GLVis.
233 char vishost[] = "localhost";
234 int visport = 19916;
235
236 socketstream sout;
237 if (visualization)
238 {
239 sout.open(vishost, visport);
240 if (!sout)
241 {
242 if (myid == 0)
243 {
244 cout << "Unable to connect to GLVis server at "
245 << vishost << ':' << visport << endl;
246 cout << "GLVis visualization disabled.\n";
247 }
248 visualization = false;
249 }
250
251 sout.precision(8);
252 }
253
254 // 14. Set up an error estimator. Here we use the Zienkiewicz-Zhu estimator
255 // with L2 projection in the smoothing step to better handle hanging
256 // nodes and parallel partitioning. We need to supply a space for the
257 // discontinuous flux (L2) and a space for the smoothed flux.
258 L2_FECollection flux_fec(order, dim);
259 ParFiniteElementSpace flux_fes(pmesh, &flux_fec, sdim);
260 FiniteElementCollection *smooth_flux_fec = NULL;
261 ParFiniteElementSpace *smooth_flux_fes = NULL;
262 if (smooth_rt && dim > 1)
263 {
264 // Use an H(div) space for the smoothed flux (this is the default).
265 smooth_flux_fec = new RT_FECollection(order-1, dim);
266 smooth_flux_fes = new ParFiniteElementSpace(pmesh, smooth_flux_fec, 1);
267 }
268 else
269 {
270 // Another possible option for the smoothed flux space: H1^dim space
271 smooth_flux_fec = new H1_FECollection(order, dim);
272 smooth_flux_fes = new ParFiniteElementSpace(pmesh, smooth_flux_fec, dim);
273 }
274 L2ZienkiewiczZhuEstimator estimator(*integ, x, flux_fes, *smooth_flux_fes);
275
276 // 15. A refiner selects and refines elements based on a refinement strategy.
277 // The strategy here is to refine elements with errors larger than a
278 // fraction of the maximum element error. Other strategies are possible.
279 // The refiner will call the given error estimator.
280 ThresholdRefiner refiner(estimator);
281 refiner.SetTotalErrorFraction(0.7);
282
283 // 16. The main AMR loop. In each iteration we solve the problem on the
284 // current mesh, visualize the solution, and refine the mesh.
285 for (int it = 0; ; it++)
286 {
287 HYPRE_BigInt global_dofs = fespace.GlobalTrueVSize();
288 if (myid == 0)
289 {
290 cout << "\nAMR iteration " << it << endl;
291 cout << "Number of unknowns: " << global_dofs << endl;
292 }
293
294 // 17. Assemble the right-hand side and determine the list of true
295 // (i.e. parallel conforming) essential boundary dofs.
296 Array<int> ess_tdof_list;
297 fespace.GetEssentialTrueDofs(ess_bdr, ess_tdof_list);
298 b.Assemble();
299
300 // 18. Assemble the stiffness matrix. Note that MFEM doesn't care at this
301 // point that the mesh is nonconforming and parallel. The FE space is
302 // considered 'cut' along hanging edges/faces, and also across
303 // processor boundaries.
304 a.Assemble();
305
306 // 19. Create the parallel linear system: eliminate boundary conditions.
307 // The system will be solved for true (unconstrained/unique) DOFs only.
308 OperatorPtr A;
309 Vector B, X;
310
311 const int copy_interior = 1;
312 a.FormLinearSystem(ess_tdof_list, x, b, A, X, B, copy_interior);
313
314 // 20. Solve the linear system A X = B.
315 // * With full assembly, use the BoomerAMG preconditioner from hypre.
316 // * With partial assembly, use a diagonal preconditioner.
317 Solver *M = NULL;
318 if (pa)
319 {
320 M = new OperatorJacobiSmoother(a, ess_tdof_list);
321 }
322 else
323 {
325 amg->SetPrintLevel(0);
326 M = amg;
327 }
328 CGSolver cg(MPI_COMM_WORLD);
329 cg.SetRelTol(1e-6);
330 cg.SetMaxIter(2000);
331 cg.SetPrintLevel(3); // print the first and the last iterations only
332 cg.SetPreconditioner(*M);
333 cg.SetOperator(*A);
334 cg.Mult(B, X);
335 delete M;
336
337 // 21. Switch back to the host and extract the parallel grid function
338 // corresponding to the finite element approximation X. This is the
339 // local solution on each processor.
340 a.RecoverFEMSolution(X, b, x);
341
342 // 22. Send the solution by socket to a GLVis server.
343 if (visualization)
344 {
345 sout << "parallel " << num_procs << " " << myid << "\n";
346 if (usePRefinement)
347 {
348 std::unique_ptr<GridFunction> vis_x = x.ProlongateToMaxOrder();
349 sout << "solution\n" << *pmesh << *vis_x << flush;
350 }
351 else
352 {
353 sout << "solution\n" << *pmesh << x << flush;
354 }
355 }
356
357 if (global_dofs >= max_dofs)
358 {
359 if (myid == 0)
360 {
361 cout << "Reached the maximum number of dofs. Stop." << endl;
362 }
363 break;
364 }
365
366 // 23. Call the refiner to modify the mesh. The refiner calls the error
367 // estimator to obtain element errors, then it selects elements to be
368 // refined and finally it modifies the mesh. The Stop() method can be
369 // used to determine if a stopping criterion was met.
370
371 // Simply alternate between h- and p-refinement.
372 const bool pRefine = usePRefinement && ((it % 2) == 1);
373 bool stop = false;
374 Array<pRefinement> prefinements;
375 if (pRefine)
376 {
377 Array<Refinement> refinements;
378 refiner.MarkWithoutRefining(*pmesh, refinements);
379 stop = pmesh->ReduceInt(refinements.Size()) == 0LL;
380
381 prefinements.SetSize(refinements.Size());
382 for (int i=0; i<refinements.Size(); ++i)
383 {
384 prefinements[i].index = refinements[i].index;
385 prefinements[i].delta = 1; // Increase the element order by 1
386 }
387 }
388 else
389 {
390 refiner.Apply(*pmesh);
391 stop = refiner.Stop();
392 }
393
394 if (stop)
395 {
396 if (myid == 0)
397 {
398 cout << "Stopping criterion satisfied. Stop." << endl;
399 }
400 break;
401 }
402
403 // 24. Update the finite element space (recalculate the number of DOFs,
404 // etc.) and create a grid function update matrix. Apply the matrix
405 // to any GridFunctions over the space. In this case, the update
406 // matrix is an interpolation matrix so the updated GridFunction will
407 // still represent the same function as before refinement.
408 if (pRefine)
409 {
410 fespace.PRefineAndUpdate(prefinements);
411 }
412 else
413 {
414 fespace.Update();
415 }
416
417 x.Update();
418
419 // 25. Load balance the mesh, and update the space and solution. Currently
420 // available only for nonconforming meshes.
421 if (pmesh->Nonconforming() && rebalance)
422 {
423 pmesh->Rebalance();
424
425 // Update the space and the GridFunction. This time the update matrix
426 // redistributes the GridFunction among the processors.
427 fespace.Update();
428 x.Update();
429 }
430
431 // 26. Inform also the bilinear and linear forms that the space has
432 // changed.
433 a.Update();
434 b.Update();
435
436 // 27. Save the current state of the mesh every 5 iterations. The
437 // computation can be restarted from this point. Note that unlike in
438 // visualization, we need to use the 'ParPrint' method to save all
439 // internal parallel data structures.
440 if ((it + 1) % 5 == 0)
441 {
442 ofstream ofs(MakeParFilename("ex6p-checkpoint.", myid));
443 ofs.precision(8);
444 pmesh->ParPrint(ofs);
445
446 if (myid == 0)
447 {
448 cout << "\nCheckpoint saved." << endl;
449 }
450 }
451 }
452
453 // Save result
454 if (usePRefinement)
455 {
456 L2_FECollection fecL2(0, dim);
457 ParFiniteElementSpace l2fespace(pmesh, &fecL2);
458 ParGridFunction xo(&l2fespace); // Element order field
459 xo = 0.0;
460
461 for (int e=0; e<pmesh->GetNE(); ++e)
462 {
463 const int p_elem = fespace.GetElementOrder(e);
464 Array<int> dofs;
465 l2fespace.GetElementDofs(e, dofs);
466 xo[dofs[0]] = p_elem;
467 }
468
469 ostringstream mesh_name, sol_name, order_name;
470 mesh_name << "mesh." << setfill('0') << setw(6) << myid;
471 sol_name << "sol." << setfill('0') << setw(6) << myid;
472 order_name << "order." << setfill('0') << setw(6) << myid;
473
474 ofstream mesh_ofs(mesh_name.str().c_str());
475 mesh_ofs.precision(8);
476 pmesh->ParPrint(mesh_ofs);
477
478 ofstream sol_ofs(sol_name.str().c_str());
479 sol_ofs.precision(8);
480
481 std::unique_ptr<ParGridFunction> vis_x = x.ProlongateToMaxOrder();
482 vis_x->Save(sol_ofs);
483
484 ofstream order_ofs(order_name.str().c_str());
485 order_ofs.precision(8);
486 xo.Save(order_ofs);
487 }
488
489 delete smooth_flux_fes;
490 delete smooth_flux_fec;
491 delete pmesh;
492
493 return 0;
494}
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
Definition array.cpp:68
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
Definition array.hpp:758
int Size() const
Return the logical size of the array.
Definition array.hpp:147
Abstract base class BilinearFormIntegrator.
Conjugate gradient method.
Definition solvers.hpp:538
void Mult(const Vector &b, Vector &x) const override
Iterative solution of the linear system using the Conjugate Gradient method.
Definition solvers.cpp:751
void SetOperator(const Operator &op) override
Set/update the solver for the given operator.
Definition solvers.hpp:551
A coefficient that is constant across space and time.
The MFEM Device class abstracts hardware devices such as GPUs, as well as programming models such as ...
Definition device.hpp:123
void Print(std::ostream &out=mfem::out)
Print the configuration of the MFEM virtual device object.
Definition device.cpp:297
Class for domain integration .
Definition lininteg.hpp:106
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
Definition fe_coll.hpp:27
int GetElementOrder(int i) const
Returns the order of the i'th finite element.
Definition fespace.cpp:221
Arbitrary order H1-conforming (continuous) finite elements.
Definition fe_coll.hpp:275
The BoomerAMG solver in hypre.
Definition hypre.hpp:1717
void SetPrintLevel(int print_level)
Definition hypre.hpp:1797
static void Init()
Initialize hypre by calling HYPRE_Init() and set default options. After calling Hypre::Init(),...
Definition hypre.cpp:33
void SetRelTol(real_t rtol)
Definition solvers.hpp:229
virtual void SetPreconditioner(Solver &pr)
This should be called before SetOperator.
Definition solvers.cpp:174
virtual void SetPrintLevel(int print_lvl)
Legacy method to set the level of verbosity of the solver output.
Definition solvers.cpp:72
void SetMaxIter(int max_it)
Definition solvers.hpp:231
The L2ZienkiewiczZhuEstimator class implements the Zienkiewicz-Zhu error estimation procedure where t...
Arbitrary order "L2-conforming" discontinuous finite elements.
Definition fe_coll.hpp:346
bool Apply(Mesh &mesh)
Perform the mesh operation.
bool Stop() const
Check if STOP action is requested, e.g. stopping criterion is satisfied.
Mesh data type.
Definition mesh.hpp:64
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
Definition mesh.hpp:290
NURBSExtension * NURBSext
Optional NURBS mesh extension.
Definition mesh.hpp:298
bool Nonconforming() const
Return a bool indicating whether this mesh is nonconforming.
Definition mesh.hpp:2367
real_t GetGeckoElementOrdering(Array< int > &ordering, int iterations=4, int window=4, int period=2, int seed=0, bool verbose=false, real_t time_limit=0)
Definition mesh.cpp:2466
int GetNE() const
Returns number of elements.
Definition mesh.hpp:1282
int Dimension() const
Dimension of the reference space used within the elements.
Definition mesh.hpp:1216
void ReorderElements(const Array< int > &ordering, bool reorder_vertices=true)
Definition mesh.cpp:2685
int SpaceDimension() const
Dimension of the physical space containing the mesh.
Definition mesh.hpp:1219
void GetHilbertElementOrdering(Array< int > &ordering)
Definition mesh.cpp:2633
void EnsureNCMesh(bool simplices_nonconforming=false)
Definition mesh.cpp:10951
virtual void SetCurvature(int order, bool discont=false, int space_dim=-1, int ordering=1)
Set the curvature of the mesh nodes using the given polynomial degree.
Definition mesh.cpp:6484
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
Definition mesh.cpp:11295
static int WorldRank()
Return the MPI rank in MPI_COMM_WORLD.
static int WorldSize()
Return the size of MPI_COMM_WORLD.
static void Init(int &argc, char **&argv, int required=default_thread_required, int *provided=nullptr)
Singleton creation with Mpi::Init(argc, argv).
Pointer to an Operator of a specified type.
Definition handle.hpp:34
Jacobi smoothing for a given bilinear form (no matrix necessary).
Definition solvers.hpp:333
@ DIAG_ONE
Set the diagonal value to one.
Definition operator.hpp:50
virtual void RecoverFEMSolution(const Vector &X, const Vector &b, Vector &x)
Reconstruct a solution vector x (e.g. a GridFunction) from the solution X of a constrained linear sys...
Definition operator.cpp:148
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.
Class for parallel bilinear form.
Abstract parallel finite element space.
Definition pfespace.hpp:29
void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1) const override
HYPRE_BigInt GlobalTrueVSize() const
Definition pfespace.hpp:346
void GetElementDofs(int i, Array< int > &dofs, DofTransformation &doftrans) const override
The same as GetElementDofs(), but with a user-allocated DofTransformation object. doftrans must be al...
Definition pfespace.cpp:561
void PRefineAndUpdate(const Array< pRefinement > &refs, bool want_transfer=true) override
void Update(bool want_transform=true) override
Class for parallel grid function.
Definition pgridfunc.hpp:50
void Save(std::ostream &out) const override
void Update() override
Transform by the Space UpdateMatrix (e.g., on Mesh change).
Definition pgridfunc.cpp:91
std::unique_ptr< ParGridFunction > ProlongateToMaxOrder() const
Return a GridFunction with the values of this, prolongated to the maximum order of all elements in th...
Class for parallel linear form.
Class for parallel meshes.
Definition pmesh.hpp:34
void ParPrint(std::ostream &out, const std::string &comments="") const
Definition pmesh.cpp:6313
void Rebalance()
Definition pmesh.cpp:4008
long long ReduceInt(int value) const override
Utility function: sum integers from all processors (Allreduce).
Definition pmesh.cpp:6306
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
Definition fe_coll.hpp:403
Base class for solvers.
Definition operator.hpp:780
Mesh refinement operator using an error threshold.
void SetTotalErrorFraction(real_t fraction)
Set the total fraction used in the computation of the threshold. The default value is 1/2.
int MarkWithoutRefining(Mesh &mesh, Array< Refinement > &refinements)
Set the array refinements of elements to refine, without refining.
Vector data type.
Definition vector.hpp:82
int open(const char hostname[], int port)
Open the socket stream on 'port' at 'hostname'.
int dim
Definition ex24.cpp:53
int main()
HYPRE_Int HYPRE_BigInt
real_t b
Definition lissajous.cpp:42
real_t a
Definition lissajous.cpp:41
std::string MakeParFilename(const std::string &prefix, const int myid, const std::string suffix, const int width)
Construct a string of the form "<prefix><myid><suffix>" where the integer myid is padded with leading...
Definition globals.cpp:48
const char vishost[]