MFEM  v4.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
ex9p.cpp
Go to the documentation of this file.
1 // MFEM Example 9 - Parallel Version
2 //
3 // Compile with: make ex9p
4 //
5 // Sample runs:
6 // mpirun -np 4 ex9p -m ../data/periodic-segment.mesh -p 0 -dt 0.005
7 // mpirun -np 4 ex9p -m ../data/periodic-square.mesh -p 0 -dt 0.01
8 // mpirun -np 4 ex9p -m ../data/periodic-hexagon.mesh -p 0 -dt 0.01
9 // mpirun -np 4 ex9p -m ../data/periodic-square.mesh -p 1 -dt 0.005 -tf 9
10 // mpirun -np 4 ex9p -m ../data/periodic-hexagon.mesh -p 1 -dt 0.005 -tf 9
11 // mpirun -np 4 ex9p -m ../data/amr-quad.mesh -p 1 -rp 1 -dt 0.002 -tf 9
12 // mpirun -np 4 ex9p -m ../data/star-q3.mesh -p 1 -rp 1 -dt 0.004 -tf 9
13 // mpirun -np 4 ex9p -m ../data/star-mixed.mesh -p 1 -rp 1 -dt 0.004 -tf 9
14 // mpirun -np 4 ex9p -m ../data/disc-nurbs.mesh -p 1 -rp 1 -dt 0.005 -tf 9
15 // mpirun -np 4 ex9p -m ../data/disc-nurbs.mesh -p 2 -rp 1 -dt 0.005 -tf 9
16 // mpirun -np 4 ex9p -m ../data/periodic-square.mesh -p 3 -rp 2 -dt 0.0025 -tf 9 -vs 20
17 // mpirun -np 4 ex9p -m ../data/periodic-cube.mesh -p 0 -o 2 -rp 1 -dt 0.01 -tf 8
18 //
19 // Description: This example code solves the time-dependent advection equation
20 // du/dt + v.grad(u) = 0, where v is a given fluid velocity, and
21 // u0(x)=u(0,x) is a given initial condition.
22 //
23 // The example demonstrates the use of Discontinuous Galerkin (DG)
24 // bilinear forms in MFEM (face integrators), the use of explicit
25 // ODE time integrators, the definition of periodic boundary
26 // conditions through periodic meshes, as well as the use of GLVis
27 // for persistent visualization of a time-evolving solution. The
28 // saving of time-dependent data files for external visualization
29 // with VisIt (visit.llnl.gov) is also illustrated.
30 
31 #include "mfem.hpp"
32 #include <fstream>
33 #include <iostream>
34 
35 using namespace std;
36 using namespace mfem;
37 
38 // Choice for the problem setup. The fluid velocity, initial condition and
39 // inflow boundary condition are chosen based on this parameter.
40 int problem;
41 
42 // Velocity coefficient
43 void velocity_function(const Vector &x, Vector &v);
44 
45 // Initial condition
46 double u0_function(const Vector &x);
47 
48 // Inflow boundary condition
49 double inflow_function(const Vector &x);
50 
51 // Mesh bounding box
53 
54 
55 /** A time-dependent operator for the right-hand side of the ODE. The DG weak
56  form of du/dt = -v.grad(u) is M du/dt = K u + b, where M and K are the mass
57  and advection matrices, and b describes the flow on the boundary. This can
58  be written as a general ODE, du/dt = M^{-1} (K u + b), and this class is
59  used to evaluate the right-hand side. */
61 {
62 private:
63  HypreParMatrix &M, &K;
64  const Vector &b;
65  HypreSmoother M_prec;
66  CGSolver M_solver;
67 
68  mutable Vector z;
69 
70 public:
71  FE_Evolution(HypreParMatrix &_M, HypreParMatrix &_K, const Vector &_b);
72 
73  virtual void Mult(const Vector &x, Vector &y) const;
74 
75  virtual ~FE_Evolution() { }
76 };
77 
78 
79 int main(int argc, char *argv[])
80 {
81  // 1. Initialize MPI.
82  int num_procs, myid;
83  MPI_Init(&argc, &argv);
84  MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
85  MPI_Comm_rank(MPI_COMM_WORLD, &myid);
86 
87  // 2. Parse command-line options.
88  problem = 0;
89  const char *mesh_file = "../data/periodic-hexagon.mesh";
90  int ser_ref_levels = 2;
91  int par_ref_levels = 0;
92  int order = 3;
93  int ode_solver_type = 4;
94  double t_final = 10.0;
95  double dt = 0.01;
96  bool visualization = true;
97  bool visit = false;
98  bool binary = false;
99  int vis_steps = 5;
100 
101  int precision = 8;
102  cout.precision(precision);
103 
104  OptionsParser args(argc, argv);
105  args.AddOption(&mesh_file, "-m", "--mesh",
106  "Mesh file to use.");
107  args.AddOption(&problem, "-p", "--problem",
108  "Problem setup to use. See options in velocity_function().");
109  args.AddOption(&ser_ref_levels, "-rs", "--refine-serial",
110  "Number of times to refine the mesh uniformly in serial.");
111  args.AddOption(&par_ref_levels, "-rp", "--refine-parallel",
112  "Number of times to refine the mesh uniformly in parallel.");
113  args.AddOption(&order, "-o", "--order",
114  "Order (degree) of the finite elements.");
115  args.AddOption(&ode_solver_type, "-s", "--ode-solver",
116  "ODE solver: 1 - Forward Euler,\n\t"
117  " 2 - RK2 SSP, 3 - RK3 SSP, 4 - RK4, 6 - RK6.");
118  args.AddOption(&t_final, "-tf", "--t-final",
119  "Final time; start time is 0.");
120  args.AddOption(&dt, "-dt", "--time-step",
121  "Time step.");
122  args.AddOption(&visualization, "-vis", "--visualization", "-no-vis",
123  "--no-visualization",
124  "Enable or disable GLVis visualization.");
125  args.AddOption(&visit, "-visit", "--visit-datafiles", "-no-visit",
126  "--no-visit-datafiles",
127  "Save data files for VisIt (visit.llnl.gov) visualization.");
128  args.AddOption(&binary, "-binary", "--binary-datafiles", "-ascii",
129  "--ascii-datafiles",
130  "Use binary (Sidre) or ascii format for VisIt data files.");
131  args.AddOption(&vis_steps, "-vs", "--visualization-steps",
132  "Visualize every n-th timestep.");
133  args.Parse();
134  if (!args.Good())
135  {
136  if (myid == 0)
137  {
138  args.PrintUsage(cout);
139  }
140  MPI_Finalize();
141  return 1;
142  }
143  if (myid == 0)
144  {
145  args.PrintOptions(cout);
146  }
147 
148  // 3. Read the serial mesh from the given mesh file on all processors. We can
149  // handle geometrically periodic meshes in this code.
150  Mesh *mesh = new Mesh(mesh_file, 1, 1);
151  int dim = mesh->Dimension();
152 
153  // 4. Define the ODE solver used for time integration. Several explicit
154  // Runge-Kutta methods are available.
155  ODESolver *ode_solver = NULL;
156  switch (ode_solver_type)
157  {
158  case 1: ode_solver = new ForwardEulerSolver; break;
159  case 2: ode_solver = new RK2Solver(1.0); break;
160  case 3: ode_solver = new RK3SSPSolver; break;
161  case 4: ode_solver = new RK4Solver; break;
162  case 6: ode_solver = new RK6Solver; break;
163  default:
164  if (myid == 0)
165  {
166  cout << "Unknown ODE solver type: " << ode_solver_type << '\n';
167  }
168  delete mesh;
169  MPI_Finalize();
170  return 3;
171  }
172 
173  // 5. Refine the mesh in serial to increase the resolution. In this example
174  // we do 'ser_ref_levels' of uniform refinement, where 'ser_ref_levels' is
175  // a command-line parameter. If the mesh is of NURBS type, we convert it
176  // to a (piecewise-polynomial) high-order mesh.
177  for (int lev = 0; lev < ser_ref_levels; lev++)
178  {
179  mesh->UniformRefinement();
180  }
181  if (mesh->NURBSext)
182  {
183  mesh->SetCurvature(max(order, 1));
184  }
185  mesh->GetBoundingBox(bb_min, bb_max, max(order, 1));
186 
187  // 6. Define the parallel mesh by a partitioning of the serial mesh. Refine
188  // this mesh further in parallel to increase the resolution. Once the
189  // parallel mesh is defined, the serial mesh can be deleted.
190  ParMesh *pmesh = new ParMesh(MPI_COMM_WORLD, *mesh);
191  delete mesh;
192  for (int lev = 0; lev < par_ref_levels; lev++)
193  {
194  pmesh->UniformRefinement();
195  }
196 
197  // 7. Define the parallel discontinuous DG finite element space on the
198  // parallel refined mesh of the given polynomial order.
199  DG_FECollection fec(order, dim);
200  ParFiniteElementSpace *fes = new ParFiniteElementSpace(pmesh, &fec);
201 
202  HYPRE_Int global_vSize = fes->GlobalTrueVSize();
203  if (myid == 0)
204  {
205  cout << "Number of unknowns: " << global_vSize << endl;
206  }
207 
208  // 8. Set up and assemble the parallel bilinear and linear forms (and the
209  // parallel hypre matrices) corresponding to the DG discretization. The
210  // DGTraceIntegrator involves integrals over mesh interior faces.
214 
215  ParBilinearForm *m = new ParBilinearForm(fes);
217  ParBilinearForm *k = new ParBilinearForm(fes);
218  k->AddDomainIntegrator(new ConvectionIntegrator(velocity, -1.0));
220  new TransposeIntegrator(new DGTraceIntegrator(velocity, 1.0, -0.5)));
222  new TransposeIntegrator(new DGTraceIntegrator(velocity, 1.0, -0.5)));
223 
224  ParLinearForm *b = new ParLinearForm(fes);
226  new BoundaryFlowIntegrator(inflow, velocity, -1.0, -0.5));
227 
228  m->Assemble();
229  m->Finalize();
230  int skip_zeros = 0;
231  k->Assemble(skip_zeros);
232  k->Finalize(skip_zeros);
233  b->Assemble();
234 
238 
239  // 9. Define the initial conditions, save the corresponding grid function to
240  // a file and (optionally) save data in the VisIt format and initialize
241  // GLVis visualization.
242  ParGridFunction *u = new ParGridFunction(fes);
243  u->ProjectCoefficient(u0);
244  HypreParVector *U = u->GetTrueDofs();
245 
246  {
247  ostringstream mesh_name, sol_name;
248  mesh_name << "ex9-mesh." << setfill('0') << setw(6) << myid;
249  sol_name << "ex9-init." << setfill('0') << setw(6) << myid;
250  ofstream omesh(mesh_name.str().c_str());
251  omesh.precision(precision);
252  pmesh->Print(omesh);
253  ofstream osol(sol_name.str().c_str());
254  osol.precision(precision);
255  u->Save(osol);
256  }
257 
258  // Create data collection for solution output: either VisItDataCollection for
259  // ascii data files, or SidreDataCollection for binary data files.
260  DataCollection *dc = NULL;
261  if (visit)
262  {
263  if (binary)
264  {
265 #ifdef MFEM_USE_SIDRE
266  dc = new SidreDataCollection("Example9-Parallel", pmesh);
267 #else
268  MFEM_ABORT("Must build with MFEM_USE_SIDRE=YES for binary output.");
269 #endif
270  }
271  else
272  {
273  dc = new VisItDataCollection("Example9-Parallel", pmesh);
274  dc->SetPrecision(precision);
275  // To save the mesh using MFEM's parallel mesh format:
276  // dc->SetFormat(DataCollection::PARALLEL_FORMAT);
277  }
278  dc->RegisterField("solution", u);
279  dc->SetCycle(0);
280  dc->SetTime(0.0);
281  dc->Save();
282  }
283 
284  socketstream sout;
285  if (visualization)
286  {
287  char vishost[] = "localhost";
288  int visport = 19916;
289  sout.open(vishost, visport);
290  if (!sout)
291  {
292  if (myid == 0)
293  cout << "Unable to connect to GLVis server at "
294  << vishost << ':' << visport << endl;
295  visualization = false;
296  if (myid == 0)
297  {
298  cout << "GLVis visualization disabled.\n";
299  }
300  }
301  else
302  {
303  sout << "parallel " << num_procs << " " << myid << "\n";
304  sout.precision(precision);
305  sout << "solution\n" << *pmesh << *u;
306  sout << "pause\n";
307  sout << flush;
308  if (myid == 0)
309  cout << "GLVis visualization paused."
310  << " Press space (in the GLVis window) to resume it.\n";
311  }
312  }
313 
314  // 10. Define the time-dependent evolution operator describing the ODE
315  // right-hand side, and perform time-integration (looping over the time
316  // iterations, ti, with a time-step dt).
317  FE_Evolution adv(*M, *K, *B);
318 
319  double t = 0.0;
320  adv.SetTime(t);
321  ode_solver->Init(adv);
322 
323  bool done = false;
324  for (int ti = 0; !done; )
325  {
326  double dt_real = min(dt, t_final - t);
327  ode_solver->Step(*U, t, dt_real);
328  ti++;
329 
330  done = (t >= t_final - 1e-8*dt);
331 
332  if (done || ti % vis_steps == 0)
333  {
334  if (myid == 0)
335  {
336  cout << "time step: " << ti << ", time: " << t << endl;
337  }
338 
339  // 11. Extract the parallel grid function corresponding to the finite
340  // element approximation U (the local solution on each processor).
341  *u = *U;
342 
343  if (visualization)
344  {
345  sout << "parallel " << num_procs << " " << myid << "\n";
346  sout << "solution\n" << *pmesh << *u << flush;
347  }
348 
349  if (visit)
350  {
351  dc->SetCycle(ti);
352  dc->SetTime(t);
353  dc->Save();
354  }
355  }
356  }
357 
358  // 12. Save the final solution in parallel. This output can be viewed later
359  // using GLVis: "glvis -np <np> -m ex9-mesh -g ex9-final".
360  {
361  *u = *U;
362  ostringstream sol_name;
363  sol_name << "ex9-final." << setfill('0') << setw(6) << myid;
364  ofstream osol(sol_name.str().c_str());
365  osol.precision(precision);
366  u->Save(osol);
367  }
368 
369  // 13. Free the used memory.
370  delete U;
371  delete u;
372  delete B;
373  delete b;
374  delete K;
375  delete k;
376  delete M;
377  delete m;
378  delete fes;
379  delete pmesh;
380  delete ode_solver;
381  delete dc;
382 
383  MPI_Finalize();
384  return 0;
385 }
386 
387 
388 // Implementation of class FE_Evolution
390  const Vector &_b)
391  : TimeDependentOperator(_M.Height()),
392  M(_M), K(_K), b(_b), M_solver(M.GetComm()), z(_M.Height())
393 {
394  M_prec.SetType(HypreSmoother::Jacobi);
395  M_solver.SetPreconditioner(M_prec);
396  M_solver.SetOperator(M);
397 
398  M_solver.iterative_mode = false;
399  M_solver.SetRelTol(1e-9);
400  M_solver.SetAbsTol(0.0);
401  M_solver.SetMaxIter(100);
402  M_solver.SetPrintLevel(0);
403 }
404 
405 void FE_Evolution::Mult(const Vector &x, Vector &y) const
406 {
407  // y = M^{-1} (K x + b)
408  K.Mult(x, z);
409  z += b;
410  M_solver.Mult(z, y);
411 }
412 
413 
414 // Velocity coefficient
415 void velocity_function(const Vector &x, Vector &v)
416 {
417  int dim = x.Size();
418 
419  // map to the reference [-1,1] domain
420  Vector X(dim);
421  for (int i = 0; i < dim; i++)
422  {
423  double center = (bb_min[i] + bb_max[i]) * 0.5;
424  X(i) = 2 * (x(i) - center) / (bb_max[i] - bb_min[i]);
425  }
426 
427  switch (problem)
428  {
429  case 0:
430  {
431  // Translations in 1D, 2D, and 3D
432  switch (dim)
433  {
434  case 1: v(0) = 1.0; break;
435  case 2: v(0) = sqrt(2./3.); v(1) = sqrt(1./3.); break;
436  case 3: v(0) = sqrt(3./6.); v(1) = sqrt(2./6.); v(2) = sqrt(1./6.);
437  break;
438  }
439  break;
440  }
441  case 1:
442  case 2:
443  {
444  // Clockwise rotation in 2D around the origin
445  const double w = M_PI/2;
446  switch (dim)
447  {
448  case 1: v(0) = 1.0; break;
449  case 2: v(0) = w*X(1); v(1) = -w*X(0); break;
450  case 3: v(0) = w*X(1); v(1) = -w*X(0); v(2) = 0.0; break;
451  }
452  break;
453  }
454  case 3:
455  {
456  // Clockwise twisting rotation in 2D around the origin
457  const double w = M_PI/2;
458  double d = max((X(0)+1.)*(1.-X(0)),0.) * max((X(1)+1.)*(1.-X(1)),0.);
459  d = d*d;
460  switch (dim)
461  {
462  case 1: v(0) = 1.0; break;
463  case 2: v(0) = d*w*X(1); v(1) = -d*w*X(0); break;
464  case 3: v(0) = d*w*X(1); v(1) = -d*w*X(0); v(2) = 0.0; break;
465  }
466  break;
467  }
468  }
469 }
470 
471 // Initial condition
472 double u0_function(const Vector &x)
473 {
474  int dim = x.Size();
475 
476  // map to the reference [-1,1] domain
477  Vector X(dim);
478  for (int i = 0; i < dim; i++)
479  {
480  double center = (bb_min[i] + bb_max[i]) * 0.5;
481  X(i) = 2 * (x(i) - center) / (bb_max[i] - bb_min[i]);
482  }
483 
484  switch (problem)
485  {
486  case 0:
487  case 1:
488  {
489  switch (dim)
490  {
491  case 1:
492  return exp(-40.*pow(X(0)-0.5,2));
493  case 2:
494  case 3:
495  {
496  double rx = 0.45, ry = 0.25, cx = 0., cy = -0.2, w = 10.;
497  if (dim == 3)
498  {
499  const double s = (1. + 0.25*cos(2*M_PI*X(2)));
500  rx *= s;
501  ry *= s;
502  }
503  return ( erfc(w*(X(0)-cx-rx))*erfc(-w*(X(0)-cx+rx)) *
504  erfc(w*(X(1)-cy-ry))*erfc(-w*(X(1)-cy+ry)) )/16;
505  }
506  }
507  }
508  case 2:
509  {
510  double x_ = X(0), y_ = X(1), rho, phi;
511  rho = hypot(x_, y_);
512  phi = atan2(y_, x_);
513  return pow(sin(M_PI*rho),2)*sin(3*phi);
514  }
515  case 3:
516  {
517  const double f = M_PI;
518  return sin(f*X(0))*sin(f*X(1));
519  }
520  }
521  return 0.0;
522 }
523 
524 // Inflow boundary condition (zero for the problems considered in this example)
525 double inflow_function(const Vector &x)
526 {
527  switch (problem)
528  {
529  case 0:
530  case 1:
531  case 2:
532  case 3: return 0.0;
533  }
534  return 0.0;
535 }
Vector bb_max
Definition: ex9.cpp:53
void SetPrecision(int prec)
Set the precision (number of digits) used for the text output of doubles.
Conjugate gradient method.
Definition: solvers.hpp:111
void SetCycle(int c)
Set time cycle (for time-dependent simulations)
virtual void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
Definition: solvers.cpp:290
Base abstract class for time dependent operators.
Definition: operator.hpp:162
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
Definition: table.cpp:476
void GetBoundingBox(Vector &min, Vector &max, int ref=2)
Returns the minimum and maximum corners of the mesh bounding box.
Definition: mesh.cpp:118
void Assemble()
Assembles the linear form i.e. sums over all domain/bdr integrators.
Definition: linearform.cpp:79
virtual void Step(Vector &x, double &t, double &dt)=0
Perform a time step from time t [in] to time t [out] based on the requested step size dt [in]...
virtual void Init(TimeDependentOperator &f)
Associate a TimeDependentOperator with the ODE solver.
Definition: ode.cpp:18
virtual void SetTime(const double _t)
Set the current time.
Definition: operator.hpp:192
int Size() const
Returns the size of the vector.
Definition: vector.hpp:150
Abstract class for solving systems of ODEs: dx/dt = f(x,t)
Definition: ode.hpp:22
virtual void Save(std::ostream &out) const
Definition: pgridfunc.cpp:488
Abstract parallel finite element space.
Definition: pfespace.hpp:28
virtual void ProjectCoefficient(Coefficient &coeff)
Definition: pgridfunc.cpp:292
bool iterative_mode
If true, use the second argument of Mult() as an initial guess.
Definition: operator.hpp:283
int main(int argc, char *argv[])
Definition: ex1.cpp:58
HypreParMatrix * ParallelAssemble()
Returns the matrix assembled on the true dofs, i.e. P^t A P.
FE_Evolution(FiniteElementSpace &_vfes, Operator &_A, SparseMatrix &_Aflux)
Definition: ex18.hpp:104
Data collection with Sidre routines following the Conduit mesh blueprint specification.
Class for parallel linear form.
Definition: plinearform.hpp:26
virtual void RegisterField(const std::string &field_name, GridFunction *gf)
Add a grid function to the collection.
int dim
Definition: ex3.cpp:48
void SetPrintLevel(int print_lvl)
Definition: solvers.cpp:67
virtual void Save()
Save the collection to disk.
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
Definition: mesh.cpp:7591
Data collection with VisIt I/O routines.
void SetMaxIter(int max_it)
Definition: solvers.hpp:63
void SetCurvature(int order, bool discont=false, int space_dim=-1, int ordering=1)
Definition: mesh.cpp:3644
HYPRE_Int GlobalTrueVSize() const
Definition: pfespace.hpp:251
void Assemble(int skip_zeros=1)
Assemble the local matrix.
virtual void Print(std::ostream &out=mfem::out) const
Definition: pmesh.cpp:3863
Parallel smoothers in hypre.
Definition: hypre.hpp:567
void AddBdrFaceIntegrator(LinearFormIntegrator *lfi)
Adds new Boundary Face Integrator. Assumes ownership of lfi.
Definition: linearform.cpp:66
int Dimension() const
Definition: mesh.hpp:713
void PrintUsage(std::ostream &out) const
Definition: optparser.cpp:434
void SetTime(double t)
Set physical time (for time-dependent simulations)
Vector bb_min
Definition: ex9.cpp:53
Wrapper for hypre&#39;s parallel vector class.
Definition: hypre.hpp:73
The classical explicit forth-order Runge-Kutta method, RK4.
Definition: ode.hpp:145
void SetAbsTol(double atol)
Definition: solvers.hpp:62
void SetRelTol(double rtol)
Definition: solvers.hpp:61
void velocity_function(const Vector &x, Vector &v)
Definition: ex9.cpp:340
virtual void Mult(const Vector &x, Vector &y) const
Matrix vector multiplication.
Definition: sparsemat.cpp:545
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)
Definition: optparser.hpp:76
int problem
Definition: ex15.cpp:57
Third-order, strong stability preserving (SSP) Runge-Kutta method.
Definition: ode.hpp:132
virtual ~FE_Evolution()
Definition: ex9p.cpp:75
virtual void Mult(const Vector &x, Vector &y) const
Perform the action of the operator: y = k = f(x, t), where k solves the algebraic equation F(x...
Definition: ex18.hpp:130
NURBSExtension * NURBSext
Optional NURBS mesh extension.
Definition: mesh.hpp:181
virtual void Finalize(int skip_zeros=1)
Finalizes the matrix initialization.
void AddInteriorFaceIntegrator(BilinearFormIntegrator *bfi)
Adds new interior Face Integrator. Assumes ownership of bfi.
void AddDomainIntegrator(BilinearFormIntegrator *bfi)
Adds new Domain Integrator. Assumes ownership of bfi.
void PrintOptions(std::ostream &out) const
Definition: optparser.cpp:304
HypreParVector * GetTrueDofs() const
Returns the true dofs in a new HypreParVector.
Definition: pgridfunc.cpp:141
Class for parallel bilinear form.
int open(const char hostname[], int port)
double u0_function(const Vector &x)
Definition: ex9.cpp:397
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
Definition: solvers.hpp:125
class for C-function coefficient
Vector data type.
Definition: vector.hpp:48
virtual void SetPreconditioner(Solver &pr)
This should be called before SetOperator.
Definition: solvers.cpp:88
Class for parallel grid function.
Definition: pgridfunc.hpp:32
The classical forward Euler method.
Definition: ode.hpp:99
Wrapper for hypre&#39;s ParCSR matrix class.
Definition: hypre.hpp:187
Class for parallel meshes.
Definition: pmesh.hpp:32
void ParallelAssemble(Vector &tv)
Assemble the vector on the true dofs, i.e. P^t v.
Definition: plinearform.cpp:34
double inflow_function(const Vector &x)
Definition: ex9.cpp:450
void AddBdrFaceIntegrator(BilinearFormIntegrator *bfi)
Adds new boundary Face Integrator. Assumes ownership of bfi.
Arbitrary order &quot;L2-conforming&quot; discontinuous finite elements.
Definition: fe_coll.hpp:134
bool Good() const
Definition: optparser.hpp:122
alpha (q . grad u, v)