MFEM  v4.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
estimators.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #include "estimators.hpp"
13 
14 namespace mfem
15 {
16 
18 {
19  flux_space->Update(false);
20  // In parallel, 'flux' can be a GridFunction, as long as 'flux_space' is a
21  // ParFiniteElementSpace and 'solution' is a ParGridFunction.
23 
24  if (!anisotropic) { aniso_flags.SetSize(0); }
26  anisotropic ? &aniso_flags : NULL,
28 
30 }
31 
32 
33 #ifdef MFEM_USE_MPI
34 
36 {
37  flux_space->Update(false);
38  smooth_flux_space->Update(false);
39 
40  // TODO: move these parameters in the class, and add Set* methods.
41  const double solver_tol = 1e-12;
42  const int solver_max_it = 200;
45  local_norm_p, solver_tol, solver_max_it);
46 
48 }
49 
50 #endif // MFEM_USE_MPI
51 
52 } // namespace mfem
Class for grid function - Vector with associated FE space.
Definition: gridfunc.hpp:27
virtual void Update(bool want_transform=true)
Definition: fespace.cpp:1942
void ComputeEstimates()
Compute the element error estimates.
Definition: estimators.cpp:35
double ZZErrorEstimator(BilinearFormIntegrator &blfi, GridFunction &u, GridFunction &flux, Vector &error_estimates, Array< int > *aniso_flags, int with_subdomains)
Definition: gridfunc.cpp:2898
ParFiniteElementSpace * flux_space
Ownership based on the flag own_flux_fes. Its Update() method is called automatically by this class w...
Definition: estimators.hpp:205
virtual void Update(bool want_transform=true)
Definition: pfespace.cpp:2754
void ComputeEstimates()
Compute the element error estimates.
Definition: estimators.cpp:17
ParGridFunction * solution
Not owned.
Definition: estimators.hpp:203
long GetSequence() const
Definition: mesh.hpp:1149
Mesh * GetMesh() const
Returns the mesh.
Definition: fespace.hpp:272
GridFunction * solution
Not owned.
Definition: estimators.hpp:83
int local_norm_p
Local L_p norm to use, default is 1.
Definition: estimators.hpp:198
FiniteElementSpace * FESpace()
Definition: gridfunc.hpp:430
void SetSize(int nsize)
Change logical size of the array, keep existing entries.
Definition: array.hpp:618
double L2ZZErrorEstimator(BilinearFormIntegrator &flux_integrator, const ParGridFunction &x, ParFiniteElementSpace &smooth_flux_fes, ParFiniteElementSpace &flux_fes, Vector &errors, int norm_p, double solver_tol, int solver_max_it)
Definition: pgridfunc.cpp:709
ParFiniteElementSpace * smooth_flux_space
Ownership based on the flag own_flux_fes. Its Update() method is called automatically by this class w...
Definition: estimators.hpp:208
FiniteElementSpace * flux_space
Ownership based on own_flux_fes. Its Update() method is called automatically by this class when neede...
Definition: estimators.hpp:85
BilinearFormIntegrator * integ
Not owned.
Definition: estimators.hpp:202
BilinearFormIntegrator * integ
Not owned.
Definition: estimators.hpp:82