MFEM v4.8.0
Finite element discretization library
Loading...
Searching...
No Matches
ex9.cpp
Go to the documentation of this file.
1// MFEM Example 9
2//
3// Compile with: make ex9
4//
5// Sample runs:
6// ex9 -m ../data/periodic-segment.mesh -p 0 -r 2 -dt 0.005
7// ex9 -m ../data/periodic-square.mesh -p 0 -r 2 -dt 0.01 -tf 10
8// ex9 -m ../data/periodic-hexagon.mesh -p 0 -r 2 -dt 0.01 -tf 10
9// ex9 -m ../data/periodic-square.mesh -p 1 -r 2 -dt 0.005 -tf 9
10// ex9 -m ../data/periodic-hexagon.mesh -p 1 -r 2 -dt 0.005 -tf 9
11// ex9 -m ../data/amr-quad.mesh -p 1 -r 2 -dt 0.002 -tf 9
12// ex9 -m ../data/amr-quad.mesh -p 1 -r 2 -dt 0.02 -s 23 -tf 9
13// ex9 -m ../data/star-q3.mesh -p 1 -r 2 -dt 0.005 -tf 9
14// ex9 -m ../data/star-mixed.mesh -p 1 -r 2 -dt 0.005 -tf 9
15// ex9 -m ../data/disc-nurbs.mesh -p 1 -r 3 -dt 0.005 -tf 9
16// ex9 -m ../data/disc-nurbs.mesh -p 2 -r 3 -dt 0.005 -tf 9
17// ex9 -m ../data/periodic-square.mesh -p 3 -r 4 -dt 0.0025 -tf 9 -vs 20
18// ex9 -m ../data/periodic-cube.mesh -p 0 -r 2 -o 2 -dt 0.02 -tf 8
19// ex9 -m ../data/periodic-square.msh -p 0 -r 2 -dt 0.005 -tf 2
20// ex9 -m ../data/periodic-cube.msh -p 0 -r 1 -o 2 -tf 2
21//
22// Device sample runs:
23// ex9 -pa
24// ex9 -ea
25// ex9 -fa
26// ex9 -pa -m ../data/periodic-cube.mesh
27// ex9 -pa -m ../data/periodic-cube.mesh -d cuda
28// ex9 -ea -m ../data/periodic-cube.mesh -d cuda
29// ex9 -fa -m ../data/periodic-cube.mesh -d cuda
30// ex9 -pa -m ../data/amr-quad.mesh -p 1 -r 2 -dt 0.002 -tf 9 -d cuda
31//
32// Description: This example code solves the time-dependent advection equation
33// du/dt + v.grad(u) = 0, where v is a given fluid velocity, and
34// u0(x)=u(0,x) is a given initial condition.
35//
36// The example demonstrates the use of Discontinuous Galerkin (DG)
37// bilinear forms in MFEM (face integrators), the use of implicit
38// and explicit ODE time integrators, the definition of periodic
39// boundary conditions through periodic meshes, as well as the use
40// of GLVis for persistent visualization of a time-evolving
41// solution. The saving of time-dependent data files for external
42// visualization with VisIt (visit.llnl.gov) and ParaView
43// (paraview.org) is also illustrated.
44
45#include "mfem.hpp"
46#include <fstream>
47#include <iostream>
48#include <algorithm>
49
50using namespace std;
51using namespace mfem;
52
53// Choice for the problem setup. The fluid velocity, initial condition and
54// inflow boundary condition are chosen based on this parameter.
56
57// Velocity coefficient
58void velocity_function(const Vector &x, Vector &v);
59
60// Initial condition
61real_t u0_function(const Vector &x);
62
63// Inflow boundary condition
65
66// Mesh bounding box
68
69class DG_Solver : public Solver
70{
71private:
72 SparseMatrix &M, &K, A;
73 GMRESSolver linear_solver;
74 BlockILU prec;
75 real_t dt;
76public:
77 DG_Solver(SparseMatrix &M_, SparseMatrix &K_, const FiniteElementSpace &fes)
78 : M(M_),
79 K(K_),
80 prec(fes.GetTypicalFE()->GetDof(),
81 BlockILU::Reordering::MINIMUM_DISCARDED_FILL),
82 dt(-1.0)
83 {
84 linear_solver.iterative_mode = false;
85 linear_solver.SetRelTol(1e-9);
86 linear_solver.SetAbsTol(0.0);
87 linear_solver.SetMaxIter(100);
88 linear_solver.SetPrintLevel(0);
89 linear_solver.SetPreconditioner(prec);
90 }
91
92 void SetTimeStep(real_t dt_)
93 {
94 if (dt_ != dt)
95 {
96 dt = dt_;
97 // Form operator A = M - dt*K
98 A = K;
99 A *= -dt;
100 A += M;
101
102 // this will also call SetOperator on the preconditioner
103 linear_solver.SetOperator(A);
104 }
105 }
106
107 void SetOperator(const Operator &op) override
108 {
109 linear_solver.SetOperator(op);
110 }
111
112 void Mult(const Vector &x, Vector &y) const override
113 {
114 linear_solver.Mult(x, y);
115 }
116};
117
118/** A time-dependent operator for the right-hand side of the ODE. The DG weak
119 form of du/dt = -v.grad(u) is M du/dt = K u + b, where M and K are the mass
120 and advection matrices, and b describes the flow on the boundary. This can
121 be written as a general ODE, du/dt = M^{-1} (K u + b), and this class is
122 used to evaluate the right-hand side. */
123class FE_Evolution : public TimeDependentOperator
124{
125private:
126 BilinearForm &M, &K;
127 const Vector &b;
128 Solver *M_prec;
129 CGSolver M_solver;
130 DG_Solver *dg_solver;
131
132 mutable Vector z;
133
134public:
135 FE_Evolution(BilinearForm &M_, BilinearForm &K_, const Vector &b_);
136
137 void Mult(const Vector &x, Vector &y) const override;
138 void ImplicitSolve(const real_t dt, const Vector &x, Vector &k) override;
139
140 ~FE_Evolution() override;
141};
142
143
144int main(int argc, char *argv[])
145{
146 // 1. Parse command-line options.
147 problem = 0;
148 const char *mesh_file = "../data/periodic-hexagon.mesh";
149 int ref_levels = 2;
150 int order = 3;
151 bool pa = false;
152 bool ea = false;
153 bool fa = false;
154 const char *device_config = "cpu";
155 int ode_solver_type = 4;
156 real_t t_final = 10.0;
157 real_t dt = 0.01;
158 bool visualization = true;
159 bool visit = false;
160 bool paraview = false;
161 bool binary = false;
162 int vis_steps = 5;
163
164 int precision = 8;
165 cout.precision(precision);
166
167 OptionsParser args(argc, argv);
168 args.AddOption(&mesh_file, "-m", "--mesh",
169 "Mesh file to use.");
170 args.AddOption(&problem, "-p", "--problem",
171 "Problem setup to use. See options in velocity_function().");
172 args.AddOption(&ref_levels, "-r", "--refine",
173 "Number of times to refine the mesh uniformly.");
174 args.AddOption(&order, "-o", "--order",
175 "Order (degree) of the finite elements.");
176 args.AddOption(&pa, "-pa", "--partial-assembly", "-no-pa",
177 "--no-partial-assembly", "Enable Partial Assembly.");
178 args.AddOption(&ea, "-ea", "--element-assembly", "-no-ea",
179 "--no-element-assembly", "Enable Element Assembly.");
180 args.AddOption(&fa, "-fa", "--full-assembly", "-no-fa",
181 "--no-full-assembly", "Enable Full Assembly.");
182 args.AddOption(&device_config, "-d", "--device",
183 "Device configuration string, see Device::Configure().");
184 args.AddOption(&ode_solver_type, "-s", "--ode-solver",
185 ODESolver::Types.c_str());
186 args.AddOption(&t_final, "-tf", "--t-final",
187 "Final time; start time is 0.");
188 args.AddOption(&dt, "-dt", "--time-step",
189 "Time step.");
190 args.AddOption(&visualization, "-vis", "--visualization", "-no-vis",
191 "--no-visualization",
192 "Enable or disable GLVis visualization.");
193 args.AddOption(&visit, "-visit", "--visit-datafiles", "-no-visit",
194 "--no-visit-datafiles",
195 "Save data files for VisIt (visit.llnl.gov) visualization.");
196 args.AddOption(&paraview, "-paraview", "--paraview-datafiles", "-no-paraview",
197 "--no-paraview-datafiles",
198 "Save data files for ParaView (paraview.org) visualization.");
199 args.AddOption(&binary, "-binary", "--binary-datafiles", "-ascii",
200 "--ascii-datafiles",
201 "Use binary (Sidre) or ascii format for VisIt data files.");
202 args.AddOption(&vis_steps, "-vs", "--visualization-steps",
203 "Visualize every n-th timestep.");
204 args.Parse();
205 if (!args.Good())
206 {
207 args.PrintUsage(cout);
208 return 1;
209 }
210 args.PrintOptions(cout);
211
212 Device device(device_config);
213 device.Print();
214
215 // 2. Read the mesh from the given mesh file. We can handle geometrically
216 // periodic meshes in this code.
217 Mesh mesh(mesh_file, 1, 1);
218 int dim = mesh.Dimension();
219
220 // 3. Define the ODE solver used for time integration. Several explicit
221 // Runge-Kutta methods are available.
222 unique_ptr<ODESolver> ode_solver = ODESolver::Select(ode_solver_type);
223
224 // 4. Refine the mesh to increase the resolution. In this example we do
225 // 'ref_levels' of uniform refinement, where 'ref_levels' is a
226 // command-line parameter. If the mesh is of NURBS type, we convert it to
227 // a (piecewise-polynomial) high-order mesh.
228 for (int lev = 0; lev < ref_levels; lev++)
229 {
230 mesh.UniformRefinement();
231 }
232 if (mesh.NURBSext)
233 {
234 mesh.SetCurvature(max(order, 1));
235 }
236 mesh.GetBoundingBox(bb_min, bb_max, max(order, 1));
237
238 // 5. Define the discontinuous DG finite element space of the given
239 // polynomial order on the refined mesh.
241 FiniteElementSpace fes(&mesh, &fec);
242
243 cout << "Number of unknowns: " << fes.GetVSize() << endl;
244
245 // 6. Set up and assemble the bilinear and linear forms corresponding to the
246 // DG discretization. The DGTraceIntegrator involves integrals over mesh
247 // interior faces.
251
252 BilinearForm m(&fes);
253 BilinearForm k(&fes);
254 if (pa)
255 {
256 m.SetAssemblyLevel(AssemblyLevel::PARTIAL);
257 k.SetAssemblyLevel(AssemblyLevel::PARTIAL);
258 }
259 else if (ea)
260 {
261 m.SetAssemblyLevel(AssemblyLevel::ELEMENT);
262 k.SetAssemblyLevel(AssemblyLevel::ELEMENT);
263 }
264 else if (fa)
265 {
266 m.SetAssemblyLevel(AssemblyLevel::FULL);
267 k.SetAssemblyLevel(AssemblyLevel::FULL);
268 }
270 constexpr real_t alpha = -1.0;
276
277 LinearForm b(&fes);
278 b.AddBdrFaceIntegrator(
279 new BoundaryFlowIntegrator(inflow, velocity, alpha));
280
281 m.Assemble();
282 int skip_zeros = 0;
283 k.Assemble(skip_zeros);
284 b.Assemble();
285 m.Finalize();
286 k.Finalize(skip_zeros);
287
288 // 7. Define the initial conditions, save the corresponding grid function to
289 // a file and (optionally) save data in the VisIt format and initialize
290 // GLVis visualization.
291 GridFunction u(&fes);
292 u.ProjectCoefficient(u0);
293
294 {
295 ofstream omesh("ex9.mesh");
296 omesh.precision(precision);
297 mesh.Print(omesh);
298 ofstream osol("ex9-init.gf");
299 osol.precision(precision);
300 u.Save(osol);
301 }
302
303 // Create data collection for solution output: either VisItDataCollection for
304 // ascii data files, or SidreDataCollection for binary data files.
305 DataCollection *dc = NULL;
306 if (visit)
307 {
308 if (binary)
309 {
310#ifdef MFEM_USE_SIDRE
311 dc = new SidreDataCollection("Example9", &mesh);
312#else
313 MFEM_ABORT("Must build with MFEM_USE_SIDRE=YES for binary output.");
314#endif
315 }
316 else
317 {
318 dc = new VisItDataCollection("Example9", &mesh);
319 dc->SetPrecision(precision);
320 }
321 dc->RegisterField("solution", &u);
322 dc->SetCycle(0);
323 dc->SetTime(0.0);
324 dc->Save();
325 }
326
327 ParaViewDataCollection *pd = NULL;
328 if (paraview)
329 {
330 pd = new ParaViewDataCollection("Example9", &mesh);
331 pd->SetPrefixPath("ParaView");
332 pd->RegisterField("solution", &u);
333 pd->SetLevelsOfDetail(order);
334 pd->SetDataFormat(VTKFormat::BINARY);
335 pd->SetHighOrderOutput(true);
336 pd->SetCycle(0);
337 pd->SetTime(0.0);
338 pd->Save();
339 }
340
341 socketstream sout;
342 if (visualization)
343 {
344 char vishost[] = "localhost";
345 int visport = 19916;
346 sout.open(vishost, visport);
347 if (!sout)
348 {
349 cout << "Unable to connect to GLVis server at "
350 << vishost << ':' << visport << endl;
351 visualization = false;
352 cout << "GLVis visualization disabled.\n";
353 }
354 else
355 {
356 sout.precision(precision);
357 sout << "solution\n" << mesh << u;
358 sout << "pause\n";
359 sout << flush;
360 cout << "GLVis visualization paused."
361 << " Press space (in the GLVis window) to resume it.\n";
362 }
363 }
364
365 // 8. Define the time-dependent evolution operator describing the ODE
366 // right-hand side, and perform time-integration (looping over the time
367 // iterations, ti, with a time-step dt).
368 FE_Evolution adv(m, k, b);
369
370 real_t t = 0.0;
371 adv.SetTime(t);
372 ode_solver->Init(adv);
373
374 bool done = false;
375 for (int ti = 0; !done; )
376 {
377 real_t dt_real = min(dt, t_final - t);
378 ode_solver->Step(u, t, dt_real);
379 ti++;
380
381 done = (t >= t_final - 1e-8*dt);
382
383 if (done || ti % vis_steps == 0)
384 {
385 cout << "time step: " << ti << ", time: " << t << endl;
386
387 if (visualization)
388 {
389 sout << "solution\n" << mesh << u << flush;
390 }
391
392 if (visit)
393 {
394 dc->SetCycle(ti);
395 dc->SetTime(t);
396 dc->Save();
397 }
398
399 if (paraview)
400 {
401 pd->SetCycle(ti);
402 pd->SetTime(t);
403 pd->Save();
404 }
405 }
406 }
407
408 // 9. Save the final solution. This output can be viewed later using GLVis:
409 // "glvis -m ex9.mesh -g ex9-final.gf".
410 {
411 ofstream osol("ex9-final.gf");
412 osol.precision(precision);
413 u.Save(osol);
414 }
415
416 // 10. Free the used memory.
417 delete pd;
418 delete dc;
419
420 return 0;
421}
422
423
424// Implementation of class FE_Evolution
425FE_Evolution::FE_Evolution(BilinearForm &M_, BilinearForm &K_, const Vector &b_)
426 : TimeDependentOperator(M_.FESpace()->GetTrueVSize()),
427 M(M_), K(K_), b(b_), z(height)
428{
429 Array<int> ess_tdof_list;
430 if (M.GetAssemblyLevel() == AssemblyLevel::LEGACY)
431 {
432 M_prec = new DSmoother(M.SpMat());
433 M_solver.SetOperator(M.SpMat());
434 dg_solver = new DG_Solver(M.SpMat(), K.SpMat(), *M.FESpace());
435 }
436 else
437 {
438 M_prec = new OperatorJacobiSmoother(M, ess_tdof_list);
439 M_solver.SetOperator(M);
440 dg_solver = NULL;
441 }
442 M_solver.SetPreconditioner(*M_prec);
443 M_solver.iterative_mode = false;
444 M_solver.SetRelTol(1e-9);
445 M_solver.SetAbsTol(0.0);
446 M_solver.SetMaxIter(100);
447 M_solver.SetPrintLevel(0);
448}
449
450void FE_Evolution::Mult(const Vector &x, Vector &y) const
451{
452 // y = M^{-1} (K x + b)
453 K.Mult(x, z);
454 z += b;
455 M_solver.Mult(z, y);
456}
457
458void FE_Evolution::ImplicitSolve(const real_t dt, const Vector &x, Vector &k)
459{
460 MFEM_VERIFY(dg_solver != NULL,
461 "Implicit time integration is not supported with partial assembly");
462 K.Mult(x, z);
463 z += b;
464 dg_solver->SetTimeStep(dt);
465 dg_solver->Mult(z, k);
466}
467
468FE_Evolution::~FE_Evolution()
469{
470 delete M_prec;
471 delete dg_solver;
472}
473
474// Velocity coefficient
476{
477 int dim = x.Size();
478
479 // map to the reference [-1,1] domain
480 Vector X(dim);
481 for (int i = 0; i < dim; i++)
482 {
483 real_t center = (bb_min[i] + bb_max[i]) * 0.5;
484 X(i) = 2 * (x(i) - center) / (bb_max[i] - bb_min[i]);
485 }
486
487 switch (problem)
488 {
489 case 0:
490 {
491 // Translations in 1D, 2D, and 3D
492 switch (dim)
493 {
494 case 1: v(0) = 1.0; break;
495 case 2: v(0) = sqrt(2./3.); v(1) = sqrt(1./3.); break;
496 case 3: v(0) = sqrt(3./6.); v(1) = sqrt(2./6.); v(2) = sqrt(1./6.);
497 break;
498 }
499 break;
500 }
501 case 1:
502 case 2:
503 {
504 // Clockwise rotation in 2D around the origin
505 const real_t w = M_PI/2;
506 switch (dim)
507 {
508 case 1: v(0) = 1.0; break;
509 case 2: v(0) = w*X(1); v(1) = -w*X(0); break;
510 case 3: v(0) = w*X(1); v(1) = -w*X(0); v(2) = 0.0; break;
511 }
512 break;
513 }
514 case 3:
515 {
516 // Clockwise twisting rotation in 2D around the origin
517 const real_t w = M_PI/2;
518 real_t d = max((X(0)+1.)*(1.-X(0)),0.) * max((X(1)+1.)*(1.-X(1)),0.);
519 d = d*d;
520 switch (dim)
521 {
522 case 1: v(0) = 1.0; break;
523 case 2: v(0) = d*w*X(1); v(1) = -d*w*X(0); break;
524 case 3: v(0) = d*w*X(1); v(1) = -d*w*X(0); v(2) = 0.0; break;
525 }
526 break;
527 }
528 }
529}
530
531// Initial condition
533{
534 int dim = x.Size();
535
536 // map to the reference [-1,1] domain
537 Vector X(dim);
538 for (int i = 0; i < dim; i++)
539 {
540 real_t center = (bb_min[i] + bb_max[i]) * 0.5;
541 X(i) = 2 * (x(i) - center) / (bb_max[i] - bb_min[i]);
542 }
543
544 switch (problem)
545 {
546 case 0:
547 case 1:
548 {
549 switch (dim)
550 {
551 case 1:
552 return exp(-40.*pow(X(0)-0.5,2));
553 case 2:
554 case 3:
555 {
556 real_t rx = 0.45, ry = 0.25, cx = 0., cy = -0.2, w = 10.;
557 if (dim == 3)
558 {
559 const real_t s = (1. + 0.25*cos(2*M_PI*X(2)));
560 rx *= s;
561 ry *= s;
562 }
563 return ( std::erfc(w*(X(0)-cx-rx))*std::erfc(-w*(X(0)-cx+rx)) *
564 std::erfc(w*(X(1)-cy-ry))*std::erfc(-w*(X(1)-cy+ry)) )/16;
565 }
566 }
567 }
568 case 2:
569 {
570 real_t x_ = X(0), y_ = X(1), rho, phi;
571 rho = std::hypot(x_, y_);
572 phi = atan2(y_, x_);
573 return pow(sin(M_PI*rho),2)*sin(3*phi);
574 }
575 case 3:
576 {
577 const real_t f = M_PI;
578 return sin(f*X(0))*sin(f*X(1));
579 }
580 }
581 return 0.0;
582}
583
584// Inflow boundary condition (zero for the problems considered in this example)
586{
587 switch (problem)
588 {
589 case 0:
590 case 1:
591 case 2:
592 case 3: return 0.0;
593 }
594 return 0.0;
595}
@ GaussLobatto
Closed type.
Definition fe_base.hpp:36
A "square matrix" operator for the associated FE space and BLFIntegrators The sum of all the BLFInteg...
void SetAssemblyLevel(AssemblyLevel assembly_level)
Set the desired assembly level.
void AddDomainIntegrator(BilinearFormIntegrator *bfi)
Adds new Domain Integrator. Assumes ownership of bfi.
void Finalize(int skip_zeros=1) override
Finalizes the matrix initialization if the AssemblyLevel is AssemblyLevel::LEGACY....
void Assemble(int skip_zeros=1)
Assembles the form i.e. sums over all domain/bdr integrators.
void AddBdrFaceIntegrator(BilinearFormIntegrator *bfi)
Adds new boundary Face Integrator. Assumes ownership of bfi.
void Mult(const Vector &x, Vector &y) const override
Matrix vector multiplication: .
void AddInteriorFaceIntegrator(BilinearFormIntegrator *bfi)
Adds new interior Face Integrator. Assumes ownership of bfi.
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
Data type for scaled Jacobi-type smoother of sparse matrix.
void SetPrecision(int prec)
Set the precision (number of digits) used for the text output of doubles.
virtual void RegisterField(const std::string &field_name, GridFunction *gf)
Add a grid function to the collection.
void SetCycle(int c)
Set time cycle (for time-dependent simulations)
void SetTime(real_t t)
Set physical time (for time-dependent simulations)
void SetPrefixPath(const std::string &prefix)
Set the path where the DataCollection will be saved.
virtual void Save()
Save the collection to disk.
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 FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition fespace.hpp:244
int GetVSize() const
Return the number of vector dofs, i.e. GetNDofs() x GetVDim().
Definition fespace.hpp:848
const FiniteElement * GetTypicalFE() const
Return GetFE(0) if the local mesh is not empty; otherwise return a typical FE based on the Geometry t...
Definition fespace.cpp:3871
int GetDof() const
Returns the number of degrees of freedom in the finite element.
Definition fe_base.hpp:334
A general function coefficient.
GMRES method.
Definition solvers.hpp:572
void Mult(const Vector &b, Vector &x) const override
Iterative solution of the linear system using the GMRES method.
Definition solvers.cpp:1016
Class for grid function - Vector with associated FE space.
Definition gridfunc.hpp:31
void SetOperator(const Operator &op) override
Also calls SetOperator for the preconditioner if there is one.
Definition solvers.cpp:180
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
void SetAbsTol(real_t atol)
Definition solvers.hpp:230
Arbitrary order "L2-conforming" discontinuous finite elements.
Definition fe_coll.hpp:346
Vector with associated FE space and LinearFormIntegrators.
Mesh data type.
Definition mesh.hpp:64
NURBSExtension * NURBSext
Optional NURBS mesh extension.
Definition mesh.hpp:298
virtual void Print(std::ostream &os=mfem::out, const std::string &comments="") const
Definition mesh.hpp:2433
void GetBoundingBox(Vector &min, Vector &max, int ref=2)
Returns the minimum and maximum corners of the mesh bounding box.
Definition mesh.cpp:138
int Dimension() const
Dimension of the reference space used within the elements.
Definition mesh.hpp:1216
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 MFEM_EXPORT std::string Types
Definition ode.hpp:187
static MFEM_EXPORT std::unique_ptr< ODESolver > Select(const int ode_solver_type)
Definition ode.cpp:34
Jacobi smoothing for a given bilinear form (no matrix necessary).
Definition solvers.hpp:333
Abstract operator.
Definition operator.hpp:25
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.
Helper class for ParaView visualization data.
void SetHighOrderOutput(bool high_order_output_)
void SetLevelsOfDetail(int levels_of_detail_)
void SetDataFormat(VTKFormat fmt)
Data collection with Sidre routines following the Conduit mesh blueprint specification.
Base class for solvers.
Definition operator.hpp:780
bool iterative_mode
If true, use the second argument of Mult() as an initial guess.
Definition operator.hpp:783
Data type sparse matrix.
Definition sparsemat.hpp:51
Base abstract class for first order time dependent operators.
Definition operator.hpp:332
virtual void SetTime(const real_t t_)
Set the current time.
Definition operator.hpp:394
A general vector function coefficient.
Vector data type.
Definition vector.hpp:82
int Size() const
Returns the size of the vector.
Definition vector.hpp:226
Data collection with VisIt I/O routines.
int open(const char hostname[], int port)
Open the socket stream on 'port' at 'hostname'.
const real_t alpha
Definition ex15.cpp:369
int dim
Definition ex24.cpp:53
void velocity_function(const Vector &x, Vector &v)
Definition ex9.cpp:475
real_t u0_function(const Vector &x)
Definition ex9.cpp:532
int problem
Definition ex9.cpp:55
real_t inflow_function(const Vector &x)
Definition ex9.cpp:585
Vector bb_min
Definition ex9.cpp:67
Vector bb_max
Definition ex9.cpp:67
int main()
real_t b
Definition lissajous.cpp:42
real_t u(const Vector &xvec)
Definition lor_mms.hpp:22
float real_t
Definition config.hpp:43
std::function< real_t(const Vector &)> f(real_t mass_coeff)
Definition lor_mms.hpp:30
const char vishost[]