libMesh Namespace Reference

Namespaces

 boostcopy
 
 DenseMatrices
 
 FiniteElements
 
 libMeshPrivateData
 
 MacroFunctions
 
 MeshTools
 
 Nemesis
 
 Parallel
 
 Predicates
 
 Quality
 Utility functions for computing element quality indicators.
 
 RBDataDeserialization
 
 RBDataSerialization
 
 ReferenceElem
 Namespace providing access to reference geometric element types.
 
 SparsityPattern
 Defines the sparsity pattern of a sparse matrix.
 
 TensorTools
 
 Threads
 
 Trees
 
 TriangleWrapper
 Namespace that wraps the Triangle mesh generator's API.
 
 Utility
 

Classes

class  AbaqusIO
 
class  AdaptiveTimeSolver
 
class  AdjointDofConstraintValues
 
class  AdjointRefinementEstimator
 
class  AdjointResidualErrorEstimator
 
class  AnalyticFunction
 
class  AztecLinearSolver
 
class  BasicOStreamProxy
 
class  BoundaryInfo
 Used by the Mesh to keep track of boundary nodes and elements. More...
 
class  BoundaryMesh
 Specialized mesh used for keeping track of boundary elements. More...
 
class  BoundaryProjectSolution
 
class  BoundaryVolumeSolutionTransfer
 
class  BoundingBox
 
class  BuildProjectionList
 
class  Cell
 The base class for all 3D geometric element types. More...
 
class  CentroidPartitioner
 
class  CheckpointIO
 
struct  CompareElemIdsByLevel
 
struct  CompareTypes
 
struct  CompareTypes< MetaPhysicL::DynamicSparseNumberArray< T, I >, T2 >
 
struct  CompareTypes< std::complex< T >, T >
 
struct  CompareTypes< T, std::complex< T > >
 
struct  CompareTypes< T, T >
 
class  CompositeFEMFunction
 FEMFunction which is a function of another function. More...
 
class  CompositeFunction
 Function which is a function of another function. More...
 
class  CondensedEigenSystem
 Extends EigenSystem to allow certain DOFs to be condensed out. More...
 
class  ConstCouplingAccessor
 
class  ConstCouplingRow
 
class  ConstCouplingRowConstIterator
 
class  ConstFEMFunction
 FEMFunction that returns a single value. More...
 
class  ConstFunction
 Function that returns a single value that never changes. More...
 
class  ConstParameterProxy
 
class  ConstTypeTensorColumn
 
class  ContinuationSystem
 
class  ConvergenceFailure
 
class  CouplingAccessor
 
class  CouplingMatrix
 Defines the coupling between variables of a System. More...
 
class  DefaultCoupling
 
class  DenseMatrix
 A matrix object used for finite element assembly and numerics. More...
 
class  DenseMatrixBase
 
class  DenseSubMatrix
 
class  DenseSubVector
 
class  DenseVector
 
class  DenseVectorBase
 
class  DGFEMContext
 Extends FEMContext to work for DG problems. More...
 
class  DiffContext
 
class  DifferentiablePhysics
 
class  DifferentiableQoI
 
class  DifferentiableSystem
 
class  DiffSolver
 
class  DirectSolutionTransfer
 Implements solution transfers for matched variable/mesh case. More...
 
class  DirichletBoundaries
 
class  DirichletBoundary
 Class for specifying Dirichlet boundary conditions as constraints. More...
 
class  DiscontinuityMeasure
 
class  DistributedMesh
 Mesh data structure which is distributed across all processors. More...
 
class  DistributedVector
 
class  DofConstraints
 
class  DofConstraintValueMap
 
class  DofMap
 Manages the degrees of freedom (DOFs) in a simulation. More...
 
class  DofObject
 
class  DSNAOutput
 
class  DSNAOutput< VectorValue< InnerOutput > >
 
class  DTKAdapter
 
class  DTKEvaluator
 
class  DTKSolutionTransfer
 
class  DynamicCastFailure
 
class  Edge
 The base class for all 1D geometric element types. More...
 
class  Edge2
 A 1D geometric element with 2 nodes. More...
 
class  Edge3
 A 1D geometric element with 3 nodes. More...
 
class  Edge4
 A 1D geometric element with 4 nodes. More...
 
class  EigenPreconditioner
 
class  EigenSolver
 Base class which defines the interface for solving eigenproblems. More...
 
class  EigenSparseLinearSolver
 
class  EigenSparseMatrix
 
class  EigenSparseVector
 
class  EigenSystem
 Base class for defining systems of equations for eigenproblems. More...
 
class  EigenTimeSolver
 
class  Elem
 The base class for all geometric element types. More...
 
class  ElemAssembly
 
class  ElemCutter
 Subdivides a single element using a mesh generator. More...
 
struct  ElemHashUtils
 A struct providing convenience functions for hashing elements. More...
 
class  EnsightIO
 
class  EpetraMatrix
 
class  EpetraVector
 
class  EquationSystems
 Manages multiples systems of equations. More...
 
class  ErrorEstimator
 
class  ErrorVector
 
class  Euler2Solver
 
class  EulerSolver
 
class  ExactErrorEstimator
 
class  ExactSolution
 
class  ExodusII_IO
 Handles reading and writing of Exodus binary files. More...
 
class  ExodusII_IO_Helper
 
class  ExplicitSystem
 Used for solving explicit systems of equations. More...
 
class  Face
 The base class for all 2D geometric element types. More...
 
class  Factory
 Handles name-based creation of objects. More...
 
class  FactoryImp
 
class  FastPoolAllocator
 Boost-derived allocator that can be used with std::containers. More...
 
class  FE
 Template class which generates the different FE families and orders. More...
 
class  FEAbstract
 
class  FEClough
 
class  FEComputeData
 Helper class used with FEInterface::compute_data(). More...
 
class  FEGenericBase
 
class  FEHermite
 
class  FEHierarchic
 
class  FEInterface
 Interface class which provides access to FE functions. More...
 
class  FEL2Hierarchic
 
class  FEL2Lagrange
 
class  FELagrange
 
class  FELagrangeVec
 
class  FEMap
 Computes finite element mapping function values, gradients, etc. More...
 
class  FEMContext
 
class  FEMFunctionBase
 
class  FEMFunctionWrapper
 
class  FEMonomial
 
class  FEMPhysics
 
class  FEMSystem
 
class  FENedelecOne
 
struct  FEOutputType
 
struct  FEOutputType< LAGRANGE_VEC >
 
struct  FEOutputType< NEDELEC_ONE >
 
class  FEScalar
 
class  FESubdivision
 
class  FETransformationBase
 
class  FEType
 Manages the family, order, etc. parameters for a given FE. More...
 
class  FEXYZ
 
class  FEXYZMap
 An implementation of FEMap for "XYZ" elements. More...
 
class  FileError
 
class  FirstOrderUnsteadySolver
 
class  FloatingPointException
 
class  FrequencySystem
 
class  FroIO
 
class  FunctionBase
 
class  GenericProjector
 
class  GhostingFunctor
 
class  GhostPointNeighbors
 
class  GmshIO
 
class  GMVIO
 
class  GnuPlotIO
 
class  H1FETransformation
 
class  HCurlFETransformation
 
class  Hex
 The base class for all hexahedral element types. More...
 
class  Hex20
 A 3D hexahedral element with 20 nodes. More...
 
class  Hex27
 A 3D hexahedral element with 27 nodes. More...
 
class  Hex8
 A 3D hexahedral element with 8 nodes. More...
 
class  HilbertSFCPartitioner
 Partitioner based on Hilbert's space filling curve algorithm. More...
 
class  HPCoarsenTest
 
class  HPSelector
 
class  HPSingularity
 
class  ImplicitSystem
 Used for solving implicit systems of equations. More...
 
class  InfCell
 The base class for all 3D infinite geometric element types. More...
 
class  InfEdge2
 A 1D infinite element with 2 nodes. More...
 
class  InfElemBuilder
 
class  InfFE
 Base class for all the infinite geometric element types. More...
 
class  InfHex
 The base class for all 3D infinite hexahedral element types. More...
 
class  InfHex16
 A 3D infinite hexahedral element with 16 nodes. More...
 
class  InfHex18
 A 3D infinite hexahedral element with 18 nodes. More...
 
class  InfHex8
 A 3D infinite hexahedral element with 8 nodes. More...
 
class  InfPrism
 The base class for all 3D infinite prismatic element types. More...
 
class  InfPrism12
 A 3D infinite prismatic element with 12 nodes. More...
 
class  InfPrism6
 A 3D infinite prismatic element with 6 nodes. More...
 
class  InfQuad
 The base class for all 2D infinite quadrilateral element types. More...
 
class  InfQuad4
 A 2D infinite quadrilateral element with 4 nodes. More...
 
class  InfQuad6
 A 2D infinite quadrilateral element with 6 nodes. More...
 
class  IntRange
 
class  InverseDistanceInterpolation
 
class  JumpErrorEstimator
 
class  KellyErrorEstimator
 
class  LaplaceMeshSmoother
 
class  LaplacianErrorEstimator
 
class  LaspackLinearSolver
 
class  LaspackMatrix
 
class  LaspackVector
 
class  LibMeshInit
 
class  LinearImplicitSystem
 
class  LinearPartitioner
 Partitions the elements based solely on their ids. More...
 
class  LinearSolutionMonitor
 
class  LinearSolver
 
class  LocationMap
 std::map-like data structure using hashed Points for keys. More...
 
class  LogicError
 
class  MappedSubdomainPartitioner
 Partitions elements based on user-defined mapping from subdomain ids -> processor ids. More...
 
class  mapvector
 
class  MatlabIO
 
class  MatrixFillAction
 
class  MEDITIO
 
class  MemorySolutionHistory
 Stores past solutions in memory. More...
 
class  Mesh
 Manages a collection of Nodes and Elems. More...
 
struct  mesh_inserter_iterator
 An output iterator for use with packed_range functions. More...
 
class  MeshBase
 Base class for Mesh. More...
 
class  MeshCommunication
 
class  MeshfreeInterpolation
 Base class which defines the mesh-free interpolation interface. More...
 
class  MeshfreeSolutionTransfer
 A SolutionTransfer object that does "mesh free" interpolation. More...
 
class  MeshFunction
 
class  MeshFunctionSolutionTransfer
 SolutionTransfer object which uses a MeshFunction. More...
 
class  MeshInput
 
class  MeshOutput
 
class  MeshRefinement
 Responsible for mesh refinement algorithms and data. More...
 
class  MeshSerializer
 Temporarily serializes a DistributedMesh for output. More...
 
class  MeshSmoother
 
class  METIS_CSR_Graph
 Compressed graph data structure used by MetisPartitioner. More...
 
class  MetisPartitioner
 Partitioner which interfaces with the METIS library. More...
 
class  MortonSFCPartitioner
 Partitioner based on Morton's space filling curve algorithm. More...
 
struct  myhash
 
class  NameBasedIO
 
class  Nemesis_IO
 
class  Nemesis_IO_Helper
 
class  NewmarkSolver
 
class  NewmarkSystem
 Implements the Newmark time integration scheme. More...
 
class  NewtonSolver
 
class  NloptOptimizationSolver
 
class  Node
 A geometric point in (x,y,z) space associated with a DOF. More...
 
class  NodeConstraints
 
class  NodeElem
 A zero-dimensional geometric entity implementing the Elem interface. More...
 
class  NonlinearImplicitSystem
 Used for solving nonlinear implicit systems of equations. More...
 
class  NonlinearSolver
 
class  NoSolutionHistory
 For storing and retrieving timestep data. More...
 
class  NotImplemented
 
class  NoxNonlinearSolver
 
struct  null_output_iterator
 A do-nothing output iterator implementation. More...
 
class  NumericVector
 
class  OFFIO
 Reads OOF OOGL triangulated surface files. More...
 
class  OldSolutionBase
 
class  OldSolutionCoefs
 
class  OldSolutionValue
 
class  OptimizationSolver
 
class  OptimizationSystem
 
class  OrderWrapper
 
class  ParallelMesh
 
class  ParallelObject
 
class  ParameterAccessor
 Base class for reading/writing sensitivity parameters. More...
 
class  ParameterMultiAccessor
 Stores a user-provided pointer to a parameter. More...
 
class  ParameterMultiPointer
 Stores multiple user-provided pointers. More...
 
class  ParameterPointer
 Stores/modifies a user-provided pointer to a parameter. More...
 
class  ParameterProxy
 
class  Parameters
 
class  ParameterVector
 Specifies parameters for parameter sensitivity calculations. More...
 
class  ParmetisHelper
 Pointer-to-implementation class used by ParmetisPartitioner. More...
 
class  ParmetisPartitioner
 Partitioner which provides an interface to ParMETIS. More...
 
class  ParsedFEMFunction
 Support for using parsed functions in FEMSystem. More...
 
class  ParsedFEMFunctionParameter
 Stores a pointer to a ParsedFEMFunction and a string for the parameter. More...
 
class  ParsedFunction
 A Function defined by a std::string. More...
 
class  ParsedFunctionParameter
 Stores a pointer to a parsed function and a string for the parameter. More...
 
class  Partitioner
 Base class for all concrete Partitioner instantiations. More...
 
class  Patch
 
class  PatchRecoveryErrorEstimator
 
class  PerfData
 Data object managed by PerfLog. More...
 
struct  PerfItem
 
class  PerfLog
 Responsible for timing and summarizing events. More...
 
class  PerfMon
 A class for interfacing with hardware timers. More...
 
class  PeriodicBoundaries
 Maps between boundary ids and PeriodicBoundaryBase objects. More...
 
class  PeriodicBoundary
 Used for implementing periodic BCs via constraints. More...
 
class  PeriodicBoundaryBase
 Base class for all PeriodicBoundary implementations. More...
 
class  PetscDiffSolver
 
class  PetscLinearSolver
 
class  PetscMatrix
 SparseMatrix interface to PETSc Mat. More...
 
class  PetscNonlinearSolver
 
class  PetscPreconditioner
 
class  PetscSolverException
 
class  PetscVector
 NumericVector interface to PETSc Vec. More...
 
class  Plane
 A geometric object representing a planar surface. More...
 
class  PltLoader
 
class  Point
 A geometric point in (x,y,z) space. More...
 
class  PointerToPointerIter
 
class  PointLocatorBase
 
class  PointLocatorTree
 
class  PointNeighborCoupling
 
class  PoolAllocator
 Boost-derived allocator that can be used with std::containers. More...
 
class  PostscriptIO
 
class  Preconditioner
 
class  Prism
 The base class for all prismatic element types. More...
 
class  Prism15
 A 3D prismatic element with 15 nodes. More...
 
class  Prism18
 A 3D prismatic element with 18 nodes. More...
 
class  Prism6
 A 3D prismatic element with 6 nodes. More...
 
class  Problem_Interface
 
class  Pyramid
 The base class for all pyramid element types. More...
 
class  Pyramid13
 A 3D pyramid element with 13 nodes. More...
 
class  Pyramid14
 A 3D pyramid element with 14 nodes. More...
 
class  Pyramid5
 A 3D pyramid element with 5 nodes. More...
 
class  QBase
 Base class for all quadrature families and orders. More...
 
class  QClough
 Implements quadrature rules for Clough-Tocher macroelements. More...
 
class  QComposite
 A quadrature rule for subdivided elements. More...
 
class  QConical
 Conical product quadrature rules for Tri and Tet elements. More...
 
class  QGauss
 Implements 1, 2, and 3D "Gaussian" quadrature rules. More...
 
class  QGaussLobatto
 Implements 1D and 2/3D tensor product Gauss-Lobatto quadrature rules. More...
 
class  QGrid
 Implements grid-based quadrature rules suitable for non-smooth functions. More...
 
class  QGrundmann_Moller
 Implements the quadrature rules of Grundmann and Moller in 2D and 3D. More...
 
class  QJacobi
 Implements 1D Gauss-Jacobi quadrature rules of various orders. More...
 
class  QMonomial
 Implements quadrature rules for non-tensor polynomials. More...
 
class  QoISet
 Used to specify quantities of interest in a simulation. More...
 
class  QSimpson
 Implements Simpson's rule, i.e. nodal quadrature for quadratic elements. More...
 
class  QTrap
 Implements trapezoidal rule, i.e. nodal quadrature for linear elements. More...
 
class  Quad
 The base class for all quadrilateral element types. More...
 
class  Quad4
 A 2D quadrilateral element with 4 nodes. More...
 
class  Quad8
 A 2D quadrilateral element with 8 nodes. More...
 
class  Quad9
 A 2D quadrilateral element with 9 nodes. More...
 
class  QuadShell4
 A 2D quadrilateral shell element with 4 nodes. More...
 
class  QuadShell8
 A 2D quadrilateral shell element with 8 nodes. More...
 
class  RadialBasisInterpolation
 Does radial basis function interpolation using Nanoflann. More...
 
class  RawAccessor
 
class  RawAccessor< TypeNTensor< N, ScalarType > >
 
struct  RawFieldType
 
struct  RawFieldType< Gradient >
 
struct  RawFieldType< Number >
 
struct  RawFieldType< Real >
 
struct  RawFieldType< RealGradient >
 
struct  RawFieldType< RealTensor >
 
struct  RawFieldType< Tensor >
 
struct  RawFieldType< TypeNTensor< 3, Number > >
 
struct  RawFieldType< TypeNTensor< 3, Real > >
 
class  RBAssemblyExpansion
 
class  RBConstruction
 
class  RBConstructionBase
 
class  RBEIMAssembly
 
class  RBEIMConstruction
 
class  RBEIMEvaluation
 
class  RBEIMTheta
 
class  RBEvaluation
 
class  RBParameters
 
class  RBParametrized
 
class  RBParametrizedFunction
 Provides a reduced basis parameterized function. More...
 
class  RBSCMConstruction
 
class  RBSCMEvaluation
 
class  RBTemporalDiscretization
 Encapsulates the details of the generalized Euler discretization. More...
 
class  RBTheta
 
class  RBThetaExpansion
 
class  ReferenceCountedObject
 
class  ReferenceCounter
 Common base for all objects whose creations/destructions are counted. More...
 
class  RefinementSelector
 
class  RemoteElem
 Used by ParallelMesh to represent an Elem owned by another processor. More...
 
class  ReplicatedMesh
 Mesh data structure replicated on all processors. More...
 
class  ResidualContext
 
struct  ScalarTraits
 
struct  ScalarTraits< MetaPhysicL::DynamicSparseNumberArray< T, I > >
 
struct  ScalarTraits< std::complex< T > >
 
class  SecondOrderUnsteadySolver
 
class  SensitivityData
 Holds completed parameter sensitivity calculations. More...
 
class  SerialMesh
 
class  SFCPartitioner
 Partitioner based on different types of space filling curves. More...
 
class  ShellMatrix
 
class  SiblingCoupling
 
class  Side
 Proxy class for efficiently representing an Elem's side. More...
 
class  SideEdge
 
class  SimpleRange
 
class  Singleton
 Base class for all library singleton objects. More...
 
class  SlepcEigenSolver
 EigenSolver implementation based on SLEPc. More...
 
class  SolutionHistory
 For storing and retrieving timestep data. More...
 
class  SolutionTransfer
 Base class for all SolutionTransfer implementations. More...
 
class  SolverConfiguration
 
class  SolverException
 
class  SparseMatrix
 
class  SparseShellMatrix
 
class  Sphere
 A geometric object representing a sphere. More...
 
class  StatisticsVector
 A std::vector derived class for implementing simple statistical algorithms. More...
 
class  SteadySolver
 
class  StoredRange
 Utility class for defining generic ranges for threading. More...
 
class  SubdomainPartitioner
 Independently partitions chunks of subdomains and combines the results. More...
 
class  SumShellMatrix
 
class  Surface
 Base class for Plane and Sphere classes. More...
 
struct  SyncNodalPositions
 
struct  SyncRefinementFlags
 
class  System
 
class  SystemNorm
 
class  SystemSubset
 
class  SystemSubsetBySubdomain
 
class  TaoOptimizationSolver
 
class  TecplotIO
 
class  TensorShellMatrix
 
class  TensorValue
 
class  TestClass
 
class  Tet
 The base class for all tetrahedral element types. More...
 
class  Tet10
 A 3D tetrahedral element with 10 nodes. More...
 
class  Tet4
 A 3D tetrahedral element with 4 nodes. More...
 
class  TetGenIO
 
class  TetGenMeshInterface
 
class  TetGenWrapper
 
class  TimeSolver
 
class  TopologyMap
 Enables topology-based lookups of nodes. More...
 
class  TransientRBAssemblyExpansion
 
class  TransientRBConstruction
 
class  TransientRBEvaluation
 
class  TransientRBThetaExpansion
 
class  TransientSystem
 Used for solving transient systems of equations. More...
 
class  Tree
 Tree class templated on the number of leaves on each node. More...
 
class  TreeBase
 
class  TreeNode
 Base class for different Tree types. More...
 
class  Tri
 The base class for all triangular element types. More...
 
class  Tri3
 A 2D triangular element with 3 nodes. More...
 
class  Tri3Subdivision
 A surface shell element used in mechanics calculations. More...
 
class  Tri6
 A 2D triangular element with 6 nodes. More...
 
class  TriangleInterface
 
class  TrilinosPreconditioner
 
class  TriShell3
 
class  TwostepTimeSolver
 
class  TypeNTensor
 
struct  TypesEqual
 
struct  TypesEqual< T, T >
 
class  TypeTensor
 
class  TypeTensorColumn
 
class  TypeVector
 
class  UCDIO
 
class  UniformRefinementEstimator
 
class  UnsteadySolver
 
class  UnstructuredMesh
 Base class for Replicated and Distributed meshes. More...
 
class  UNVIO
 
class  Variable
 A variable which is solved for in a System of equations. More...
 
class  VariableGroup
 
class  VariationalMeshSmoother
 
class  vectormap
 
class  VectorSetAction
 
class  VectorValue
 
class  VTKIO
 
class  WeightedPatchRecoveryErrorEstimator
 
class  WendlandRBF
 Interface for evaluating Wendland's radial basis functions. More...
 
class  WrappedFunction
 
class  WrappedFunctor
 
class  Xdr
 C++ interface for the XDR (eXternal Data Representation) format. More...
 
class  XdrIO
 
class  ZeroFunction
 ConstFunction that simply returns 0. More...
 

Typedefs

typedef DynamicSparseNumberArray< Real, dof_id_typeDSNAN
 
template<typename T >
using UniquePtr = std::unique_ptr< T >
 
typedef std::map< dof_id_type, Real, std::less< dof_id_type >, Threads::scalable_allocator< std::pair< const dof_id_type, Real > > > DofConstraintRow
 
typedef std::map< const Node *, Real, std::less< const Node * >, Threads::scalable_allocator< std::pair< const Node *const, Real > > > NodeConstraintRow
 
typedef int32_t eigen_idx_type
 
typedef Eigen::SparseMatrix< Number, Eigen::RowMajor, eigen_idx_typeEigenSM
 
typedef Eigen::Matrix< Number, Eigen::Dynamic, 1 > EigenSV
 
typedef std::unordered_multiset< Elem *, ElemHashUtils, ElemHashUtilsunordered_multiset_elem
 
typedef StoredRange< MeshBase::element_iterator, Elem * > ElemRange
 
typedef StoredRange< MeshBase::const_element_iterator, const Elem * > ConstElemRange
 
typedef FEGenericBase< RealFEBase
 
typedef TensorValue< NumberNumberTensorValue
 
typedef NumberTensorValue Tensor
 
typedef VectorValue< NumberNumberVectorValue
 
typedef NumberVectorValue Gradient
 
typedef FEGenericBase< RealGradientFEVectorBase
 
typedef VectorValue< RealRealVectorValue
 
typedef TensorValue< RealRealTensorValue
 
typedef RealVectorValue RealGradient
 
typedef RealTensorValue RealTensor
 
typedef TestClass subdomain_id_type
 
typedef int8_t boundary_id_type
 
typedef uint8_t dof_id_type
 
typedef uint8_t unique_id_type
 
typedef dof_id_type numeric_index_type
 
typedef uint8_t processor_id_type
 
typedef uint64_t largest_id_type
 
typedef std::complex< RealComplex
 
typedef std::complex< RealCOMPLEX
 
typedef Real Number
 
typedef DistributedMesh DefaultMesh
 
typedef Real REAL
 
typedef StoredRange< MeshBase::node_iterator, Node * > NodeRange
 
typedef StoredRange< MeshBase::const_node_iterator, const Node * > ConstNodeRange
 
typedef BasicOStreamProxy OStreamProxy
 
typedef LinearImplicitSystem SteadyLinearSystem
 
typedef TransientSystem< LinearImplicitSystemTransientImplicitSystem
 
typedef TransientSystem< LinearImplicitSystemTransientLinearImplicitSystem
 
typedef TransientSystem< NonlinearImplicitSystemTransientNonlinearImplicitSystem
 
typedef TransientSystem< ExplicitSystemTransientExplicitSystem
 
typedef TransientSystem< SystemTransientBaseSystem
 
typedef TransientSystem< EigenSystemTransientEigenSystem
 

Enumerations

enum  VariableIndexing { SYSTEM_VARIABLE_ORDER = 0, LOCAL_VARIABLE_ORDER }
 
enum  LinearConvergenceReason {
  CONVERGED_RTOL_NORMAL = 1, CONVERGED_ATOL_NORMAL = 9, CONVERGED_RTOL = 2, CONVERGED_ATOL = 3,
  CONVERGED_ITS = 4, CONVERGED_CG_NEG_CURVE = 5, CONVERGED_CG_CONSTRAINED = 6, CONVERGED_STEP_LENGTH = 7,
  CONVERGED_HAPPY_BREAKDOWN = 8, DIVERGED_NULL = -2, DIVERGED_ITS = -3, DIVERGED_DTOL = -4,
  DIVERGED_BREAKDOWN = -5, DIVERGED_BREAKDOWN_BICG = -6, DIVERGED_NONSYMMETRIC = -7, DIVERGED_INDEFINITE_PC = -8,
  DIVERGED_NAN = -9, DIVERGED_INDEFINITE_MAT = -10, DIVERGED_PCSETUP_FAILED = -11, CONVERGED_ITERATING = 0,
  UNKNOWN_FLAG = -128
}
 
enum  EigenSolverType {
  POWER =0, LAPACK, SUBSPACE, ARNOLDI,
  LANCZOS, KRYLOVSCHUR, INVALID_EIGENSOLVER
}
 
enum  EigenProblemType {
  NHEP =0, HEP, GNHEP, GHEP,
  GHIEP, INVALID_EIGENPROBLEMTYPE
}
 
enum  PositionOfSpectrum {
  LARGEST_MAGNITUDE =0, SMALLEST_MAGNITUDE, TARGET_MAGNITUDE, LARGEST_REAL,
  SMALLEST_REAL, TARGET_REAL, LARGEST_IMAGINARY, SMALLEST_IMAGINARY,
  TARGET_IMAGINARY, INVALID_Postion_of_Spectrum, INVALID_POSITION_OF_SPECTRUM
}
 
enum  ElemQuality {
  ASPECT_RATIO =0, SKEW, SHEAR, SHAPE,
  MAX_ANGLE, MIN_ANGLE, CONDITION, DISTORTION,
  TAPER, WARP, STRETCH, DIAGONAL,
  ASPECT_RATIO_BETA, ASPECT_RATIO_GAMMA, SIZE, JACOBIAN
}
 
enum  ElemType {
  EDGE2 =0, EDGE3, EDGE4, TRI3,
  TRI6, QUAD4, QUAD8, QUAD9,
  TET4, TET10, HEX8, HEX20,
  HEX27, PRISM6, PRISM15, PRISM18,
  PYRAMID5, PYRAMID13, PYRAMID14, INFEDGE2,
  INFQUAD4, INFQUAD6, INFHEX8, INFHEX16,
  INFHEX18, INFPRISM6, INFPRISM12, NODEELEM,
  REMOTEELEM, TRI3SUBDIVISION, TRISHELL3, QUADSHELL4,
  QUADSHELL8, INVALID_ELEM
}
 
enum  ErrorEstimatorType {
  INVALID = -1, ADJOINT_REFINEMENT = 0, ADJOINT_RESIDUAL = 1, DISCONTINUITY_MEASURE = 2,
  EXACT = 3, KELLY = 4, LAPLACIAN = 5, PATCH_RECOVERY = 6,
  WEIGHTED_PATCH_RECOVERY = 7, UNIFORM_REFINEMENT = 8
}
 
enum  FEFamily {
  LAGRANGE = 0, HIERARCHIC = 1, MONOMIAL = 2, L2_HIERARCHIC = 6,
  L2_LAGRANGE = 7, BERNSTEIN = 3, SZABAB = 4, XYZ = 5,
  INFINITE_MAP = 11, JACOBI_20_00 = 12, JACOBI_30_00 = 13, LEGENDRE = 14,
  CLOUGH = 21, HERMITE = 22, SUBDIVISION = 23, SCALAR = 31,
  LAGRANGE_VEC = 41, NEDELEC_ONE = 42, INVALID_FE = 99
}
 
enum  FEContinuity { DISCONTINUOUS, C_ZERO, C_ONE, H_CURL }
 
enum  FEFieldType { TYPE_SCALAR = 0, TYPE_VECTOR }
 
enum  InfMapType { CARTESIAN =0, SPHERICAL, ELLIPSOIDAL, INVALID_INF_MAP }
 
enum  IOPackage {
  TECPLOT, GMV, GMSH, VTK,
  DIVA, TETGEN, UCD, LIBMESH,
  INVALID_IO_PACKAGE
}
 
enum  FEMNormType {
  L2 = 0, H1 = 1, H2 = 2, HCURL = 3,
  HDIV = 4, L1 = 5, L_INF = 6, H1_SEMINORM = 10,
  H2_SEMINORM = 11, HCURL_SEMINORM = 12, HDIV_SEMINORM = 13, W1_INF_SEMINORM = 15,
  W2_INF_SEMINORM = 16, DISCRETE_L1 = 20, DISCRETE_L2 = 21, DISCRETE_L_INF = 22,
  H1_X_SEMINORM = 31, H1_Y_SEMINORM = 32, H1_Z_SEMINORM = 33, INVALID_NORM = 42
}
 
enum  Order {
  CONSTANT = 0, FIRST = 1, SECOND = 2, THIRD = 3,
  FOURTH = 4, FIFTH = 5, SIXTH = 6, SEVENTH = 7,
  EIGHTH = 8, NINTH = 9, TENTH = 10, ELEVENTH = 11,
  TWELFTH = 12, THIRTEENTH = 13, FOURTEENTH = 14, FIFTEENTH = 15,
  SIXTEENTH = 16, SEVENTEENTH = 17, EIGHTTEENTH = 18, NINTEENTH = 19,
  NINETEENTH = 19, TWENTIETH = 20, TWENTYFIRST = 21, TWENTYSECOND = 22,
  TWENTYTHIRD = 23, TWENTYFOURTH = 24, TWENTYFIFTH = 25, TWENTYSIXTH = 26,
  TWENTYSEVENTH = 27, TWENTYEIGHTH = 28, TWENTYNINTH = 29, THIRTIETH = 30,
  THIRTYFIRST = 31, THIRTYSECOND = 32, THIRTYTHIRD = 33, THIRTYFOURTH = 34,
  THIRTYFIFTH = 35, THIRTYSIXTH = 36, THIRTYSEVENTH = 37, THIRTYEIGHTH = 38,
  THIRTYNINTH = 39, FORTIETH = 40, FORTYFIRST = 41, FORTYSECOND = 42,
  FORTYTHIRD = 43, INVALID_ORDER
}
 
enum  ParallelType {
  AUTOMATIC =0, SERIAL, PARALLEL, GHOSTED,
  INVALID_PARALLELIZATION
}
 
enum  PointLocatorType { TREE = 0, TREE_ELEMENTS, TREE_LOCAL_ELEMENTS, INVALID_LOCATOR }
 
enum  PreconditionerType {
  IDENTITY_PRECOND =0, JACOBI_PRECOND, BLOCK_JACOBI_PRECOND, SOR_PRECOND,
  SSOR_PRECOND, EISENSTAT_PRECOND, ASM_PRECOND, CHOLESKY_PRECOND,
  ICC_PRECOND, ILU_PRECOND, LU_PRECOND, USER_PRECOND,
  SHELL_PRECOND, AMG_PRECOND, INVALID_PRECONDITIONER
}
 
enum  QuadratureType {
  QGAUSS = 0, QJACOBI_1_0 = 1, QJACOBI_2_0 = 2, QSIMPSON = 3,
  QTRAP = 4, QGRID = 5, QGRUNDMANN_MOLLER = 6, QMONOMIAL = 7,
  QCONICAL = 8, QGAUSS_LOBATTO = 9, QCLOUGH = 21, QCOMPOSITE = 31,
  INVALID_Q_RULE = 127
}
 
enum  SolverPackage { PETSC_SOLVERS =0, SLEPC_SOLVERS, NLOPT_SOLVERS }
 
enum  SolverType {
  CG =0, CGN, CGS, CR,
  QMR, TCQMR, TFQMR, BICG,
  BICGSTAB, MINRES, GMRES, LSQR,
  JACOBI, SOR_FORWARD, SOR_BACKWARD, SSOR,
  RICHARDSON, CHEBYSHEV, SPARSELU, INVALID_SOLVER
}
 
enum  SubsetSolveMode { SUBSET_ZERO = 0, SUBSET_COPY_RHS, SUBSET_DONT_TOUCH }
 
enum  XdrMODE {
  UNKNOWN = -1, ENCODE =0, DECODE, WRITE,
  READ
}
 

Functions

bool warned_about_auto_ptr (false)
 
const Number imaginary (0., 1.)
 
bool initialized ()
 
bool closed ()
 
void libmesh_terminate_handler ()
 
void enableFPE (bool on)
 
void enableSEGV (bool on)
 
bool on_command_line (const std::string &arg)
 
template<typename T >
command_line_value (const std::string &name, T value)
 
template<typename T >
command_line_value (const std::vector< std::string > &name, T value)
 
template<typename T >
command_line_next (const std::string &name, T value)
 
template<typename T >
void command_line_vector (const std::string &name, std::vector< T > &vec)
 
SolverPackage default_solver_package ()
 
template int command_line_value< int > (const std::string &, int)
 
template float command_line_value< float > (const std::string &, float)
 
template double command_line_value< double > (const std::string &, double)
 
template long double command_line_value< long double > (const std::string &, long double)
 
template std::string command_line_value< std::string > (const std::string &, std::string)
 
template int command_line_value< int > (const std::vector< std::string > &, int)
 
template float command_line_value< float > (const std::vector< std::string > &, float)
 
template double command_line_value< double > (const std::vector< std::string > &, double)
 
template long double command_line_value< long double > (const std::vector< std::string > &, long double)
 
template std::string command_line_value< std::string > (const std::vector< std::string > &, std::string)
 
template int command_line_next< int > (const std::string &, int)
 
template float command_line_next< float > (const std::string &, float)
 
template double command_line_next< double > (const std::string &, double)
 
template long double command_line_next< long double > (const std::string &, long double)
 
template std::string command_line_next< std::string > (const std::string &, std::string)
 
template void command_line_vector< int > (const std::string &, std::vector< int > &)
 
template void command_line_vector< float > (const std::string &, std::vector< float > &)
 
template void command_line_vector< double > (const std::string &, std::vector< double > &)
 
template void command_line_vector< long double > (const std::string &, std::vector< long double > &)
 
void print_trace (std::ostream &out_stream)
 
void write_traceout ()
 
std::string demangle (const char *name)
 
 INSTANTIATE_FE (0)
 
 INSTANTIATE_FE (1)
 
 INSTANTIATE_FE (2)
 
 INSTANTIATE_FE (3)
 
std::ostream & operator<< (std::ostream &os, const FEAbstract &fe)
 
 REINIT_ERROR (0, CLOUGH, reinit)
 
 REINIT_ERROR (0, CLOUGH, edge_reinit)
 
 SIDEMAP_ERROR (0, CLOUGH, side_map)
 
 REINIT_ERROR (0, HERMITE, reinit)
 
 REINIT_ERROR (0, HERMITE, edge_reinit)
 
 SIDEMAP_ERROR (0, HERMITE, side_map)
 
 REINIT_ERROR (0, HIERARCHIC, reinit)
 
 REINIT_ERROR (0, HIERARCHIC, edge_reinit)
 
 SIDEMAP_ERROR (0, HIERARCHIC, side_map)
 
 REINIT_ERROR (0, L2_HIERARCHIC, reinit)
 
 REINIT_ERROR (0, L2_HIERARCHIC, edge_reinit)
 
 SIDEMAP_ERROR (0, L2_HIERARCHIC, side_map)
 
 REINIT_ERROR (0, LAGRANGE, reinit)
 
 REINIT_ERROR (0, LAGRANGE, edge_reinit)
 
 SIDEMAP_ERROR (0, LAGRANGE, side_map)
 
 REINIT_ERROR (0, LAGRANGE_VEC, reinit)
 
 REINIT_ERROR (0, LAGRANGE_VEC, edge_reinit)
 
 SIDEMAP_ERROR (0, LAGRANGE_VEC, side_map)
 
 REINIT_ERROR (0, L2_LAGRANGE, reinit)
 
 REINIT_ERROR (0, L2_LAGRANGE, edge_reinit)
 
 SIDEMAP_ERROR (0, L2_LAGRANGE, side_map)
 
 REINIT_ERROR (0, MONOMIAL, reinit)
 
 REINIT_ERROR (0, MONOMIAL, edge_reinit)
 
 SIDEMAP_ERROR (0, MONOMIAL, side_map)
 
 REINIT_ERROR (0, SCALAR, reinit)
 
 REINIT_ERROR (0, SCALAR, edge_reinit)
 
 SIDEMAP_ERROR (0, SCALAR, side_map)
 
 REINIT_ERROR (0, XYZ, reinit)
 
 REINIT_ERROR (0, XYZ, edge_reinit)
 
 SIDEMAP_ERROR (0, XYZ, side_map)
 
 REINIT_ERROR (0, NEDELEC_ONE, reinit)
 
 REINIT_ERROR (0, NEDELEC_ONE, edge_reinit)
 
 SIDEMAP_ERROR (0, NEDELEC_ONE, side_map)
 
 REINIT_ERROR (0, BERNSTEIN, reinit)
 
 REINIT_ERROR (0, BERNSTEIN, edge_reinit)
 
 SIDEMAP_ERROR (0, BERNSTEIN, side_map)
 
 REINIT_ERROR (0, SZABAB, reinit)
 
 REINIT_ERROR (0, SZABAB, edge_reinit)
 
 SIDEMAP_ERROR (0, SZABAB, side_map)
 
 REINIT_ERROR (1, CLOUGH, edge_reinit)
 
 REINIT_ERROR (1, HERMITE, edge_reinit)
 
 REINIT_ERROR (1, HIERARCHIC, edge_reinit)
 
 REINIT_ERROR (1, L2_HIERARCHIC, edge_reinit)
 
 REINIT_ERROR (1, LAGRANGE, edge_reinit)
 
 REINIT_ERROR (1, LAGRANGE_VEC, edge_reinit)
 
 REINIT_ERROR (1, L2_LAGRANGE, edge_reinit)
 
 REINIT_ERROR (1, XYZ, edge_reinit)
 
 REINIT_ERROR (1, MONOMIAL, edge_reinit)
 
 REINIT_ERROR (1, SCALAR, edge_reinit)
 
 REINIT_ERROR (1, NEDELEC_ONE, reinit)
 
 REINIT_ERROR (1, NEDELEC_ONE, edge_reinit)
 
 SIDEMAP_ERROR (1, NEDELEC_ONE, side_map)
 
 REINIT_ERROR (1, BERNSTEIN, edge_reinit)
 
 REINIT_ERROR (1, SZABAB, edge_reinit)
 
 INSTANTIATE_ALL_MAPS (0)
 
 INSTANTIATE_ALL_MAPS (1)
 
 INSTANTIATE_ALL_MAPS (2)
 
 INSTANTIATE_ALL_MAPS (3)
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, Elem *, Base::build_elem(const Elem *))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, Elem *, Base::build_elem(const Elem *))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, Elem *, Base::build_elem(const Elem *))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, ElemType, Base::get_elem_type(const ElemType type))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, ElemType, Base::get_elem_type(const ElemType type))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, ElemType, Base::get_elem_type(const ElemType type))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, unsigned int, Base::n_base_mapping_sf(const ElemType, const Order))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, unsigned int, Base::n_base_mapping_sf(const ElemType, const Order))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, unsigned int, Base::n_base_mapping_sf(const ElemType, const Order))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, unsigned int, Radial::n_dofs_at_node(const Order, const unsigned int))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, unsigned int, Radial::n_dofs_at_node(const Order, const unsigned int))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, unsigned int, Radial::n_dofs_at_node(const Order, const unsigned int))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, void, reinit(const Elem *, const unsigned int, const Real, const std::vector< Point > *const, const std::vector< Real > *const))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, void, reinit(const Elem *, const unsigned int, const Real, const std::vector< Point > *const, const std::vector< Real > *const))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, void, reinit(const Elem *, const unsigned int, const Real, const std::vector< Point > *const, const std::vector< Real > *const))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, void, edge_reinit(const Elem *, const unsigned int, const Real, const std::vector< Point > *const, const std::vector< Real > *const))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, void, edge_reinit(const Elem *, const unsigned int, const Real, const std::vector< Point > *const, const std::vector< Real > *const))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, void, edge_reinit(const Elem *, const unsigned int, const Real, const std::vector< Point > *const, const std::vector< Real > *const))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, void, init_face_shape_functions(const std::vector< Point > &, const Elem *))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, void, init_face_shape_functions(const std::vector< Point > &, const Elem *))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, void, init_face_shape_functions(const std::vector< Point > &, const Elem *))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, Point, map(const Elem *, const Point &))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, Point, map(const Elem *, const Point &))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, Point, map(const Elem *, const Point &))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, Point, inverse_map(const Elem *, const Point &, const Real, const bool))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, Point, inverse_map(const Elem *, const Point &, const Real, const bool))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, Point, inverse_map(const Elem *, const Point &, const Real, const bool))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, void, inverse_map(const Elem *, const std::vector< Point > &, std::vector< Point > &, const Real, const bool))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, void, inverse_map(const Elem *, const std::vector< Point > &, std::vector< Point > &, const Real, const bool))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, void, inverse_map(const Elem *, const std::vector< Point > &, std::vector< Point > &, const Real, const bool))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, unsigned int, n_dofs(const FEType &, const ElemType))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, unsigned int, n_dofs(const FEType &, const ElemType))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, unsigned int, n_dofs(const FEType &, const ElemType))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, unsigned int, n_dofs_per_elem(const FEType &, const ElemType))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, unsigned int, n_dofs_per_elem(const FEType &, const ElemType))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, unsigned int, n_dofs_per_elem(const FEType &, const ElemType))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, unsigned int, n_dofs_at_node(const FEType &, const ElemType, const unsigned int))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, unsigned int, n_dofs_at_node(const FEType &, const ElemType, const unsigned int))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, unsigned int, n_dofs_at_node(const FEType &, const ElemType, const unsigned int))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, void, compute_shape_indices(const FEType &, const ElemType, const unsigned int, unsigned int &, unsigned int &))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, void, compute_shape_indices(const FEType &, const ElemType, const unsigned int, unsigned int &, unsigned int &))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, void, compute_shape_indices(const FEType &, const ElemType, const unsigned int, unsigned int &, unsigned int &))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, void, compute_node_indices(const ElemType, const unsigned int, unsigned int &, unsigned int &))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, void, compute_node_indices(const ElemType, const unsigned int, unsigned int &, unsigned int &))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, void, compute_node_indices(const ElemType, const unsigned int, unsigned int &, unsigned int &))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, Real, shape(const FEType &, const Elem *, const unsigned int, const Point &p))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, Real, shape(const FEType &, const Elem *, const unsigned int, const Point &p))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, Real, shape(const FEType &, const Elem *, const unsigned int, const Point &p))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, Real, shape(const FEType &, const ElemType, const unsigned int, const Point &))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, Real, shape(const FEType &, const ElemType, const unsigned int, const Point &))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, Real, shape(const FEType &, const ElemType, const unsigned int, const Point &))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, void, compute_data(const FEType &, const Elem *, FEComputeData &))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, void, compute_data(const FEType &, const Elem *, FEComputeData &))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, void, compute_data(const FEType &, const Elem *, FEComputeData &))
 
 INSTANTIATE_INF_FE_MBRF (1, CARTESIAN, void, nodal_soln(const FEType &, const Elem *, const std::vector< Number > &, std::vector< Number > &))
 
 INSTANTIATE_INF_FE_MBRF (2, CARTESIAN, void, nodal_soln(const FEType &, const Elem *, const std::vector< Number > &, std::vector< Number > &))
 
 INSTANTIATE_INF_FE_MBRF (3, CARTESIAN, void, nodal_soln(const FEType &, const Elem *, const std::vector< Number > &, std::vector< Number > &))
 
bool is_between (Real min, Real check, Real max)
 
std::unique_ptr< CheckpointIOsplit_mesh (MeshBase &mesh, unsigned int nsplits)
 
std::ostream & operator<< (std::ostream &os, const MeshBase &m)
 
void query_ghosting_functors (const MeshBase &mesh, processor_id_type pid, bool newly_coarsened_only, std::set< const Elem *, CompareElemIdsByLevel > &connected_elements)
 
void connect_children (const MeshBase &mesh, processor_id_type pid, std::set< const Elem *, CompareElemIdsByLevel > &connected_elements)
 
void connect_families (std::set< const Elem *, CompareElemIdsByLevel > &connected_elements)
 
void reconnect_nodes (const std::set< const Elem *, CompareElemIdsByLevel > &connected_elements, std::set< const Node * > &connected_nodes)
 
template void MeshCommunication::find_global_indices< MeshBase::const_node_iterator > (const Parallel::Communicator &, const libMesh::BoundingBox &, const MeshBase::const_node_iterator &, const MeshBase::const_node_iterator &, std::vector< dof_id_type > &) const
 
template void MeshCommunication::find_global_indices< MeshBase::const_element_iterator > (const Parallel::Communicator &, const libMesh::BoundingBox &, const MeshBase::const_element_iterator &, const MeshBase::const_element_iterator &, std::vector< dof_id_type > &) const
 
template void MeshCommunication::find_global_indices< MeshBase::node_iterator > (const Parallel::Communicator &, const libMesh::BoundingBox &, const MeshBase::node_iterator &, const MeshBase::node_iterator &, std::vector< dof_id_type > &) const
 
template void MeshCommunication::find_global_indices< MeshBase::element_iterator > (const Parallel::Communicator &, const libMesh::BoundingBox &, const MeshBase::element_iterator &, const MeshBase::element_iterator &, std::vector< dof_id_type > &) const
 
 LIBMESH_VMA_INSTANTIATE (Real, int, Real)
 
 LIBMESH_VMA_INSTANTIATE (Real, float, Real)
 
 LIBMESH_VMA_INSTANTIATE (Real, double, Real)
 
 LIBMESH_VMA_INSTANTIATE (Real, int, Complex)
 
 LIBMESH_VMA_INSTANTIATE (Complex, int, Complex)
 
 LIBMESH_VMA_INSTANTIATE (Complex, int, Real)
 
 LIBMESH_VMA_INSTANTIATE (Real, float, Complex)
 
 LIBMESH_VMA_INSTANTIATE (Complex, float, Complex)
 
 LIBMESH_VMA_INSTANTIATE (Complex, float, Real)
 
 LIBMESH_VMA_INSTANTIATE (Real, std::complex< float >, Complex)
 
 LIBMESH_VMA_INSTANTIATE (Complex, std::complex< float >, Complex)
 
 LIBMESH_VMA_INSTANTIATE (Complex, std::complex< float >, Real)
 
 LIBMESH_VMA_INSTANTIATE (Real, double, Complex)
 
 LIBMESH_VMA_INSTANTIATE (Complex, double, Complex)
 
 LIBMESH_VMA_INSTANTIATE (Complex, double, Real)
 
 LIBMESH_VMA_INSTANTIATE (Real, std::complex< double >, Complex)
 
 LIBMESH_VMA_INSTANTIATE (Complex, std::complex< double >, Complex)
 
 LIBMESH_VMA_INSTANTIATE (Complex, std::complex< double >, Real)
 
std::ostream & operator<< (std::ostream &os, const QBase &q)
 
template<typename T >
SIGN (T a, T b)
 
double __libmesh_nlopt_objective (unsigned n, const double *x, double *gradient, void *data)
 
void __libmesh_nlopt_equality_constraints (unsigned m, double *result, unsigned n, const double *x, double *gradient, void *data)
 
void __libmesh_nlopt_inequality_constraints (unsigned m, double *result, unsigned n, const double *x, double *gradient, void *data)
 
void petsc_auto_fieldsplit (PC my_pc, const System &sys)
 
PetscErrorCode __libmesh_petsc_diff_solver_monitor (SNES snes, PetscInt its, PetscReal fnorm, void *ctx)
 
PetscErrorCode __libmesh_petsc_diff_solver_residual (SNES, Vec x, Vec r, void *ctx)
 
PetscErrorCode __libmesh_petsc_diff_solver_jacobian (SNES, Vec x,#if PETSC_RELEASE_LESS_THAN(3, 5, 0) Mat *libmesh_dbg_var(j), Mat *pc, MatStructure *msflag,#else Mat libmesh_dbg_var(j), Mat pc,#endif void *ctx)
 
DiffSolver::SolveResult convert_solve_result (SNESConvergedReason r)
 
PetscErrorCode __libmesh_petsc_preconditioner_setup (void *ctx)
 
PetscErrorCode __libmesh_petsc_preconditioner_apply (void *ctx, Vec x, Vec y)
 
PetscErrorCode __libmesh_petsc_preconditioner_setup (PC pc)
 
PetscErrorCode __libmesh_petsc_preconditioner_apply (PC pc, Vec x, Vec y)
 
ResidualContext libmesh_petsc_snes_residual_helper (SNES snes, Vec x, void *ctx)
 
PetscErrorCode __libmesh_petsc_snes_monitor (SNES, PetscInt its, PetscReal fnorm, void *)
 
PetscErrorCode __libmesh_petsc_snes_residual (SNES snes, Vec x, Vec r, void *ctx)
 
PetscErrorCode __libmesh_petsc_snes_fd_residual (SNES snes, Vec x, Vec r, void *ctx)
 
PetscErrorCode __libmesh_petsc_snes_mffd_interface (void *ctx, Vec x, Vec r)
 
PetscErrorCode __libmesh_petsc_snes_mffd_residual (SNES snes, Vec x, Vec r, void *ctx)
 
PetscErrorCode __libmesh_petsc_snes_jacobian (#if PETSC_RELEASE_LESS_THAN(3, 5, 0) SNES snes, Vec x, Mat *jac, Mat *pc, MatStructure *msflag, void *ctx#else SNES snes, Vec x, Mat jac, Mat pc, void *ctx#endif)
 
PetscErrorCode __libmesh_petsc_snes_postcheck (#if PETSC_VERSION_LESS_THAN(3, 3, 0) SNES, Vec x, Vec y, Vec w, void *context, PetscBool *changed_y, PetscBool *changed_w#else SNESLineSearch, Vec x, Vec y, Vec w, PetscBool *changed_y, PetscBool *changed_w, void *context#endif)
 
PetscErrorCode __libmesh_tao_objective (Tao, Vec x, PetscReal *objective, void *ctx)
 
PetscErrorCode __libmesh_tao_gradient (Tao, Vec x, Vec g, void *ctx)
 
PetscErrorCode __libmesh_tao_hessian (Tao, Vec x, Mat h, Mat pc, void *ctx)
 
PetscErrorCode __libmesh_tao_equality_constraints (Tao, Vec x, Vec ce, void *ctx)
 
PetscErrorCode __libmesh_tao_equality_constraints_jacobian (Tao, Vec x, Mat J, Mat Jpre, void *ctx)
 
PetscErrorCode __libmesh_tao_inequality_constraints (Tao, Vec x, Vec cineq, void *ctx)
 
PetscErrorCode __libmesh_tao_inequality_constraints_jacobian (Tao, Vec x, Mat J, Mat Jpre, void *ctx)
 
std::ostream & operator<< (std::ostream &os, const EquationSystems &es)
 
template void Xdr::data< std::complex< float > > (std::complex< float > &, const char *)
 
template void Xdr::data< std::complex< double > > (std::complex< double > &, const char *)
 
template void Xdr::data< std::complex< long double > > (std::complex< long double > &, const char *)
 
template void Xdr::data< std::string > (std::string &, const char *)
 
template void Xdr::data< std::vector< int > > (std::vector< int > &, const char *)
 
template void Xdr::data< std::vector< unsigned int > > (std::vector< unsigned int > &, const char *)
 
template void Xdr::data< std::vector< short int > > (std::vector< short int > &, const char *)
 
template void Xdr::data< std::vector< unsigned short int > > (std::vector< unsigned short int > &, const char *)
 
template void Xdr::data< std::vector< long int > > (std::vector< long int > &, const char *)
 
template void Xdr::data< std::vector< long long > > (std::vector< long long > &, const char *)
 
template void Xdr::data< std::vector< unsigned long int > > (std::vector< unsigned long int > &, const char *)
 
template void Xdr::data< std::vector< unsigned long long > > (std::vector< unsigned long long > &, const char *)
 
template void Xdr::data< std::vector< char > > (std::vector< char > &, const char *)
 
template void Xdr::data< std::vector< signed char > > (std::vector< signed char > &, const char *)
 
template void Xdr::data< std::vector< unsigned char > > (std::vector< unsigned char > &, const char *)
 
template void Xdr::data< std::vector< float > > (std::vector< float > &, const char *)
 
template void Xdr::data< std::vector< double > > (std::vector< double > &, const char *)
 
template void Xdr::data< std::vector< long double > > (std::vector< long double > &, const char *)
 
template void Xdr::data< std::vector< std::complex< float > > > (std::vector< std::complex< float >> &, const char *)
 
template void Xdr::data< std::vector< std::complex< double > > > (std::vector< std::complex< double >> &, const char *)
 
template void Xdr::data< std::vector< std::complex< long double > > > (std::vector< std::complex< long double >> &, const char *)
 
template void Xdr::data< std::vector< std::string > > (std::vector< std::string > &, const char *)
 
template<typename T , typename... Args>
std::unique_ptr< T > make_unique (Args &&...args)
 
 ScalarTraits_true (char)
 
 ScalarTraits_true (short)
 
 ScalarTraits_true (int)
 
 ScalarTraits_true (long)
 
 ScalarTraits_true (unsigned char)
 
 ScalarTraits_true (float)
 
 ScalarTraits_true (double)
 
 SUPERTYPE (unsigned char, short)
 
 SUPERTYPE (unsigned char, int)
 
 SUPERTYPE (unsigned char, float)
 
 SUPERTYPE (unsigned char, double)
 
 SUPERTYPE (unsigned char, long double)
 
 SUPERTYPE (char, short)
 
 SUPERTYPE (char, int)
 
 SUPERTYPE (char, float)
 
 SUPERTYPE (char, double)
 
 SUPERTYPE (char, long double)
 
 SUPERTYPE (short, int)
 
 SUPERTYPE (short, float)
 
 SUPERTYPE (short, double)
 
 SUPERTYPE (short, long double)
 
 SUPERTYPE (int, float)
 
 SUPERTYPE (int, double)
 
 SUPERTYPE (int, long double)
 
 SUPERTYPE (float, double)
 
 SUPERTYPE (float, long double)
 
 SUPERTYPE (double, long double)
 
std::ostream & operator<< (std::ostream &os, const Elem &e)
 
bool operator== (const OrderWrapper &lhs, const OrderWrapper &rhs)
 
bool operator!= (const OrderWrapper &lhs, const OrderWrapper &rhs)
 
bool operator< (const OrderWrapper &lhs, const OrderWrapper &rhs)
 
bool operator> (const OrderWrapper &lhs, const OrderWrapper &rhs)
 
bool operator<= (const OrderWrapper &lhs, const OrderWrapper &rhs)
 
bool operator>= (const OrderWrapper &lhs, const OrderWrapper &rhs)
 
 OrderWrapperOperators (int) OrderWrapperOperators(unsigned int) OrderWrapperOperators(std
 
bool operator== (const OrderWrapper &lhs, int rhs)
 
bool operator== (Order lhs, const OrderWrapper &rhs)
 
bool operator== (const OrderWrapper &lhs, Order rhs)
 
bool operator!= (int lhs, const OrderWrapper &rhs)
 
bool operator!= (const OrderWrapper &lhs, int rhs)
 
bool operator!= (Order lhs, const OrderWrapper &rhs)
 
bool operator!= (const OrderWrapper &lhs, Order rhs)
 
bool operator< (int lhs, const OrderWrapper &rhs)
 
bool operator< (const OrderWrapper &lhs, int rhs)
 
bool operator< (Order lhs, const OrderWrapper &rhs)
 
bool operator< (const OrderWrapper &lhs, Order rhs)
 
bool operator> (int lhs, const OrderWrapper &rhs)
 
bool operator> (const OrderWrapper &lhs, int rhs)
 
bool operator> (Order lhs, const OrderWrapper &rhs)
 
bool operator> (const OrderWrapper &lhs, Order rhs)
 
bool operator<= (int lhs, const OrderWrapper &rhs)
 
bool operator<= (const OrderWrapper &lhs, int rhs)
 
bool operator<= (Order lhs, const OrderWrapper &rhs)
 
bool operator<= (const OrderWrapper &lhs, Order rhs)
 
bool operator>= (int lhs, const OrderWrapper &rhs)
 
bool operator>= (const OrderWrapper &lhs, int rhs)
 
bool operator>= (Order lhs, const OrderWrapper &rhs)
 
bool operator>= (const OrderWrapper &lhs, Order rhs)
 
std::ostream & operator<< (std::ostream &os, const OrderWrapper &order)
 
 INSTANTIATE_INF_FE (1, CARTESIAN)
 
 INSTANTIATE_INF_FE (2, CARTESIAN)
 
 INSTANTIATE_INF_FE (3, CARTESIAN)
 
processor_id_type n_processors ()
 
processor_id_type processor_id ()
 
processor_id_type global_n_processors ()
 
processor_id_type global_processor_id ()
 
unsigned int n_threads ()
 
template<typename T >
libmesh_real (T a)
 
template<typename T >
libmesh_conj (T a)
 
template<typename T >
libmesh_real (std::complex< T > a)
 
template<typename T >
std::complex< T > libmesh_conj (std::complex< T > a)
 
bool libmesh_isnan (float a)
 
bool libmesh_isnan (double a)
 
bool libmesh_isnan (long double a)
 
template<typename T >
bool libmesh_isnan (std::complex< T > a)
 
template<typename T >
bool libmesh_isinf (T x)
 
template<typename T >
bool libmesh_isinf (std::complex< T > a)
 
template<class T >
void libmesh_ignore (const T &)
 
template<typename Tnew , typename Told >
Tnew cast_ref (Told &oldvar)
 
template<typename Tnew , typename Told >
Tnew libmesh_cast_ref (Told &oldvar)
 
template<typename Tnew , typename Told >
Tnew cast_ptr (Told *oldvar)
 
template<typename Tnew , typename Told >
Tnew libmesh_cast_ptr (Told *oldvar)
 
template<typename Tnew , typename Told >
Tnew cast_int (Told oldvar)
 
template<typename Tnew , typename Told >
Tnew libmesh_cast_int (Told oldvar)
 
void libmesh_version_stdout ()
 
int get_libmesh_version ()
 
std::string get_io_compatibility_version ()
 
std::ostream & operator<< (std::ostream &os, const Node &n)
 
template<typename P >
void print_helper (std::ostream &os, const P *param)
 
template<typename P >
void print_helper (std::ostream &os, const std::vector< P > *param)
 
template<typename P >
void print_helper (std::ostream &os, const std::vector< std::vector< P >> *param)
 
std::ostream & operator<< (std::ostream &os, const Parameters &p)
 
template<>
void print_helper (std::ostream &os, const char *param)
 
template<>
void print_helper (std::ostream &os, const unsigned char *param)
 
PetscErrorCode __libmesh_petsc_snes_jacobian (SNES, Vec x, Mat *jac, Mat *pc, MatStructure *msflag, void *ctx)
 
PetscErrorCode __libmesh_petsc_snes_jacobian (SNES, Vec x, Mat jac, Mat pc, void *ctx)
 
PetscInt * numeric_petsc_cast (const numeric_index_type *p)
 
template<typename I >
SimpleRange< I > as_range (const std::pair< I, I > &p)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const SparseMatrix< T > &m)
 
template<typename T , typename Scalar >
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeTensor< typename CompareTypes< T, Scalar >::supertype > >::type operator* (const Scalar factor, const TypeTensor< T > &t)
 
template<typename T , typename Scalar >
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< T, Scalar >::supertype > >::type operator* (const Scalar factor, const TypeVector< T > &v)
 
template<typename T >
triple_product (const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
 
template<typename T >
cross_norm_sq (const TypeVector< T > &b, const TypeVector< T > &c)
 
template<typename T >
cross_norm (const TypeVector< T > &b, const TypeVector< T > &c)
 

Variables

DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
 
DIE A HORRIBLE DEATH HERE typedef float ErrorVectorReal
 
MPI_Comm COMM_WORLD = MPI_COMM_NULL
 
MPI_Comm GLOBAL_COMM_WORLD = MPI_COMM_NULL
 
Parallel::FakeCommunicator CommWorld
 
OStreamProxy out (std::cout)
 
OStreamProxy err (std::cerr)
 
PerfLog perflog ("libMesh",#ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING true#else false#endif)
 
MPI_Errhandler libmesh_errhandler
 
 TRILINOS_SOLVERS
 
 EIGEN_SOLVERS
 
 LASPACK_SOLVERS
 
 INVALID_SOLVER_PACKAGE
 
std::terminate_handler old_terminate_handler
 
 INSTANTIATE_SUBDIVISION_FE
 
 INSTANTIATE_SUBDIVISION_MAPS
 
Threads::spin_mutex parent_indices_mutex
 
Threads::spin_mutex parent_bracketing_nodes_mutex
 
const RemoteElemremote_elem
 
const unsigned int MIN_ELEM_PER_PROC = 4
 
const unsigned char triangular_number_row []
 
const unsigned char triangular_number_column []
 
const unsigned char square_number_column []
 
const unsigned char square_number_row []
 
const unsigned char cube_number_column []
 
const unsigned char cube_number_row []
 
const unsigned char cube_number_page []
 
const Number imaginary
 
const Real pi
 
const Number zero = 0.
 
const unsigned int invalid_uint = static_cast<unsigned int>(-1)
 
static const Real TOLERANCE = 1.e-8
 
bool warned_about_auto_ptr
 

Detailed Description

Sanity check, without prior inclusion of libmesh_config.h.

This file is no typical header file. It is only to be included at the end of an implementation file, so that the proper variations of the InfFE class are instantiated.

The libMesh namespace provides an interface to certain functionality in the library. It provides a uniform init() method that initializes any other dependent libraries (e.g. MPI or PETSC), and a close() method for closing those libraries. It also provides a centralized place for performance logging and other functionality.

Typedef Documentation

typedef int16_t libMesh::boundary_id_type

Definition at line 51 of file id_types.h.

typedef std::complex<Real> libMesh::Complex

Definition at line 155 of file libmesh_common.h.

typedef std::complex<Real> libMesh::COMPLEX

Definition at line 156 of file libmesh_common.h.

Definition at line 28 of file mesh.h.

typedef uint32_t libMesh::dof_id_type

Definition at line 64 of file id_types.h.

A row of the Dof constraint matrix.

Definition at line 89 of file dof_map.h.

typedef DynamicSparseNumberArray<Real, dof_id_type> libMesh::DSNAN

Definition at line 86 of file system_projection.C.

typedef int32_t libMesh::eigen_idx_type

Definition at line 66 of file eigen_core_support.h.

typedef Eigen::SparseMatrix<Number, Eigen::RowMajor, eigen_idx_type> libMesh::EigenSM

Definition at line 78 of file eigen_core_support.h.

typedef Eigen::Matrix<Number, Eigen::Dynamic, 1> libMesh::EigenSV

Definition at line 79 of file eigen_core_support.h.

Definition at line 37 of file exact_error_estimator.h.

Definition at line 668 of file fe_base.h.

Definition at line 52 of file exact_error_estimator.h.

typedef uint8_t libMesh::largest_id_type

Definition at line 139 of file id_types.h.

typedef std::map<const Node *, Real, std::less<const Node *>, Threads::scalable_allocator<std::pair<const Node * const, Real> > > libMesh::NodeConstraintRow

A row of the Node constraint mapping. Currently this just stores the topology of the constrained Nodes, but for forward compatibility we also include coefficients, so we could add Lagrange-positioned-node constraints later.

Definition at line 137 of file dof_map.h.

Definition at line 31 of file node_range.h.

Definition at line 191 of file libmesh_common.h.

Definition at line 92 of file id_types.h.

Definition at line 232 of file ostream_proxy.h.

typedef uint16_t libMesh::processor_id_type

Definition at line 99 of file id_types.h.

Definition at line 36 of file mesh_triangle_wrapper.h.

Definition at line 50 of file hp_coarsentest.h.

Definition at line 51 of file hp_coarsentest.h.

Useful typedefs to allow transparent switching between Real and Complex data types.

Definition at line 49 of file hp_coarsentest.h.

Useful typedefs to allow transparent switching between Real and Complex data types.

Definition at line 47 of file hp_coarsentest.h.

typedef uint16_t libMesh::subdomain_id_type
Note
subdomain_id_type should be a positive integer, but due to a limitation in the exodusII API, we are forced to use a signed integer here to represent subdomains. This gives us 2^31 possible unique blocks.

Based on the 4-byte comment warning above, this probably doesn't work with exodusII at all...

Definition at line 43 of file id_types.h.

Definition at line 50 of file exact_error_estimator.h.

typedef uint64_t libMesh::unique_id_type

Definition at line 79 of file id_types.h.

template<typename T >
using libMesh::UniquePtr = typedef std::unique_ptr<T>

Definition at line 33 of file auto_ptr.h.

typedef std::unordered_multiset<Elem *, ElemHashUtils, ElemHashUtils> libMesh::unordered_multiset_elem

Definition at line 77 of file elem_hash.h.

Enumeration Type Documentation

Defines an enum for eigenproblem types. This can be Hermitian (HEP), generalized Hermitian (GHEP), non-Hermitian (NHEP), generalized non-Hermitian (GNHEP), or generalized indefinite Hermitian (GHIEP).

Enumerator
NHEP 
HEP 
GNHEP 
GHEP 
GHIEP 
INVALID_EIGENPROBLEMTYPE 

Definition at line 51 of file enum_eigen_solver_type.h.

Defines an enum for iterative eigenproblem solver types

Enumerator
POWER 
LAPACK 
SUBSPACE 
ARNOLDI 
LANCZOS 
KRYLOVSCHUR 
INVALID_EIGENSOLVER 

Definition at line 30 of file enum_eigen_solver_type.h.

30  {POWER=0,
31  LAPACK,
32  SUBSPACE,
33  ARNOLDI,
34  LANCZOS,
36  // SLEPc optional packages
37  // EPSARPACK,
38  // EPSLAPACK,
39  // EPSBLZPACK,
40  // EPSPLANSO,
41  // EPSTRLAN,
42 

Defines an enum for element quality metrics.

Enumerator
ASPECT_RATIO 
SKEW 
SHEAR 
SHAPE 
MAX_ANGLE 
MIN_ANGLE 
CONDITION 
DISTORTION 
TAPER 
WARP 
STRETCH 
DIAGONAL 
ASPECT_RATIO_BETA 
ASPECT_RATIO_GAMMA 
SIZE 
JACOBIAN 

Definition at line 30 of file enum_elem_quality.h.

Defines an enum for geometric element types.

Enumerator
EDGE2 
EDGE3 
EDGE4 
TRI3 
TRI6 
QUAD4 
QUAD8 
QUAD9 
TET4 
TET10 
HEX8 
HEX20 
HEX27 
PRISM6 
PRISM15 
PRISM18 
PYRAMID5 
PYRAMID13 
PYRAMID14 
INFEDGE2 
INFQUAD4 
INFQUAD6 
INFHEX8 
INFHEX16 
INFHEX18 
INFPRISM6 
INFPRISM12 
NODEELEM 
REMOTEELEM 
TRI3SUBDIVISION 
TRISHELL3 
QUADSHELL4 
QUADSHELL8 
INVALID_ELEM 

Definition at line 30 of file enum_elem_type.h.

30  {EDGE2=0, // 0
31  EDGE3, // 1
32  EDGE4, // 2
33 
34  TRI3, // 3
35  TRI6, // 4
36 
37  QUAD4, // 5
38  QUAD8, // 6
39  QUAD9, // 7
40 
41  TET4, // 8
42  TET10, // 9
43 
44  HEX8, // 10
45  HEX20, // 11
46  HEX27, // 12
47 
48  PRISM6, // 13
49  PRISM15, // 14
50  PRISM18, // 15
51 
52  PYRAMID5, // 16
53  PYRAMID13, // 17
54  PYRAMID14, // 18
55 
56  INFEDGE2, // 19
57 
58  INFQUAD4, // 20
59  INFQUAD6, // 21
60 
61  INFHEX8, // 22
62  INFHEX16, // 23
63  INFHEX18, // 24
64 
65  INFPRISM6, // 25
66  INFPRISM12, // 26
67 
68  NODEELEM, // 27
69 
70  REMOTEELEM, // 28
71 
72  TRI3SUBDIVISION, // 29
73  TRISHELL3, // 30
74  QUADSHELL4, // 31
75  QUADSHELL8, // 32
76 
77  INVALID_ELEM}; // 33 - should always be last

defines an enum for finite element types to libmesh_assert a certain level (or type? Hcurl?) of continuity.

Enumerator
DISCONTINUOUS 
C_ZERO 
C_ONE 
H_CURL 

Definition at line 72 of file enum_fe_family.h.

defines an enum for finite element families.

Enumerator
LAGRANGE 
HIERARCHIC 
MONOMIAL 
L2_HIERARCHIC 
L2_LAGRANGE 
BERNSTEIN 
SZABAB 
XYZ 
INFINITE_MAP 
JACOBI_20_00 
JACOBI_30_00 
LEGENDRE 
CLOUGH 
HERMITE 
SUBDIVISION 
SCALAR 
LAGRANGE_VEC 
NEDELEC_ONE 
INVALID_FE 

Definition at line 32 of file enum_fe_family.h.

32  {LAGRANGE = 0,
33  HIERARCHIC = 1,
34 
35  // discontinuous, in local coordinates
36  MONOMIAL = 2,
37  L2_HIERARCHIC = 6,
38  L2_LAGRANGE = 7,
39 
40  // higher-order
41  BERNSTEIN = 3,
42  SZABAB = 4,
43 
44  // discontinuous, in global coordinates
45  XYZ = 5,
46 
47  // infinite element stuff
48  INFINITE_MAP = 11, // for 1/r-map
49  JACOBI_20_00 = 12, // i_max = 19
50  JACOBI_30_00 = 13, // i_max = 19
51  LEGENDRE = 14, // i_max = 19
52 
53  // C1 elements
54  CLOUGH = 21,
55  HERMITE = 22,
56  SUBDIVISION = 23,
57 
58  // A scalar variable that couples to
59  // all other DOFs in the system
60  SCALAR = 31,
61 
62  // Vector-valued elements
63  LAGRANGE_VEC = 41,
64  NEDELEC_ONE = 42,
65 
66  INVALID_FE = 99};

defines an enum for finite element field types - i.e. is it a scalar element, vector, tensor, etc.

Enumerator
TYPE_SCALAR 
TYPE_VECTOR 

Definition at line 81 of file enum_fe_family.h.

defines an enum for norms defined on vectors of finite element coefficients

Enumerator
L2 
H1 
H2 
HCURL 
HDIV 
L1 
L_INF 
H1_SEMINORM 
H2_SEMINORM 
HCURL_SEMINORM 
HDIV_SEMINORM 
W1_INF_SEMINORM 
W2_INF_SEMINORM 
DISCRETE_L1 
DISCRETE_L2 
DISCRETE_L_INF 
H1_X_SEMINORM 
H1_Y_SEMINORM 
H1_Z_SEMINORM 
INVALID_NORM 

Definition at line 32 of file enum_norm_type.h.

32  {L2 = 0,
33  H1 = 1,
34  H2 = 2,
35  HCURL = 3,
36  HDIV = 4,
37 
38  L1 = 5,
39  L_INF = 6,
40 
41  H1_SEMINORM = 10,
42 
43  H2_SEMINORM = 11,
44 
45  HCURL_SEMINORM = 12,
46 
47  HDIV_SEMINORM = 13,
48 
49  W1_INF_SEMINORM = 15,
50  W2_INF_SEMINORM = 16,
51 
52  // discrete norms on coefficient vectors
53  DISCRETE_L1 = 20,
54  DISCRETE_L2 = 21,
55  DISCRETE_L_INF = 22,
56 
57  // Seminorms based on only individual gradient
58  // directional components
59  H1_X_SEMINORM = 31,
60  H1_Y_SEMINORM = 32,
61  H1_Z_SEMINORM = 33,
62 
63  INVALID_NORM = 42};

defines an enum for the types of coordinate mappings available in infinite elements.

Enumerator
CARTESIAN 
SPHERICAL 
ELLIPSOIDAL 
INVALID_INF_MAP 

Definition at line 31 of file enum_inf_map_type.h.

libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files. These enumerations give an easy way of selecting one or the other.

Enumerator
TECPLOT 
GMV 
GMSH 
VTK 
DIVA 
TETGEN 
UCD 
LIBMESH 
INVALID_IO_PACKAGE 

Definition at line 34 of file enum_io_package.h.

Linear solver convergence flags (taken from the PETSc flags)

Enumerator
CONVERGED_RTOL_NORMAL 
CONVERGED_ATOL_NORMAL 
CONVERGED_RTOL 
CONVERGED_ATOL 
CONVERGED_ITS 
CONVERGED_CG_NEG_CURVE 
CONVERGED_CG_CONSTRAINED 
CONVERGED_STEP_LENGTH 
CONVERGED_HAPPY_BREAKDOWN 
DIVERGED_NULL 
DIVERGED_ITS 
DIVERGED_DTOL 
DIVERGED_BREAKDOWN 
DIVERGED_BREAKDOWN_BICG 
DIVERGED_NONSYMMETRIC 
DIVERGED_INDEFINITE_PC 
DIVERGED_NAN 
DIVERGED_INDEFINITE_MAT 
DIVERGED_PCSETUP_FAILED 
CONVERGED_ITERATING 
UNKNOWN_FLAG 

Definition at line 30 of file enum_convergence_flags.h.

30  {
31  /* converged */
34  CONVERGED_RTOL = 2,
35  CONVERGED_ATOL = 3,
36  CONVERGED_ITS = 4,
41  /* diverged */
42  DIVERGED_NULL = -2,
43  DIVERGED_ITS = -3,
44  DIVERGED_DTOL = -4,
45  DIVERGED_BREAKDOWN = -5,
49  DIVERGED_NAN = -9,
52 
54 
55  UNKNOWN_FLAG = -128};

defines an enum for polynomial orders. Fixing each label to a specific int, since InfFE and p refinement may cast between them

Enumerator
CONSTANT 
FIRST 
SECOND 
THIRD 
FOURTH 
FIFTH 
SIXTH 
SEVENTH 
EIGHTH 
NINTH 
TENTH 
ELEVENTH 
TWELFTH 
THIRTEENTH 
FOURTEENTH 
FIFTEENTH 
SIXTEENTH 
SEVENTEENTH 
EIGHTTEENTH 
NINTEENTH 
NINETEENTH 
TWENTIETH 
TWENTYFIRST 
TWENTYSECOND 
TWENTYTHIRD 
TWENTYFOURTH 
TWENTYFIFTH 
TWENTYSIXTH 
TWENTYSEVENTH 
TWENTYEIGHTH 
TWENTYNINTH 
THIRTIETH 
THIRTYFIRST 
THIRTYSECOND 
THIRTYTHIRD 
THIRTYFOURTH 
THIRTYFIFTH 
THIRTYSIXTH 
THIRTYSEVENTH 
THIRTYEIGHTH 
THIRTYNINTH 
FORTIETH 
FORTYFIRST 
FORTYSECOND 
FORTYTHIRD 
INVALID_ORDER 

Definition at line 32 of file enum_order.h.

32  {CONSTANT = 0,
33  FIRST = 1,
34  SECOND = 2,
35  THIRD = 3,
36  FOURTH = 4,
37  FIFTH = 5,
38  SIXTH = 6,
39  SEVENTH = 7,
40  EIGHTH = 8,
41  NINTH = 9,
42  TENTH = 10,
43 
44  ELEVENTH = 11,
45  TWELFTH = 12,
46  THIRTEENTH = 13,
47  FOURTEENTH = 14,
48  FIFTEENTH = 15,
49  SIXTEENTH = 16,
50  SEVENTEENTH = 17,
51  EIGHTTEENTH = 18,
52  NINTEENTH = 19, // deprecated
53  NINETEENTH = 19,
54  TWENTIETH = 20,
55 
56  TWENTYFIRST = 21,
57  TWENTYSECOND = 22,
58  TWENTYTHIRD = 23,
59  TWENTYFOURTH = 24,
60  TWENTYFIFTH = 25,
61  TWENTYSIXTH = 26,
62  TWENTYSEVENTH = 27,
63  TWENTYEIGHTH = 28,
64  TWENTYNINTH = 29,
65  THIRTIETH = 30,
66 
67  THIRTYFIRST = 31,
68  THIRTYSECOND = 32,
69  THIRTYTHIRD = 33,
70  THIRTYFOURTH = 34,
71  THIRTYFIFTH = 35,
72  THIRTYSIXTH = 36,
73  THIRTYSEVENTH = 37,
74  THIRTYEIGHTH = 38,
75  THIRTYNINTH = 39,
76  FORTIETH = 40,
77 
78  FORTYFIRST = 41,
79  FORTYSECOND = 42,
80  FORTYTHIRD = 43,
81 

Defines an enum for parallel data structure types

Enumerator
AUTOMATIC 
SERIAL 
PARALLEL 
GHOSTED 
INVALID_PARALLELIZATION 

Definition at line 30 of file enum_parallel_type.h.

defines an enum for the types of point locators (given a point with global coordinates, locate the corresponding element in space) available in libMesh.

Enumerator
TREE 
TREE_ELEMENTS 
TREE_LOCAL_ELEMENTS 
INVALID_LOCATOR 

Definition at line 32 of file enum_point_locator_type.h.

Defines an enum for the position of the spectrum, i.e. the eigenvalues to be computed.

Enumerator
LARGEST_MAGNITUDE 
SMALLEST_MAGNITUDE 
TARGET_MAGNITUDE 
LARGEST_REAL 
SMALLEST_REAL 
TARGET_REAL 
LARGEST_IMAGINARY 
SMALLEST_IMAGINARY 
TARGET_IMAGINARY 
INVALID_Postion_of_Spectrum 
INVALID_POSITION_OF_SPECTRUM 

Definition at line 65 of file enum_eigen_solver_type.h.

Defines an enum for preconditioner types

Enumerator
IDENTITY_PRECOND 
JACOBI_PRECOND 
BLOCK_JACOBI_PRECOND 
SOR_PRECOND 
SSOR_PRECOND 
EISENSTAT_PRECOND 
ASM_PRECOND 
CHOLESKY_PRECOND 
ICC_PRECOND 
ILU_PRECOND 
LU_PRECOND 
USER_PRECOND 
SHELL_PRECOND 
AMG_PRECOND 
INVALID_PRECONDITIONER 

Definition at line 30 of file enum_preconditioner_type.h.

Defines an enum for currently available quadrature rules.

Enumerator
QGAUSS 
QJACOBI_1_0 
QJACOBI_2_0 
QSIMPSON 
QTRAP 
QGRID 
QGRUNDMANN_MOLLER 
QMONOMIAL 
QCONICAL 
QGAUSS_LOBATTO 
QCLOUGH 
QCOMPOSITE 
INVALID_Q_RULE 

Definition at line 30 of file enum_quadrature_type.h.

Defines an enum for various linear solver packages. This allows for run-time switching between solver packages

Enumerator
PETSC_SOLVERS 
SLEPC_SOLVERS 
NLOPT_SOLVERS 

Definition at line 32 of file enum_solver_package.h.

Defines an enum for iterative solver types

Enumerator
CG 
CGN 
CGS 
CR 
QMR 
TCQMR 
TFQMR 
BICG 
BICGSTAB 
MINRES 
GMRES 
LSQR 
JACOBI 
SOR_FORWARD 
SOR_BACKWARD 
SSOR 
RICHARDSON 
CHEBYSHEV 
SPARSELU 
INVALID_SOLVER 

Definition at line 30 of file enum_solver_type.h.

defines an enum for the question what happens to the dofs outside the given subset when a system is solved on a subset.

Enumerator
SUBSET_ZERO 

Set dofs outside the subset to zero.

SUBSET_COPY_RHS 

Set dofs outside the subset to the value of the corresponding dofs of the right hand side.

SUBSET_DONT_TOUCH 

Leaves dofs outside the subset unchanged. This is fastest, but also most confusing because it abandons the property that the solution vector is (theoretically) independent of the initial guess.

Definition at line 32 of file enum_subset_solve_mode.h.

32  {
33  SUBSET_ZERO = 0,
36 };
Leaves dofs outside the subset unchanged. This is fastest, but also most confusing because it abandon...
Set dofs outside the subset to zero.
Set dofs outside the subset to the value of the corresponding dofs of the right hand side...

Dirichlet functions may be indexed either by "system variable order" or "local variable order", depending on how the DirichletBoundary object is constructed. For example, suppose a system has variables {a, b, c, d}, and a DirichletBoundary is set for variables {b, d} (i.e. variables_in is {1, 3}). If the boundary is constructed to use "system variable order", input function(s) will be queried for components 1 and 3; this is useful for reusing input functions as both exact solutions and Dirichlet boundaries in benchmark problems. If the boundary is constructed to use "local variable order", input function(s) will be queried for components 0 and 1; this is useful for flexibly constructing Dirichlet boundaries in multiphysics codes or from user input files.

Enumerator
SYSTEM_VARIABLE_ORDER 
LOCAL_VARIABLE_ORDER 

Definition at line 62 of file dirichlet_boundaries.h.

Defines an enum for read/write mode in Xdr format. READ, WRITE perform reading and writing in ASCII format, and DECODE, ENCODE do the same in binary format.

Enumerator
UNKNOWN 
ENCODE 
DECODE 
WRITE 
READ 

Definition at line 32 of file enum_xdr_mode.h.

Function Documentation

void libMesh::__libmesh_nlopt_equality_constraints ( unsigned  m,
double *  result,
unsigned  n,
const double *  x,
double *  gradient,
void *  data 
)

Definition at line 109 of file nlopt_optimization_solver.C.

References data, libMesh::OptimizationSystem::ComputeEqualityConstraints::equality_constraints(), libMesh::OptimizationSystem::ComputeEqualityConstraintsJacobian::equality_constraints_jacobian(), libMesh::OptimizationSolver< T >::equality_constraints_jacobian_object, libMesh::OptimizationSolver< T >::equality_constraints_object, and libMesh::OptimizationSolver< T >::system().

115 {
116  LOG_SCOPE("equality_constraints()", "NloptOptimizationSolver");
117 
118  libmesh_assert(data);
119 
120  // data should be a pointer to the solver (it was passed in as void *)
121  NloptOptimizationSolver<Number> * solver =
122  static_cast<NloptOptimizationSolver<Number> *> (data);
123 
124  OptimizationSystem & sys = solver->system();
125 
126  // We'll use current_local_solution below, so let's ensure that it's consistent
127  // with the vector x that was passed in.
128  if (sys.solution->size() != n)
129  libmesh_error_msg("Error: Input vector x has different length than sys.solution!");
130 
131  for (unsigned int i=sys.solution->first_local_index(); i<sys.solution->last_local_index(); i++)
132  sys.solution->set(i, x[i]);
133  sys.solution->close();
134 
135  // Impose constraints on the solution vector
136  sys.get_dof_map().enforce_constraints_exactly(sys);
137 
138  // Update sys.current_local_solution based on the solution vector
139  sys.update();
140 
141  // Call the user's equality constraints function if there is one.
142  OptimizationSystem::ComputeEqualityConstraints * eco = solver->equality_constraints_object;
143  if (eco)
144  {
145  eco->equality_constraints(*sys.current_local_solution,
146  *sys.C_eq,
147  sys);
148 
149  sys.C_eq->close();
150 
151  // Copy the values out of eq_constraints into 'result'.
152  // TODO: Even better would be if we could use 'result' directly
153  // as the storage of eq_constraints. Perhaps a serial-only
154  // NumericVector variant which supports this option?
155  for (unsigned i=0; i<m; ++i)
156  result[i] = (*sys.C_eq)(i);
157 
158  // If gradient != NULL, then the Jacobian matrix of the equality
159  // constraints has been requested. The incoming 'gradient'
160  // array is of length m*n and d(c_i)/d(x_j) = gradient[n*i+j].
161  if (gradient)
162  {
163  OptimizationSystem::ComputeEqualityConstraintsJacobian * eco_jac =
164  solver->equality_constraints_jacobian_object;
165 
166  if (eco_jac)
167  {
168  eco_jac->equality_constraints_jacobian(*sys.current_local_solution,
169  *sys.C_eq_jac,
170  sys);
171 
172  sys.C_eq_jac->close();
173 
174  // copy the Jacobian data to the gradient array
175  for (numeric_index_type i=0; i<m; i++)
176  {
177  std::set<numeric_index_type>::iterator it = sys.eq_constraint_jac_sparsity[i].begin();
178  std::set<numeric_index_type>::iterator it_end = sys.eq_constraint_jac_sparsity[i].end();
179  for ( ; it != it_end; ++it)
180  {
181  numeric_index_type dof_index = *it;
182  gradient[n*i+dof_index] = (*sys.C_eq_jac)(i,dof_index);
183  }
184  }
185  }
186  else
187  libmesh_error_msg("Jacobian function not defined in __libmesh_nlopt_equality_constraints");
188  }
189 
190  }
191  else
192  libmesh_error_msg("Constraints function not defined in __libmesh_nlopt_equality_constraints");
193 }
dof_id_type numeric_index_type
Definition: id_types.h:92
IterBase * data
void libMesh::__libmesh_nlopt_inequality_constraints ( unsigned  m,
double *  result,
unsigned  n,
const double *  x,
double *  gradient,
void *  data 
)

Definition at line 196 of file nlopt_optimization_solver.C.

References data, libMesh::OptimizationSystem::ComputeInequalityConstraints::inequality_constraints(), libMesh::OptimizationSystem::ComputeInequalityConstraintsJacobian::inequality_constraints_jacobian(), libMesh::OptimizationSolver< T >::inequality_constraints_jacobian_object, libMesh::OptimizationSolver< T >::inequality_constraints_object, and libMesh::OptimizationSolver< T >::system().

202 {
203  LOG_SCOPE("inequality_constraints()", "NloptOptimizationSolver");
204 
205  libmesh_assert(data);
206 
207  // data should be a pointer to the solver (it was passed in as void *)
208  NloptOptimizationSolver<Number> * solver =
209  static_cast<NloptOptimizationSolver<Number> *> (data);
210 
211  OptimizationSystem & sys = solver->system();
212 
213  // We'll use current_local_solution below, so let's ensure that it's consistent
214  // with the vector x that was passed in.
215  if (sys.solution->size() != n)
216  libmesh_error_msg("Error: Input vector x has different length than sys.solution!");
217 
218  for (unsigned int i=sys.solution->first_local_index(); i<sys.solution->last_local_index(); i++)
219  sys.solution->set(i, x[i]);
220  sys.solution->close();
221 
222  // Impose constraints on the solution vector
223  sys.get_dof_map().enforce_constraints_exactly(sys);
224 
225  // Update sys.current_local_solution based on the solution vector
226  sys.update();
227 
228  // Call the user's inequality constraints function if there is one.
229  OptimizationSystem::ComputeInequalityConstraints * ineco = solver->inequality_constraints_object;
230  if (ineco)
231  {
232  ineco->inequality_constraints(*sys.current_local_solution,
233  *sys.C_ineq,
234  sys);
235 
236  sys.C_ineq->close();
237 
238  // Copy the values out of ineq_constraints into 'result'.
239  // TODO: Even better would be if we could use 'result' directly
240  // as the storage of ineq_constraints. Perhaps a serial-only
241  // NumericVector variant which supports this option?
242  for (unsigned i=0; i<m; ++i)
243  result[i] = (*sys.C_ineq)(i);
244 
245  // If gradient != NULL, then the Jacobian matrix of the equality
246  // constraints has been requested. The incoming 'gradient'
247  // array is of length m*n and d(c_i)/d(x_j) = gradient[n*i+j].
248  if (gradient)
249  {
250  OptimizationSystem::ComputeInequalityConstraintsJacobian * ineco_jac =
251  solver->inequality_constraints_jacobian_object;
252 
253  if (ineco_jac)
254  {
255  ineco_jac->inequality_constraints_jacobian(*sys.current_local_solution,
256  *sys.C_ineq_jac,
257  sys);
258 
259  sys.C_ineq_jac->close();
260 
261  // copy the Jacobian data to the gradient array
262  for (numeric_index_type i=0; i<m; i++)
263  {
264  std::set<numeric_index_type>::iterator it = sys.ineq_constraint_jac_sparsity[i].begin();
265  std::set<numeric_index_type>::iterator it_end = sys.ineq_constraint_jac_sparsity[i].end();
266  for ( ; it != it_end; ++it)
267  {
268  numeric_index_type dof_index = *it;
269  gradient[n*i+dof_index] = (*sys.C_ineq_jac)(i,dof_index);
270  }
271  }
272  }
273  else
274  libmesh_error_msg("Jacobian function not defined in __libmesh_nlopt_inequality_constraints");
275  }
276 
277  }
278  else
279  libmesh_error_msg("Constraints function not defined in __libmesh_nlopt_inequality_constraints");
280 }
dof_id_type numeric_index_type
Definition: id_types.h:92
IterBase * data
double libMesh::__libmesh_nlopt_objective ( unsigned  n,
const double *  x,
double *  gradient,
void *  data 
)

Definition at line 36 of file nlopt_optimization_solver.C.

References data, libMesh::NloptOptimizationSolver< T >::get_iteration_count(), libMesh::OptimizationSystem::ComputeGradient::gradient(), libMesh::OptimizationSolver< T >::gradient_object, libmesh_nullptr, libMesh::OptimizationSystem::ComputeObjective::objective(), libMesh::OptimizationSolver< T >::objective_object, out, Real, libMesh::OptimizationSolver< T >::system(), and libMesh::OptimizationSolver< T >::verbose.

40 {
41  LOG_SCOPE("objective()", "NloptOptimizationSolver");
42 
43  // ctx should be a pointer to the solver (it was passed in as void *)
44  NloptOptimizationSolver<Number> * solver =
45  static_cast<NloptOptimizationSolver<Number> *> (data);
46 
47  OptimizationSystem & sys = solver->system();
48 
49  // We'll use current_local_solution below, so let's ensure that it's consistent
50  // with the vector x that was passed in.
51  for (unsigned int i=sys.solution->first_local_index();
52  i<sys.solution->last_local_index(); i++)
53  sys.solution->set(i, x[i]);
54 
55  // Make sure the solution vector is parallel-consistent
56  sys.solution->close();
57 
58  // Impose constraints on X
59  sys.get_dof_map().enforce_constraints_exactly(sys);
60 
61  // Update sys.current_local_solution based on X
62  sys.update();
63 
64  Real objective;
65  if (solver->objective_object != libmesh_nullptr)
66  {
67  objective =
68  solver->objective_object->objective(
69  *(sys.current_local_solution), sys);
70  }
71  else
72  {
73  libmesh_error_msg("Objective function not defined in __libmesh_nlopt_objective");
74  }
75 
76  // If the gradient has been requested, fill it in
77  if (gradient)
78  {
79  if (solver->gradient_object != libmesh_nullptr)
80  {
81  solver->gradient_object->gradient(
82  *(sys.current_local_solution), *(sys.rhs), sys);
83 
84  // we've filled up sys.rhs with the gradient data, now copy it
85  // to the nlopt data structure
86  libmesh_assert(sys.rhs->size() == n);
87 
88  std::vector<double> grad;
89  sys.rhs->localize_to_one(grad);
90  for (unsigned i=0; i<n; ++i)
91  gradient[i] = grad[i];
92  }
93  else
94  libmesh_error_msg("Gradient function not defined in __libmesh_nlopt_objective");
95  }
96 
97  // Increment the iteration count.
98  solver->get_iteration_count()++;
99 
100  // Possibly print the current value of the objective function
101  if (solver->verbose)
102  libMesh::out << objective << std::endl;
103 
104  return objective;
105 }
const class libmesh_nullptr_t libmesh_nullptr
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IterBase * data
OStreamProxy out(std::cout)
PetscErrorCode libMesh::__libmesh_petsc_diff_solver_jacobian ( SNES  ,
Vec  x,
#if   PETSC_RELEASE_LESS_THAN3, 5, 0) Mat *libmesh_dbg_var(j,
Mat *  pc,
MatStructure *  msflag,
#else Mat   libmesh_dbg_varj,
Mat  pc,
#endif void *  ctx 
)

Definition at line 132 of file petsc_diff_solver.C.

References libMesh::ImplicitSystem::assembly(), libMesh::ParallelObject::comm(), libMesh::System::current_local_solution, libMesh::DofMap::enforce_constraints_exactly(), libMesh::System::get_dof_map(), libMesh::ImplicitSystem::matrix, out, libMesh::System::solution, libMesh::PetscMatrix< T >::swap(), libMesh::DiffSolver::system(), libMesh::System::update(), and libMesh::DiffSolver::verbose.

Referenced by libMesh::PetscDiffSolver::solve().

143  {
144  libmesh_assert(x);
145  libmesh_assert(j);
146  // libmesh_assert_equal_to (pc, j); // We don't use separate preconditioners yet
147  libmesh_assert(ctx);
148 
149  PetscDiffSolver & solver =
150  *(static_cast<PetscDiffSolver*> (ctx));
151  ImplicitSystem & sys = solver.system();
152 
153  if (solver.verbose)
154  libMesh::out << "Assembling the Jacobian" << std::endl;
155 
156  PetscVector<Number> & X_system =
157  *cast_ptr<PetscVector<Number> *>(sys.solution.get());
158  PetscVector<Number> X_input(x, sys.comm());
159 
160 #if PETSC_RELEASE_LESS_THAN(3,5,0)
161  PetscMatrix<Number> J_input(*pc, sys.comm());
162 #else
163  PetscMatrix<Number> J_input(pc, sys.comm());
164 #endif
165  PetscMatrix<Number> & J_system =
166  *cast_ptr<PetscMatrix<Number> *>(sys.matrix);
167 
168  // DiffSystem assembles from the solution and into the jacobian, so
169  // swap those with our input vectors before assembling. They'll
170  // probably already be references to the same vectors, but PETSc
171  // might do something tricky.
172  X_input.swap(X_system);
173  J_input.swap(J_system);
174 
175  // We may need to localize a parallel solution
176  sys.update();
177 
178  // We may need to correct a non-conforming solution
179  sys.get_dof_map().enforce_constraints_exactly(sys, sys.current_local_solution.get());
180 
181  // Do DiffSystem assembly
182  sys.assembly(false, true);
183  J_system.close();
184 
185  // Swap back
186  X_input.swap(X_system);
187  J_input.swap(J_system);
188 
189 #if PETSC_RELEASE_LESS_THAN(3,5,0)
190  *msflag = SAME_NONZERO_PATTERN;
191 #endif
192  // No errors, we hope
193  return 0;
194  }
OStreamProxy out(std::cout)
PetscErrorCode libMesh::__libmesh_petsc_diff_solver_monitor ( SNES  snes,
PetscInt  its,
PetscReal  fnorm,
void *  ctx 
)

Definition at line 43 of file petsc_diff_solver.C.

References libMesh::PetscVector< T >::close(), libMesh::ParallelObject::comm(), libMesh::Parallel::Communicator::get(), ierr, libmesh_nullptr, libMesh::DiffSolver::linear_solution_monitor, out, and libMesh::DiffSolver::verbose.

Referenced by libMesh::PetscDiffSolver::setup_petsc_data().

47  {
48  PetscDiffSolver & solver =
49  *(static_cast<PetscDiffSolver *> (ctx));
50 
51  if (solver.verbose)
52  libMesh::out << " PetscDiffSolver step " << its
53  << ", |residual|_2 = " << fnorm << std::endl;
54  if (solver.linear_solution_monitor.get()) {
55  int ierr = 0;
56 
57  Vec petsc_delta_u;
58  ierr = SNESGetSolutionUpdate(snes, &petsc_delta_u);
59  CHKERRABORT(solver.comm().get(), ierr);
60  PetscVector<Number> delta_u(petsc_delta_u, solver.comm());
61  delta_u.close();
62 
63  Vec petsc_u;
64  ierr = SNESGetSolution(snes, &petsc_u);
65  CHKERRABORT(solver.comm().get(), ierr);
66  PetscVector<Number> u(petsc_u, solver.comm());
67  u.close();
68 
69  Vec petsc_res;
70  ierr = SNESGetFunction(snes, &petsc_res, libmesh_nullptr, libmesh_nullptr);
71  CHKERRABORT(solver.comm().get(), ierr);
72  PetscVector<Number> res(petsc_res, solver.comm());
73  res.close();
74 
75  (*solver.linear_solution_monitor)(
76  delta_u, delta_u.l2_norm(),
77  u, u.l2_norm(),
78  res, res.l2_norm(), its);
79  }
80  return 0;
81  }
const class libmesh_nullptr_t libmesh_nullptr
PetscErrorCode ierr
OStreamProxy out(std::cout)
PetscErrorCode libMesh::__libmesh_petsc_diff_solver_residual ( SNES  ,
Vec  x,
Vec  r,
void *  ctx 
)

Definition at line 86 of file petsc_diff_solver.C.

References libMesh::ImplicitSystem::assembly(), libMesh::ParallelObject::comm(), libMesh::System::current_local_solution, libMesh::DofMap::enforce_constraints_exactly(), libMesh::System::get_dof_map(), out, libMesh::ExplicitSystem::rhs, libMesh::System::solution, libMesh::PetscVector< T >::swap(), libMesh::DiffSolver::system(), libMesh::System::update(), and libMesh::DiffSolver::verbose.

Referenced by libMesh::PetscDiffSolver::solve().

87  {
88  libmesh_assert(x);
89  libmesh_assert(r);
90  libmesh_assert(ctx);
91 
92  PetscDiffSolver & solver =
93  *(static_cast<PetscDiffSolver*> (ctx));
94  ImplicitSystem & sys = solver.system();
95 
96  if (solver.verbose)
97  libMesh::out << "Assembling the residual" << std::endl;
98 
99  PetscVector<Number> & X_system =
100  *cast_ptr<PetscVector<Number> *>(sys.solution.get());
101  PetscVector<Number> & R_system =
102  *cast_ptr<PetscVector<Number> *>(sys.rhs);
103  PetscVector<Number> X_input(x, sys.comm()), R_input(r, sys.comm());
104 
105  // DiffSystem assembles from the solution and into the rhs, so swap
106  // those with our input vectors before assembling. They'll probably
107  // already be references to the same vectors, but PETSc might do
108  // something tricky.
109  X_input.swap(X_system);
110  R_input.swap(R_system);
111 
112  // We may need to localize a parallel solution
113  sys.update();
114 
115  // We may need to correct a non-conforming solution
116  sys.get_dof_map().enforce_constraints_exactly(sys, sys.current_local_solution.get());
117 
118  // Do DiffSystem assembly
119  sys.assembly(true, false);
120  R_system.close();
121 
122  // Swap back
123  X_input.swap(X_system);
124  R_input.swap(R_system);
125 
126  // No errors, we hope
127  return 0;
128  }
OStreamProxy out(std::cout)
PetscErrorCode libMesh::__libmesh_petsc_preconditioner_apply ( void *  ctx,
Vec  x,
Vec  y 
)

This function is called by PETSc to actually apply the preconditioner. ctx will hold the Preconditioner.

Definition at line 58 of file petsc_linear_solver.C.

Referenced by libMesh::PetscNonlinearSolver< T >::init(), and libMesh::PetscLinearSolver< T >::init().

59  {
60  Preconditioner<Number> * preconditioner = static_cast<Preconditioner<Number> *>(ctx);
61 
62  PetscVector<Number> x_vec(x, preconditioner->comm());
63  PetscVector<Number> y_vec(y, preconditioner->comm());
64 
65  preconditioner->apply(x_vec,y_vec);
66 
67  return 0;
68  }
PetscErrorCode libMesh::__libmesh_petsc_preconditioner_apply ( PC  pc,
Vec  x,
Vec  y 
)

Definition at line 84 of file petsc_linear_solver.C.

References CHKERRQ(), and ierr.

85  {
86  void * ctx;
87  PetscErrorCode ierr = PCShellGetContext(pc,&ctx);CHKERRQ(ierr);
88  Preconditioner<Number> * preconditioner = static_cast<Preconditioner<Number> *>(ctx);
89 
90  PetscVector<Number> x_vec(x, preconditioner->comm());
91  PetscVector<Number> y_vec(y, preconditioner->comm());
92 
93  preconditioner->apply(x_vec,y_vec);
94 
95  return 0;
96  }
PetscErrorCode ierr
CHKERRQ(ierr)
PetscErrorCode libMesh::__libmesh_petsc_preconditioner_setup ( void *  ctx)

This function is called by PETSc to initialize the preconditioner. ctx will hold the Preconditioner.

Definition at line 45 of file petsc_linear_solver.C.

Referenced by libMesh::PetscNonlinearSolver< T >::init(), and libMesh::PetscLinearSolver< T >::init().

46  {
47  Preconditioner<Number> * preconditioner = static_cast<Preconditioner<Number> *>(ctx);
48 
49  if (!preconditioner->initialized())
50  libmesh_error_msg("Preconditioner not initialized! Make sure you call init() before solve!");
51 
52  preconditioner->setup();
53 
54  return 0;
55  }
PetscErrorCode libMesh::__libmesh_petsc_preconditioner_setup ( PC  pc)

Definition at line 70 of file petsc_linear_solver.C.

References CHKERRQ(), and ierr.

71  {
72  void * ctx;
73  PetscErrorCode ierr = PCShellGetContext(pc,&ctx);CHKERRQ(ierr);
74  Preconditioner<Number> * preconditioner = static_cast<Preconditioner<Number> *>(ctx);
75 
76  if (!preconditioner->initialized())
77  libmesh_error_msg("Preconditioner not initialized! Make sure you call init() before solve!");
78 
79  preconditioner->setup();
80 
81  return 0;
82  }
PetscErrorCode ierr
CHKERRQ(ierr)
PetscErrorCode libMesh::__libmesh_petsc_snes_fd_residual ( SNES  snes,
Vec  x,
Vec  r,
void *  ctx 
)

Definition at line 178 of file petsc_nonlinear_solver.C.

References libMesh::PetscNonlinearSolver< T >::_zero_out_residual, libMesh::ParallelObject::comm(), libMesh::System::current_local_solution, libMesh::NonlinearSolver< T >::fd_residual_object, libMesh::ResidualContext::ierr, libmesh_nullptr, libmesh_petsc_snes_residual_helper(), libMesh::NonlinearImplicitSystem::ComputeResidual::residual(), libMesh::NonlinearSolver< T >::residual_object, libMesh::ResidualContext::solver, libMesh::ResidualContext::sys, and libMesh::PetscVector< T >::zero().

179  {
180  ResidualContext rc = libmesh_petsc_snes_residual_helper(snes, x, ctx);
181 
182  libmesh_assert(r);
183  PetscVector<Number> R(r, rc.sys.comm());
184 
185  if (rc.solver->_zero_out_residual)
186  R.zero();
187 
188  if (rc.solver->fd_residual_object != libmesh_nullptr)
189  rc.solver->fd_residual_object->residual(*rc.sys.current_local_solution.get(), R, rc.sys);
190 
191  else if (rc.solver->residual_object != libmesh_nullptr)
192  rc.solver->residual_object->residual(*rc.sys.current_local_solution.get(), R, rc.sys);
193 
194  else
195  libmesh_error_msg("Error! Unable to compute residual for forming finite difference Jacobian!");
196 
197  R.close();
198 
199  return rc.ierr;
200  }
const class libmesh_nullptr_t libmesh_nullptr
ResidualContext libmesh_petsc_snes_residual_helper(SNES snes, Vec x, void *ctx)
PetscErrorCode libMesh::__libmesh_petsc_snes_jacobian ( SNES  ,
Vec  x,
Mat *  jac,
Mat *  pc,
MatStructure *  msflag,
void *  ctx 
)
PetscErrorCode libMesh::__libmesh_petsc_snes_jacobian ( SNES  ,
Vec  x,
Mat  jac,
Mat  pc,
void *  ctx 
)
PetscErrorCode libMesh::__libmesh_petsc_snes_jacobian ( #if PETSC_RELEASE_LESS_THAN(3, 5, 0) SNES  snes,
Vec  x,
Mat *  jac,
Mat *  pc,
MatStructure *  msflag,
void *ctx#else SNES  snes,
Vec  x,
Mat  jac,
Mat  pc,
void *ctx#  endif 
)

Definition at line 250 of file petsc_nonlinear_solver.C.

References libMesh::PetscNonlinearSolver< T >::_current_nonlinear_iteration_number, libMesh::PetscNonlinearSolver< T >::_zero_out_jacobian, libMesh::ParallelObject::comm(), libMesh::Parallel::Communicator::get(), libMesh::ResidualContext::ierr, libMesh::NonlinearImplicitSystem::ComputeJacobian::jacobian(), libMesh::NonlinearSolver< T >::jacobian, libMesh::NonlinearSolver< T >::jacobian_object, libmesh_nullptr, libMesh::NonlinearSolver< T >::matvec, libMesh::NonlinearImplicitSystem::ComputeResidualandJacobian::residual_and_jacobian(), libMesh::NonlinearSolver< T >::residual_and_jacobian_object, libMesh::ResidualContext::solver, libMesh::PetscVector< T >::swap(), libMesh::ResidualContext::sys, and libMesh::NonlinearSolver< T >::system().

257  {
258  LOG_SCOPE("jacobian()", "PetscNonlinearSolver");
259 
260  PetscErrorCode ierr=0;
261 
262  libmesh_assert(ctx);
263 
264  // No way to safety-check this cast, since we got a void *...
265  PetscNonlinearSolver<Number> * solver =
266  static_cast<PetscNonlinearSolver<Number> *> (ctx);
267 
268  // Get the current iteration number from the snes object,
269  // store it in the PetscNonlinearSolver object for possible use
270  // by the user's Jacobian function.
271  {
272  PetscInt n_iterations = 0;
273  ierr = SNESGetIterationNumber(snes, &n_iterations);
274  CHKERRABORT(solver->comm().get(),ierr);
275  solver->_current_nonlinear_iteration_number = cast_int<unsigned>(n_iterations);
276  }
277 
278  NonlinearImplicitSystem & sys = solver->system();
279 #if PETSC_RELEASE_LESS_THAN(3,5,0)
280  PetscMatrix<Number> PC(*pc, sys.comm());
281  PetscMatrix<Number> Jac(*jac, sys.comm());
282 #else
283  PetscMatrix<Number> PC(pc, sys.comm());
284  PetscMatrix<Number> Jac(jac, sys.comm());
285 #endif
286  PetscVector<Number> & X_sys = *cast_ptr<PetscVector<Number> *>(sys.solution.get());
287  PetscVector<Number> X_global(x, sys.comm());
288 
289  // Set the dof maps
290  PC.attach_dof_map(sys.get_dof_map());
291  Jac.attach_dof_map(sys.get_dof_map());
292 
293  // Use the systems update() to get a good local version of the parallel solution
294  X_global.swap(X_sys);
295  sys.update();
296  X_global.swap(X_sys);
297 
298  // Enforce constraints (if any) exactly on the
299  // current_local_solution. This is the solution vector that is
300  // actually used in the computation of the residual below, and is
301  // not locked by debug-enabled PETSc the way that "x" is.
302  sys.get_dof_map().enforce_constraints_exactly(sys, sys.current_local_solution.get());
303 
304  if (solver->_zero_out_jacobian)
305  PC.zero();
306 
307  //-----------------------------------------------------------------------------
308  // if the user has provided both function pointers and objects only the pointer
309  // will be used, so catch that as an error
310  if (solver->jacobian && solver->jacobian_object)
311  libmesh_error_msg("ERROR: cannot specify both a function and object to compute the Jacobian!");
312 
313  if (solver->matvec && solver->residual_and_jacobian_object)
314  libmesh_error_msg("ERROR: cannot specify both a function and object to compute the combined Residual & Jacobian!");
315 
316  if (solver->jacobian != libmesh_nullptr)
317  solver->jacobian(*sys.current_local_solution.get(), PC, sys);
318 
319  else if (solver->jacobian_object != libmesh_nullptr)
320  solver->jacobian_object->jacobian(*sys.current_local_solution.get(), PC, sys);
321 
322  else if (solver->matvec != libmesh_nullptr)
323  solver->matvec(*sys.current_local_solution.get(), libmesh_nullptr, &PC, sys);
324 
325  else if (solver->residual_and_jacobian_object != libmesh_nullptr)
326  solver->residual_and_jacobian_object->residual_and_jacobian (*sys.current_local_solution.get(), libmesh_nullptr, &PC, sys);
327 
328  else
329  libmesh_error_msg("Error! Unable to compute residual and/or Jacobian!");
330 
331  PC.close();
332  Jac.close();
333 #if PETSC_RELEASE_LESS_THAN(3,5,0)
334  *msflag = SAME_NONZERO_PATTERN;
335 #endif
336 
337  return ierr;
338  }
const class libmesh_nullptr_t libmesh_nullptr
PetscErrorCode ierr
PetscErrorCode libMesh::__libmesh_petsc_snes_mffd_interface ( void *  ctx,
Vec  x,
Vec  r 
)

Definition at line 207 of file petsc_nonlinear_solver.C.

References __libmesh_petsc_snes_mffd_residual(), libMesh::ResidualContext::ierr, libMesh::PetscNonlinearSolver< T >::snes(), and libMesh::ResidualContext::solver.

208  {
209  PetscErrorCode ierr = 0;
210  // No way to safety-check this cast, since we got a void *...
211  PetscNonlinearSolver<Number> * solver =
212  static_cast<PetscNonlinearSolver<Number> *> (ctx);
213 
214  ierr = __libmesh_petsc_snes_mffd_residual(solver->snes(), x, r, ctx);
215  return ierr;
216  }
PetscErrorCode __libmesh_petsc_snes_mffd_residual(SNES snes, Vec x, Vec r, void *ctx)
PetscErrorCode ierr
PetscErrorCode libMesh::__libmesh_petsc_snes_mffd_residual ( SNES  snes,
Vec  x,
Vec  r,
void *  ctx 
)

Definition at line 222 of file petsc_nonlinear_solver.C.

References libMesh::PetscNonlinearSolver< T >::_zero_out_residual, libMesh::ParallelObject::comm(), libMesh::System::current_local_solution, libMesh::ResidualContext::ierr, libmesh_nullptr, libmesh_petsc_snes_residual_helper(), libMesh::NonlinearSolver< T >::mffd_residual_object, libMesh::NonlinearImplicitSystem::ComputeResidual::residual(), libMesh::NonlinearSolver< T >::residual_object, libMesh::ResidualContext::solver, libMesh::ResidualContext::sys, and libMesh::PetscVector< T >::zero().

Referenced by __libmesh_petsc_snes_mffd_interface().

223  {
224  ResidualContext rc = libmesh_petsc_snes_residual_helper(snes, x, ctx);
225 
226  libmesh_assert(r);
227  PetscVector<Number> R(r, rc.sys.comm());
228 
229  if (rc.solver->_zero_out_residual)
230  R.zero();
231 
232  if (rc.solver->mffd_residual_object != libmesh_nullptr)
233  rc.solver->mffd_residual_object->residual(*rc.sys.current_local_solution.get(), R, rc.sys);
234 
235  else if (rc.solver->residual_object != libmesh_nullptr)
236  rc.solver->residual_object->residual(*rc.sys.current_local_solution.get(), R, rc.sys);
237 
238  else
239  libmesh_error_msg("Error! Unable to compute residual for forming finite differenced"
240  "Jacobian-vector products!");
241 
242  R.close();
243 
244  return rc.ierr;
245  }
const class libmesh_nullptr_t libmesh_nullptr
ResidualContext libmesh_petsc_snes_residual_helper(SNES snes, Vec x, void *ctx)
PetscErrorCode libMesh::__libmesh_petsc_snes_monitor ( SNES  ,
PetscInt  its,
PetscReal  fnorm,
void *   
)

Definition at line 116 of file petsc_nonlinear_solver.C.

References out.

Referenced by libMesh::PetscNonlinearSolver< T >::init().

117  {
118  //PetscErrorCode ierr=0;
119 
120  //if (its > 0)
121  libMesh::out << " NL step "
122  << std::setw(2) << its
123  << std::scientific
124  << ", |residual|_2 = " << fnorm
125  << std::endl;
126 
127  //return ierr;
128  return 0;
129  }
OStreamProxy out(std::cout)
PetscErrorCode libMesh::__libmesh_petsc_snes_postcheck ( #if PETSC_VERSION_LESS_THAN(3, 3, 0)  SNES,
Vec  x,
Vec  y,
Vec  w,
void *  context,
PetscBool changed_y,
PetscBool *changed_w#else  SNESLineSearch,
Vec  x,
Vec  y,
Vec  w,
PetscBool changed_y,
PetscBool changed_w,
void *context#  endif 
)

Definition at line 350 of file petsc_nonlinear_solver.C.

References libMesh::ParallelObject::comm(), libMesh::DofMap::enforce_constraints_exactly(), libMesh::System::get_dof_map(), libMesh::ResidualContext::ierr, libMesh::DofMap::n_constrained_dofs(), libMesh::NonlinearImplicitSystem::ComputePostCheck::postcheck(), libMesh::NonlinearSolver< T >::postcheck, libMesh::NonlinearSolver< T >::postcheck_object, libMesh::System::solution, libMesh::ResidualContext::solver, libMesh::PetscVector< T >::swap(), libMesh::ResidualContext::sys, and libMesh::NonlinearSolver< T >::system().

Referenced by libMesh::PetscNonlinearSolver< T >::init().

357  {
358  LOG_SCOPE("postcheck()", "PetscNonlinearSolver");
359 
360  PetscErrorCode ierr = 0;
361 
362  // PETSc almost certainly initializes these to false already, but
363  // it doesn't hurt to be explicit.
364  *changed_w = PETSC_FALSE;
365  *changed_y = PETSC_FALSE;
366 
367  libmesh_assert(context);
368 
369  // Cast the context to a NonlinearSolver object.
370  PetscNonlinearSolver<Number> * solver =
371  static_cast<PetscNonlinearSolver<Number> *> (context);
372 
373  // If the user has provided both postcheck function pointer and
374  // object, this is ambiguous, so throw an error.
375  if (solver->postcheck && solver->postcheck_object)
376  libmesh_error_msg("ERROR: cannot specify both a function and object for performing the solve postcheck!");
377 
378  // It's also possible that we don't need to do anything at all, in
379  // that case return early...
380  NonlinearImplicitSystem & sys = solver->system();
381  DofMap & dof_map = sys.get_dof_map();
382 
383  if (!dof_map.n_constrained_dofs() && !solver->postcheck && !solver->postcheck_object)
384  return ierr;
385 
386  // We definitely need to wrap at least "w"
387  PetscVector<Number> petsc_w(w, sys.comm());
388 
389  // The user sets these flags in his/her postcheck function to
390  // indicate whether they changed something.
391  bool
392  changed_search_direction = false,
393  changed_new_soln = false;
394 
395  if (solver->postcheck || solver->postcheck_object)
396  {
397  PetscVector<Number> petsc_x(x, sys.comm());
398  PetscVector<Number> petsc_y(y, sys.comm());
399 
400  if (solver->postcheck)
401  solver->postcheck(petsc_x,
402  petsc_y,
403  petsc_w,
404  changed_search_direction,
405  changed_new_soln,
406  sys);
407 
408  else if (solver->postcheck_object)
409  solver->postcheck_object->postcheck(petsc_x,
410  petsc_y,
411  petsc_w,
412  changed_search_direction,
413  changed_new_soln,
414  sys);
415  }
416 
417  // Record whether the user changed the solution or the search direction.
418  if (changed_search_direction)
419  *changed_y = PETSC_TRUE;
420 
421  if (changed_new_soln)
422  *changed_w = PETSC_TRUE;
423 
424  if (dof_map.n_constrained_dofs())
425  {
426  PetscVector<Number> & system_soln = *cast_ptr<PetscVector<Number> *>(sys.solution.get());
427 
428  // ... and swap it in before enforcing the constraints.
429  petsc_w.swap(system_soln);
430 
431  dof_map.enforce_constraints_exactly(sys);
432 
433  // If we have constraints, we'll assume that we did change the
434  // solution w (hopefully slightly). Enforcing constraints
435  // does not change the search direction, y, but the user may
436  // have, so we leave it alone.
437  *changed_w = PETSC_TRUE;
438 
439  // Swap back
440  petsc_w.swap(system_soln);
441  }
442 
443  return ierr;
444  }
PetscErrorCode ierr
PetscErrorCode libMesh::__libmesh_petsc_snes_residual ( SNES  snes,
Vec  x,
Vec  r,
void *  ctx 
)

Definition at line 136 of file petsc_nonlinear_solver.C.

References libMesh::PetscNonlinearSolver< T >::_zero_out_residual, libMesh::ParallelObject::comm(), libMesh::System::current_local_solution, libMesh::ResidualContext::ierr, libmesh_nullptr, libmesh_petsc_snes_residual_helper(), libMesh::NonlinearSolver< T >::matvec, libMesh::NonlinearImplicitSystem::ComputeResidual::residual(), libMesh::NonlinearSolver< T >::residual, libMesh::NonlinearImplicitSystem::ComputeResidualandJacobian::residual_and_jacobian(), libMesh::NonlinearSolver< T >::residual_and_jacobian_object, libMesh::NonlinearSolver< T >::residual_object, libMesh::ResidualContext::solver, libMesh::ResidualContext::sys, and libMesh::PetscVector< T >::zero().

137  {
138  ResidualContext rc = libmesh_petsc_snes_residual_helper(snes, x, ctx);
139 
140  libmesh_assert(r);
141  PetscVector<Number> R(r, rc.sys.comm());
142 
143  if (rc.solver->_zero_out_residual)
144  R.zero();
145 
146  //-----------------------------------------------------------------------------
147  // if the user has provided both function pointers and objects only the pointer
148  // will be used, so catch that as an error
149  if (rc.solver->residual && rc.solver->residual_object)
150  libmesh_error_msg("ERROR: cannot specify both a function and object to compute the Residual!");
151 
152  if (rc.solver->matvec && rc.solver->residual_and_jacobian_object)
153  libmesh_error_msg("ERROR: cannot specify both a function and object to compute the combined Residual & Jacobian!");
154 
155  if (rc.solver->residual != libmesh_nullptr)
156  rc.solver->residual(*rc.sys.current_local_solution.get(), R, rc.sys);
157 
158  else if (rc.solver->residual_object != libmesh_nullptr)
159  rc.solver->residual_object->residual(*rc.sys.current_local_solution.get(), R, rc.sys);
160 
161  else if (rc.solver->matvec != libmesh_nullptr)
162  rc.solver->matvec (*rc.sys.current_local_solution.get(), &R, libmesh_nullptr, rc.sys);
163 
164  else if (rc.solver->residual_and_jacobian_object != libmesh_nullptr)
165  rc.solver->residual_and_jacobian_object->residual_and_jacobian (*rc.sys.current_local_solution.get(), &R, libmesh_nullptr, rc.sys);
166 
167  else
168  libmesh_error_msg("Error! Unable to compute residual and/or Jacobian!");
169 
170  R.close();
171 
172  return rc.ierr;
173  }
const class libmesh_nullptr_t libmesh_nullptr
ResidualContext libmesh_petsc_snes_residual_helper(SNES snes, Vec x, void *ctx)
PetscErrorCode libMesh::__libmesh_tao_equality_constraints ( Tao  ,
Vec  x,
Vec  ce,
void *  ctx 
)

Definition at line 198 of file tao_optimization_solver.C.

References libMesh::ParallelObject::comm(), libMesh::OptimizationSystem::ComputeEqualityConstraints::equality_constraints(), libMesh::OptimizationSolver< T >::equality_constraints_object, ierr, libmesh_nullptr, libMesh::PetscVector< T >::swap(), libMesh::OptimizationSolver< T >::system(), and libMesh::PetscVector< T >::zero().

199  {
200  LOG_SCOPE("equality_constraints()", "TaoOptimizationSolver");
201 
202  PetscErrorCode ierr = 0;
203 
204  libmesh_assert(x);
205  libmesh_assert(ce);
206  libmesh_assert(ctx);
207 
208  // ctx should be a pointer to the solver (it was passed in as void *)
209  TaoOptimizationSolver<Number> * solver =
210  static_cast<TaoOptimizationSolver<Number> *> (ctx);
211 
212  OptimizationSystem & sys = solver->system();
213 
214  // We'll use current_local_solution below, so let's ensure that it's consistent
215  // with the vector x that was passed in.
216  PetscVector<Number> & X_sys = *cast_ptr<PetscVector<Number> *>(sys.solution.get());
217  PetscVector<Number> X(x, sys.comm());
218 
219  // Perform a swap so that sys.solution points to X
220  X.swap(X_sys);
221  // Impose constraints on X
222  sys.get_dof_map().enforce_constraints_exactly(sys);
223  // Update sys.current_local_solution based on X
224  sys.update();
225  // Swap back
226  X.swap(X_sys);
227 
228  // We'll also pass the constraints vector ce into the assembly routine
229  // so let's make a PETSc vector for that too.
230  PetscVector<Number> eq_constraints(ce, sys.comm());
231 
232  // Clear the gradient prior to assembly
233  eq_constraints.zero();
234 
235  if (solver->equality_constraints_object != libmesh_nullptr)
236  solver->equality_constraints_object->equality_constraints(*(sys.current_local_solution), eq_constraints, sys);
237  else
238  libmesh_error_msg("Constraints function not defined in __libmesh_tao_equality_constraints");
239 
240  eq_constraints.close();
241 
242  return ierr;
243  }
const class libmesh_nullptr_t libmesh_nullptr
PetscErrorCode ierr
PetscErrorCode libMesh::__libmesh_tao_equality_constraints_jacobian ( Tao  ,
Vec  x,
Mat  J,
Mat  Jpre,
void *  ctx 
)

Definition at line 249 of file tao_optimization_solver.C.

References libMesh::ParallelObject::comm(), libMesh::OptimizationSystem::ComputeEqualityConstraintsJacobian::equality_constraints_jacobian(), libMesh::OptimizationSolver< T >::equality_constraints_jacobian_object, ierr, libmesh_nullptr, libMesh::PetscVector< T >::swap(), and libMesh::OptimizationSolver< T >::system().

250  {
251  LOG_SCOPE("equality_constraints_jacobian()", "TaoOptimizationSolver");
252 
253  PetscErrorCode ierr = 0;
254 
255  libmesh_assert(x);
256  libmesh_assert(J);
257  libmesh_assert(Jpre);
258 
259  // ctx should be a pointer to the solver (it was passed in as void *)
260  TaoOptimizationSolver<Number> * solver =
261  static_cast<TaoOptimizationSolver<Number> *> (ctx);
262 
263  OptimizationSystem & sys = solver->system();
264 
265  // We'll use current_local_solution below, so let's ensure that it's consistent
266  // with the vector x that was passed in.
267  PetscVector<Number> & X_sys = *cast_ptr<PetscVector<Number> *>(sys.solution.get());
268  PetscVector<Number> X(x, sys.comm());
269 
270  // Perform a swap so that sys.solution points to X
271  X.swap(X_sys);
272  // Impose constraints on X
273  sys.get_dof_map().enforce_constraints_exactly(sys);
274  // Update sys.current_local_solution based on X
275  sys.update();
276  // Swap back
277  X.swap(X_sys);
278 
279  // Let's also wrap J and Jpre in PetscMatrix objects for convenience
280  PetscMatrix<Number> J_petsc(J, sys.comm());
281  PetscMatrix<Number> Jpre_petsc(Jpre, sys.comm());
282 
283  if (solver->equality_constraints_jacobian_object != libmesh_nullptr)
284  solver->equality_constraints_jacobian_object->equality_constraints_jacobian(*(sys.current_local_solution), J_petsc, sys);
285  else
286  libmesh_error_msg("Constraints function not defined in __libmesh_tao_equality_constraints_jacobian");
287 
288  J_petsc.close();
289  Jpre_petsc.close();
290 
291  return ierr;
292  }
const class libmesh_nullptr_t libmesh_nullptr
PetscErrorCode ierr
PetscErrorCode libMesh::__libmesh_tao_gradient ( Tao  ,
Vec  x,
Vec  g,
void *  ctx 
)

Definition at line 92 of file tao_optimization_solver.C.

References libMesh::ParallelObject::comm(), libMesh::OptimizationSystem::ComputeGradient::gradient(), libMesh::OptimizationSolver< T >::gradient_object, ierr, libmesh_nullptr, libMesh::PetscVector< T >::swap(), libMesh::OptimizationSolver< T >::system(), and libMesh::PetscVector< T >::zero().

93  {
94  LOG_SCOPE("gradient()", "TaoOptimizationSolver");
95 
96  PetscErrorCode ierr = 0;
97 
98  libmesh_assert(x);
99  libmesh_assert(g);
100  libmesh_assert(ctx);
101 
102  // ctx should be a pointer to the solver (it was passed in as void *)
103  TaoOptimizationSolver<Number> * solver =
104  static_cast<TaoOptimizationSolver<Number> *> (ctx);
105 
106  OptimizationSystem & sys = solver->system();
107 
108  // We'll use current_local_solution below, so let's ensure that it's consistent
109  // with the vector x that was passed in.
110  PetscVector<Number> & X_sys = *cast_ptr<PetscVector<Number> *>(sys.solution.get());
111  PetscVector<Number> X(x, sys.comm());
112 
113  // Perform a swap so that sys.solution points to X
114  X.swap(X_sys);
115  // Impose constraints on X
116  sys.get_dof_map().enforce_constraints_exactly(sys);
117  // Update sys.current_local_solution based on X
118  sys.update();
119  // Swap back
120  X.swap(X_sys);
121 
122  // We'll also pass the gradient in to the assembly routine
123  // so let's make a PETSc vector for that too.
124  PetscVector<Number> gradient(g, sys.comm());
125 
126  // Clear the gradient prior to assembly
127  gradient.zero();
128 
129  if (solver->gradient_object != libmesh_nullptr)
130  solver->gradient_object->gradient(*(sys.current_local_solution), gradient, sys);
131  else
132  libmesh_error_msg("Gradient function not defined in __libmesh_tao_gradient");
133 
134  gradient.close();
135 
136  return ierr;
137  }
const class libmesh_nullptr_t libmesh_nullptr
PetscErrorCode ierr
PetscErrorCode libMesh::__libmesh_tao_hessian ( Tao  ,
Vec  x,
Mat  h,
Mat  pc,
void *  ctx 
)

Definition at line 142 of file tao_optimization_solver.C.

References libMesh::SparseMatrix< T >::attach_dof_map(), libMesh::ParallelObject::comm(), libMesh::OptimizationSystem::ComputeHessian::hessian(), libMesh::OptimizationSolver< T >::hessian_object, ierr, libmesh_nullptr, libMesh::PetscVector< T >::swap(), and libMesh::OptimizationSolver< T >::system().

143  {
144  LOG_SCOPE("hessian()", "TaoOptimizationSolver");
145 
146  PetscErrorCode ierr = 0;
147 
148  libmesh_assert(x);
149  libmesh_assert(h);
150  libmesh_assert(pc);
151  libmesh_assert(ctx);
152 
153  // ctx should be a pointer to the solver (it was passed in as void *)
154  TaoOptimizationSolver<Number> * solver =
155  static_cast<TaoOptimizationSolver<Number> *> (ctx);
156 
157  OptimizationSystem & sys = solver->system();
158 
159  // We'll use current_local_solution below, so let's ensure that it's consistent
160  // with the vector x that was passed in.
161  PetscVector<Number> & X_sys = *cast_ptr<PetscVector<Number> *>(sys.solution.get());
162  PetscVector<Number> X(x, sys.comm());
163 
164  // Perform a swap so that sys.solution points to X
165  X.swap(X_sys);
166  // Impose constraints on X
167  sys.get_dof_map().enforce_constraints_exactly(sys);
168  // Update sys.current_local_solution based on X
169  sys.update();
170  // Swap back
171  X.swap(X_sys);
172 
173  // Let's also wrap pc and h in PetscMatrix objects for convenience
174  PetscMatrix<Number> PC(pc, sys.comm());
175  PetscMatrix<Number> hessian(h, sys.comm());
176  PC.attach_dof_map(sys.get_dof_map());
177  hessian.attach_dof_map(sys.get_dof_map());
178 
179  if (solver->hessian_object != libmesh_nullptr)
180  {
181  // Following PetscNonlinearSolver by passing in PC. It's not clear
182  // why we pass in PC and not hessian though?
183  solver->hessian_object->hessian(*(sys.current_local_solution), PC, sys);
184  }
185  else
186  libmesh_error_msg("Hessian function not defined in __libmesh_tao_hessian");
187 
188  PC.close();
189  hessian.close();
190 
191  return ierr;
192  }
const class libmesh_nullptr_t libmesh_nullptr
PetscErrorCode ierr
PetscErrorCode libMesh::__libmesh_tao_inequality_constraints ( Tao  ,
Vec  x,
Vec  cineq,
void *  ctx 
)

Definition at line 297 of file tao_optimization_solver.C.

References libMesh::ParallelObject::comm(), ierr, libMesh::OptimizationSystem::ComputeInequalityConstraints::inequality_constraints(), libMesh::OptimizationSolver< T >::inequality_constraints_object, libmesh_nullptr, libMesh::PetscVector< T >::swap(), libMesh::OptimizationSolver< T >::system(), and libMesh::PetscVector< T >::zero().

298  {
299  LOG_SCOPE("inequality_constraints()", "TaoOptimizationSolver");
300 
301  PetscErrorCode ierr = 0;
302 
303  libmesh_assert(x);
304  libmesh_assert(cineq);
305  libmesh_assert(ctx);
306 
307  // ctx should be a pointer to the solver (it was passed in as void *)
308  TaoOptimizationSolver<Number> * solver =
309  static_cast<TaoOptimizationSolver<Number> *> (ctx);
310 
311  OptimizationSystem & sys = solver->system();
312 
313  // We'll use current_local_solution below, so let's ensure that it's consistent
314  // with the vector x that was passed in.
315  PetscVector<Number> & X_sys = *cast_ptr<PetscVector<Number> *>(sys.solution.get());
316  PetscVector<Number> X(x, sys.comm());
317 
318  // Perform a swap so that sys.solution points to X
319  X.swap(X_sys);
320  // Impose constraints on X
321  sys.get_dof_map().enforce_constraints_exactly(sys);
322  // Update sys.current_local_solution based on X
323  sys.update();
324  // Swap back
325  X.swap(X_sys);
326 
327  // We'll also pass the constraints vector ce into the assembly routine
328  // so let's make a PETSc vector for that too.
329  PetscVector<Number> ineq_constraints(cineq, sys.comm());
330 
331  // Clear the gradient prior to assembly
332  ineq_constraints.zero();
333 
334  if (solver->inequality_constraints_object != libmesh_nullptr)
335  solver->inequality_constraints_object->inequality_constraints(*(sys.current_local_solution), ineq_constraints, sys);
336  else
337  libmesh_error_msg("Constraints function not defined in __libmesh_tao_inequality_constraints");
338 
339  ineq_constraints.close();
340 
341  return ierr;
342  }
const class libmesh_nullptr_t libmesh_nullptr
PetscErrorCode ierr
PetscErrorCode libMesh::__libmesh_tao_inequality_constraints_jacobian ( Tao  ,
Vec  x,
Mat  J,
Mat  Jpre,
void *  ctx 
)

Definition at line 348 of file tao_optimization_solver.C.

References libMesh::ParallelObject::comm(), ierr, libMesh::OptimizationSystem::ComputeInequalityConstraintsJacobian::inequality_constraints_jacobian(), libMesh::OptimizationSolver< T >::inequality_constraints_jacobian_object, libmesh_nullptr, libMesh::PetscVector< T >::swap(), and libMesh::OptimizationSolver< T >::system().

349  {
350  LOG_SCOPE("inequality_constraints_jacobian()", "TaoOptimizationSolver");
351 
352  PetscErrorCode ierr = 0;
353 
354  libmesh_assert(x);
355  libmesh_assert(J);
356  libmesh_assert(Jpre);
357 
358  // ctx should be a pointer to the solver (it was passed in as void *)
359  TaoOptimizationSolver<Number> * solver =
360  static_cast<TaoOptimizationSolver<Number> *> (ctx);
361 
362  OptimizationSystem & sys = solver->system();
363 
364  // We'll use current_local_solution below, so let's ensure that it's consistent
365  // with the vector x that was passed in.
366  PetscVector<Number> & X_sys = *cast_ptr<PetscVector<Number> *>(sys.solution.get());
367  PetscVector<Number> X(x, sys.comm());
368 
369  // Perform a swap so that sys.solution points to X
370  X.swap(X_sys);
371  // Impose constraints on X
372  sys.get_dof_map().enforce_constraints_exactly(sys);
373  // Update sys.current_local_solution based on X
374  sys.update();
375  // Swap back
376  X.swap(X_sys);
377 
378  // Let's also wrap J and Jpre in PetscMatrix objects for convenience
379  PetscMatrix<Number> J_petsc(J, sys.comm());
380  PetscMatrix<Number> Jpre_petsc(Jpre, sys.comm());
381 
382  if (solver->inequality_constraints_jacobian_object != libmesh_nullptr)
383  solver->inequality_constraints_jacobian_object->inequality_constraints_jacobian(*(sys.current_local_solution), J_petsc, sys);
384  else
385  libmesh_error_msg("Constraints function not defined in __libmesh_tao_inequality_constraints_jacobian");
386 
387  J_petsc.close();
388  Jpre_petsc.close();
389 
390  return ierr;
391  }
const class libmesh_nullptr_t libmesh_nullptr
PetscErrorCode ierr
PetscErrorCode libMesh::__libmesh_tao_objective ( Tao  ,
Vec  x,
PetscReal *  objective,
void *  ctx 
)

Definition at line 49 of file tao_optimization_solver.C.

References libMesh::ParallelObject::comm(), ierr, libmesh_nullptr, libMesh::OptimizationSystem::ComputeObjective::objective(), libMesh::OptimizationSolver< T >::objective_object, libMesh::PetscVector< T >::swap(), and libMesh::OptimizationSolver< T >::system().

50  {
51  LOG_SCOPE("objective()", "TaoOptimizationSolver");
52 
53  PetscErrorCode ierr = 0;
54 
55  libmesh_assert(x);
56  libmesh_assert(objective);
57  libmesh_assert(ctx);
58 
59  // ctx should be a pointer to the solver (it was passed in as void *)
60  TaoOptimizationSolver<Number> * solver =
61  static_cast<TaoOptimizationSolver<Number> *> (ctx);
62 
63  OptimizationSystem & sys = solver->system();
64 
65  // We'll use current_local_solution below, so let's ensure that it's consistent
66  // with the vector x that was passed in.
67  PetscVector<Number> & X_sys = *cast_ptr<PetscVector<Number> *>(sys.solution.get());
68  PetscVector<Number> X(x, sys.comm());
69 
70  // Perform a swap so that sys.solution points to X
71  X.swap(X_sys);
72  // Impose constraints on X
73  sys.get_dof_map().enforce_constraints_exactly(sys);
74  // Update sys.current_local_solution based on X
75  sys.update();
76  // Swap back
77  X.swap(X_sys);
78 
79  if (solver->objective_object != libmesh_nullptr)
80  (*objective) = solver->objective_object->objective(*(sys.current_local_solution), sys);
81  else
82  libmesh_error_msg("Objective function not defined in __libmesh_tao_objective");
83 
84  return ierr;
85  }
const class libmesh_nullptr_t libmesh_nullptr
PetscErrorCode ierr
template<typename Tnew , typename Told >
Tnew libMesh::cast_int ( Told  oldvar)
inline

Definition at line 558 of file libmesh_common.h.

559 {
560  libmesh_assert_equal_to
561  (oldvar, static_cast<Told>(static_cast<Tnew>(oldvar)));
562 
563  return(static_cast<Tnew>(oldvar));
564 }
template<typename Tnew , typename Told >
Tnew libMesh::cast_ptr ( Told *  oldvar)
inline

Definition at line 521 of file libmesh_common.h.

References err, and libMesh::Quality::name().

Referenced by libMesh::Parameters::have_parameter().

522 {
523 #if !defined(NDEBUG) && defined(LIBMESH_HAVE_RTTI)
524  Tnew newvar = dynamic_cast<Tnew>(oldvar);
525  if (!newvar)
526  {
527  libMesh::err << "Failed to convert " << typeid(Told).name()
528  << " pointer to " << typeid(Tnew).name()
529  << std::endl;
530  libMesh::err << "The " << typeid(Told).name()
531  << " appears to be a "
532  << typeid(*oldvar).name() << std::endl;
533  libmesh_error();
534  }
535  return newvar;
536 #else
537  return(static_cast<Tnew>(oldvar));
538 #endif
539 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
OStreamProxy err(std::cerr)
template<typename Tnew , typename Told >
Tnew libMesh::cast_ref ( Told &  oldvar)
inline

Definition at line 485 of file libmesh_common.h.

References err, and libMesh::Quality::name().

486 {
487 #if !defined(NDEBUG) && defined(LIBMESH_HAVE_RTTI) && defined(LIBMESH_ENABLE_EXCEPTIONS)
488  try
489  {
490  Tnew newvar = dynamic_cast<Tnew>(oldvar);
491  return newvar;
492  }
493  catch (std::bad_cast)
494  {
495  libMesh::err << "Failed to convert " << typeid(Told).name()
496  << " reference to " << typeid(Tnew).name()
497  << std::endl;
498  libMesh::err << "The " << typeid(Told).name()
499  << " appears to be a "
500  << typeid(*(&oldvar)).name() << std::endl;
501  libmesh_error();
502  }
503 #else
504  return(static_cast<Tnew>(oldvar));
505 #endif
506 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
OStreamProxy err(std::cerr)
bool libMesh::closed ( )

Checks that the library has been closed. This should always return false when called from a library object. It is useful to libmesh_assert(!libMeshclosed()) in library object destructors.

Definition at line 280 of file libmesh.C.

References libMesh::libMeshPrivateData::_is_initialized.

Referenced by libMesh::PetscMatrix< T >::_get_submatrix(), libMesh::SparseMatrix< ValOut >::add_block_matrix(), libMesh::EigenSparseVector< T >::l1_norm(), libMesh::LaspackVector< T >::l1_norm(), libMesh::EpetraVector< T >::l1_norm(), libMesh::PetscVector< T >::l1_norm(), libMesh::PetscMatrix< T >::l1_norm(), libMesh::EigenSparseVector< T >::l2_norm(), libMesh::LaspackVector< T >::l2_norm(), libMesh::EpetraVector< T >::l2_norm(), libMesh::PetscVector< T >::l2_norm(), libMesh::LibMeshInit::LibMeshInit(), libMesh::EigenSparseVector< T >::linfty_norm(), libMesh::LaspackVector< T >::linfty_norm(), libMesh::EpetraVector< T >::linfty_norm(), libMesh::PetscVector< T >::linfty_norm(), libMesh::PetscMatrix< T >::linfty_norm(), libMesh::PetscMatrix< T >::operator()(), libMesh::DistributedVector< T >::operator+=(), libMesh::EigenSparseVector< T >::operator+=(), libMesh::LaspackVector< T >::operator+=(), libMesh::EpetraVector< T >::operator+=(), libMesh::PetscVector< T >::operator+=(), libMesh::DistributedVector< T >::operator-=(), libMesh::LaspackVector< T >::operator-=(), libMesh::EigenSparseVector< T >::operator-=(), libMesh::EpetraVector< T >::operator-=(), libMesh::PetscVector< T >::operator-=(), libMesh::EigenSparseVector< T >::operator/=(), libMesh::EpetraVector< T >::operator/=(), libMesh::EigenSparseVector< T >::operator=(), libMesh::LaspackVector< T >::operator=(), libMesh::PetscVector< T >::operator=(), libMesh::PetscMatrix< T >::print_matlab(), libMesh::PetscVector< T >::print_matlab(), libMesh::PetscMatrix< T >::print_personal(), libMesh::LaspackVector< T >::sum(), libMesh::EigenSparseVector< T >::sum(), libMesh::EpetraVector< T >::sum(), libMesh::PetscVector< T >::sum(), libMesh::MeshBase::~MeshBase(), libMesh::System::~System(), and libMesh::UnstructuredMesh::~UnstructuredMesh().

281 {
283 }
template<typename T >
T libMesh::command_line_next ( const std::string &  ,
 
)

Use GetPot's search()/next() functions to get following arguments from the command line.

Definition at line 963 of file libmesh.C.

References value.

Referenced by libMesh::NloptOptimizationSolver< T >::init(), and libMesh::DofMap::use_coupled_neighbor_dofs().

964 {
965  // Make sure the command line parser is ready for use
966  libmesh_assert(command_line.get());
967 
968  if (command_line->search(1, name.c_str()))
969  value = command_line->next(value);
970 
971  return value;
972 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
static const bool value
Definition: xdr_io.C:108
template double libMesh::command_line_next< double > ( const std::string &  ,
double   
)

Referenced by default_solver_package().

template float libMesh::command_line_next< float > ( const std::string &  ,
float   
)

Referenced by default_solver_package().

template int libMesh::command_line_next< int > ( const std::string &  ,
int   
)

Referenced by default_solver_package().

template long double libMesh::command_line_next< long double > ( const std::string &  ,
long  double 
)

Referenced by default_solver_package().

template std::string libMesh::command_line_next< std::string > ( const std::string &  ,
std::string   
)
template<typename T >
T libMesh::command_line_value ( const std::string &  ,
 
)
Returns
The value associated with name on the command line if it is specified, otherwise return the default, provided value. A second template function is provided to support recognizing multiple variations of a given option

Definition at line 931 of file libmesh.C.

References value.

Referenced by libMesh::LibMeshInit::LibMeshInit(), and petsc_auto_fieldsplit().

932 {
933  // Make sure the command line parser is ready for use
934  libmesh_assert(command_line.get());
935 
936  // only if the variable exists in the file
937  if (command_line->have_variable(name.c_str()))
938  value = (*command_line)(name.c_str(), value);
939 
940  return value;
941 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
static const bool value
Definition: xdr_io.C:108
template<typename T >
T libMesh::command_line_value ( const std::vector< std::string > &  name,
value 
)

Definition at line 944 of file libmesh.C.

References value.

945 {
946  // Make sure the command line parser is ready for use
947  libmesh_assert(command_line.get());
948 
949  // Check for multiple options (return the first that matches)
950  for (std::vector<std::string>::const_iterator i=name.begin(); i != name.end(); ++i)
951  if (command_line->have_variable(i->c_str()))
952  {
953  value = (*command_line)(i->c_str(), value);
954  break;
955  }
956 
957  return value;
958 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
static const bool value
Definition: xdr_io.C:108
template double libMesh::command_line_value< double > ( const std::string &  ,
double   
)

Referenced by default_solver_package().

template double libMesh::command_line_value< double > ( const std::vector< std::string > &  ,
double   
)
template float libMesh::command_line_value< float > ( const std::string &  ,
float   
)

Referenced by default_solver_package().

template float libMesh::command_line_value< float > ( const std::vector< std::string > &  ,
float   
)
template int libMesh::command_line_value< int > ( const std::string &  ,
int   
)

Referenced by default_solver_package().

template int libMesh::command_line_value< int > ( const std::vector< std::string > &  ,
int   
)
template long double libMesh::command_line_value< long double > ( const std::string &  ,
long  double 
)

Referenced by default_solver_package().

template long double libMesh::command_line_value< long double > ( const std::vector< std::string > &  ,
long  double 
)
template std::string libMesh::command_line_value< std::string > ( const std::string &  ,
std::string   
)
template std::string libMesh::command_line_value< std::string > ( const std::vector< std::string > &  ,
std::string   
)
template<typename T >
void libMesh::command_line_vector ( const std::string &  ,
std::vector< T > &   
)
Returns
The array of values associated with name on the command line if it is specified, otherwise return the default, provided array.

Definition at line 977 of file libmesh.C.

978 {
979  // Make sure the command line parser is ready for use
980  libmesh_assert(command_line.get());
981 
982  // only if the variable exists on the command line
983  if (command_line->have_variable(name.c_str()))
984  {
985  unsigned size = command_line->vector_variable_size(name.c_str());
986  vec.resize(size);
987 
988  for (unsigned i=0; i<size; ++i)
989  vec[i] = (*command_line)(name.c_str(), vec[i], i);
990  }
991 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
template void libMesh::command_line_vector< double > ( const std::string &  ,
std::vector< double > &   
)

Referenced by default_solver_package().

template void libMesh::command_line_vector< float > ( const std::string &  ,
std::vector< float > &   
)

Referenced by default_solver_package().

template void libMesh::command_line_vector< int > ( const std::string &  ,
std::vector< int > &   
)

Referenced by default_solver_package().

template void libMesh::command_line_vector< long double > ( const std::string &  ,
std::vector< long double > &   
)

Referenced by default_solver_package().

void libMesh::connect_children ( const MeshBase mesh,
processor_id_type  pid,
std::set< const Elem *, CompareElemIdsByLevel > &  connected_elements 
)

Definition at line 190 of file mesh_communication.C.

References libMesh::Elem::child_ref_range(), libMesh::Elem::has_children(), libmesh_ignore(), libMesh::MeshBase::pid_elements_begin(), libMesh::MeshBase::pid_elements_end(), and remote_elem.

Referenced by libMesh::MeshCommunication::allgather(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::MeshCommunication::redistribute(), and libMesh::CheckpointIO::write().

193 {
194  // None of these parameters are used when !LIBMESH_ENABLE_AMR.
195  libmesh_ignore(mesh);
196  libmesh_ignore(pid);
197  libmesh_ignore(connected_elements);
198 
199 #ifdef LIBMESH_ENABLE_AMR
200  // Our XdrIO output needs inactive local elements to not have any
201  // remote_elem children. Let's make sure that doesn't happen.
202  //
204  const MeshBase::const_element_iterator elem_end = mesh.pid_elements_end(pid);
205  for (; elem_it != elem_end; ++elem_it)
206  {
207  const Elem * elem = *elem_it;
208  if (elem->has_children())
209  for (auto & child : elem->child_ref_range())
210  if (&child != remote_elem)
211  connected_elements.insert(&child);
212  }
213 #endif // LIBMESH_ENABLE_AMR
214 }
bool has_children() const
Definition: elem.h:2296
The base class for all geometric element types.
Definition: elem.h:90
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
void libmesh_ignore(const T &)
virtual element_iterator pid_elements_begin(processor_id_type proc_id)=0
const RemoteElem * remote_elem
Definition: remote_elem.C:57
virtual element_iterator pid_elements_end(processor_id_type proc_id)=0
void libMesh::connect_families ( std::set< const Elem *, CompareElemIdsByLevel > &  connected_elements)

Definition at line 217 of file mesh_communication.C.

References libMesh::Elem::active(), libMesh::Elem::has_children(), libmesh_ignore(), libMesh::Elem::parent(), remote_elem, and libMesh::Elem::total_family_tree().

Referenced by libMesh::MeshCommunication::allgather(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::MeshCommunication::redistribute(), and libMesh::CheckpointIO::write().

218 {
219  // This parameter is not used when !LIBMESH_ENABLE_AMR.
220  libmesh_ignore(connected_elements);
221 
222 #ifdef LIBMESH_ENABLE_AMR
223 
224  // Because our set is sorted by ascending level, we can traverse it
225  // in reverse order, adding parents as we go, and end up with all
226  // ancestors added. This is safe for std::set where insert doesn't
227  // invalidate iterators.
228  //
229  // This only works because we do *not* cache
230  // connected_elements.rend(), whose value can change when we insert
231  // elements which are sorted before the original rend.
232  //
233  // We're also going to get subactive descendents here, when any
234  // exist. We're iterating in the wrong direction to do that
235  // non-recursively, so we'll cop out and rely on total_family_tree.
236  // Iterating backwards does mean that we won't be querying the newly
237  // inserted subactive elements redundantly.
238 
239  std::set<const Elem *, CompareElemIdsByLevel>::reverse_iterator
240  elem_rit = connected_elements.rbegin();
241 
242  for (; elem_rit != connected_elements.rend(); ++elem_rit)
243  {
244  const Elem * elem = *elem_rit;
245  libmesh_assert(elem);
246  const Elem * parent = elem->parent();
247 
248  // We let ghosting functors worry about only active elements,
249  // but the remote processor needs all its semilocal elements'
250  // ancestors and active semilocal elements' descendants too.
251  if (parent)
252  connected_elements.insert (parent);
253 
254  if (elem->active() && elem->has_children())
255  {
256  std::vector<const Elem *> subactive_family;
257  elem->total_family_tree(subactive_family);
258  for (std::size_t i=0; i != subactive_family.size(); ++i)
259  {
260  libmesh_assert(subactive_family[i] != remote_elem);
261  connected_elements.insert(subactive_family[i]);
262  }
263  }
264  }
265 
266 # ifdef DEBUG
267  // Let's be paranoid and make sure that all our ancestors
268  // really did get inserted. I screwed this up the first time
269  // by caching rend, and I can easily imagine screwing it up in
270  // the future by changing containers.
271  std::set<const Elem *, CompareElemIdsByLevel>::iterator
272  elem_it = connected_elements.begin(),
273  elem_end = connected_elements.end();
274 
275  for (; elem_it != elem_end; ++elem_it)
276  {
277  const Elem * elem = *elem_it;
278  libmesh_assert(elem);
279  const Elem * parent = elem->parent();
280  if (parent)
281  libmesh_assert(connected_elements.count(parent));
282  }
283 # endif // DEBUG
284 
285 #endif // LIBMESH_ENABLE_AMR
286 }
bool has_children() const
Definition: elem.h:2296
bool active() const
Definition: elem.h:2258
const Elem * parent() const
Definition: elem.h:2347
The base class for all geometric element types.
Definition: elem.h:90
void total_family_tree(std::vector< const Elem * > &active_family, const bool reset=true) const
Definition: elem.C:1593
void libmesh_ignore(const T &)
const RemoteElem * remote_elem
Definition: remote_elem.C:57
DiffSolver::SolveResult libMesh::convert_solve_result ( SNESConvergedReason  r)

Definition at line 249 of file petsc_diff_solver.C.

References libMesh::DiffSolver::CONVERGED_ABSOLUTE_RESIDUAL, libMesh::DiffSolver::CONVERGED_NO_REASON, libMesh::DiffSolver::CONVERGED_RELATIVE_RESIDUAL, libMesh::DiffSolver::CONVERGED_RELATIVE_STEP, libMesh::DiffSolver::DIVERGED_BACKTRACKING_FAILURE, libMesh::DiffSolver::DIVERGED_MAX_NONLINEAR_ITERATIONS, libMesh::DiffSolver::DIVERGED_NO_REASON, and libMesh::DiffSolver::INVALID_SOLVE_RESULT.

Referenced by libMesh::PetscDiffSolver::solve().

250 {
251  switch (r)
252  {
253  case SNES_CONVERGED_FNORM_ABS:
254  return DiffSolver::CONVERGED_ABSOLUTE_RESIDUAL;
255  case SNES_CONVERGED_FNORM_RELATIVE:
256  return DiffSolver::CONVERGED_RELATIVE_RESIDUAL;
257 #if PETSC_VERSION_LESS_THAN(3,2,1)
258  case SNES_CONVERGED_PNORM_RELATIVE:
259 #else
260  case SNES_CONVERGED_SNORM_RELATIVE:
261 #endif
262  return DiffSolver::CONVERGED_RELATIVE_STEP;
263  case SNES_CONVERGED_ITS:
264  case SNES_CONVERGED_TR_DELTA:
265  return DiffSolver::CONVERGED_NO_REASON;
266  case SNES_DIVERGED_FUNCTION_DOMAIN:
267  case SNES_DIVERGED_FUNCTION_COUNT:
268  case SNES_DIVERGED_FNORM_NAN:
269 #if !PETSC_VERSION_LESS_THAN(3,3,0)
270  case SNES_DIVERGED_INNER:
271 #endif
272  case SNES_DIVERGED_LINEAR_SOLVE:
273  case SNES_DIVERGED_LOCAL_MIN:
274  return DiffSolver::DIVERGED_NO_REASON;
275  case SNES_DIVERGED_MAX_IT:
276  return DiffSolver::DIVERGED_MAX_NONLINEAR_ITERATIONS;
277 #if PETSC_VERSION_LESS_THAN(3,2,0)
278  case SNES_DIVERGED_LS_FAILURE:
279 #else
280  case SNES_DIVERGED_LINE_SEARCH:
281 #endif
282  return DiffSolver::DIVERGED_BACKTRACKING_FAILURE;
283  // In PETSc, SNES_CONVERGED_ITERATING means
284  // the solve is still iterating, but by the
285  // time we get here, we must have either
286  // converged or diverged, so
287  // SNES_CONVERGED_ITERATING is invalid.
288  case SNES_CONVERGED_ITERATING:
289  return DiffSolver::INVALID_SOLVE_RESULT;
290  default:
291  break;
292  }
293  return DiffSolver::INVALID_SOLVE_RESULT;
294 }
template<typename T >
T libMesh::cross_norm ( const TypeVector< T > &  b,
const TypeVector< T > &  c 
)
inline

Calls cross_norm_sq() and takes the square root of the result.

Definition at line 1092 of file type_vector.h.

References cross_norm_sq().

Referenced by libMesh::Quad4::volume(), libMesh::Tri3::volume(), libMesh::Quad8::volume(), libMesh::Tri6::volume(), and libMesh::Quad9::volume().

1094 {
1095  // We only support cross products when LIBMESH_DIM==3, same goes for this.
1096  libmesh_assert_equal_to (LIBMESH_DIM, 3);
1097 
1098  return std::sqrt(cross_norm_sq(b,c));
1099 }
T cross_norm_sq(const TypeVector< T > &b, const TypeVector< T > &c)
Definition: type_vector.h:1072
template<typename T >
T libMesh::cross_norm_sq ( const TypeVector< T > &  b,
const TypeVector< T > &  c 
)
inline

Compute |b x c|^2 without creating the extra temporary produced by calling b.cross(c).norm_sq().

Definition at line 1072 of file type_vector.h.

Referenced by cross_norm().

1074 {
1075  // We only support cross products when LIBMESH_DIM==3, same goes for this.
1076  libmesh_assert_equal_to (LIBMESH_DIM, 3);
1077 
1078  T x = b(1)*c(2) - b(2)*c(1),
1079  y = b(0)*c(2) - b(2)*c(0),
1080  z = b(0)*c(1) - b(1)*c(0);
1081 
1082  return x*x + y*y + z*z;
1083 }
SolverPackage libMesh::default_solver_package ( )
Returns
The default solver interface to use. The value depends on which solver packages were available when the library was configured. The command-line is also checked, allowing the user to override the compiled default. For example, –use-petsc will force the use of PETSc solvers, and –use-laspack will force the use of LASPACK solvers.

Definition at line 994 of file libmesh.C.

References libMesh::libMeshPrivateData::_solver_package, command_line_next< double >(), command_line_next< float >(), command_line_next< int >(), command_line_next< long double >(), command_line_value< double >(), command_line_value< float >(), command_line_value< int >(), command_line_value< long double >(), command_line_vector< double >(), command_line_vector< float >(), command_line_vector< int >(), command_line_vector< long double >(), EIGEN_SOLVERS, initialized(), INVALID_SOLVER_PACKAGE, LASPACK_SOLVERS, on_command_line(), PETSC_SOLVERS, and TRILINOS_SOLVERS.

995 {
996  libmesh_assert (libMesh::initialized());
997 
998  static bool called = false;
999 
1000  // Check the command line. Since the command line is
1001  // unchanging it is sufficient to do this only once.
1002  if (!called)
1003  {
1004  called = true;
1005 
1006 #ifdef LIBMESH_HAVE_PETSC
1007  if (libMesh::on_command_line ("--use-petsc"))
1009 #endif
1010 
1011 #ifdef LIBMESH_TRILINOS_HAVE_AZTECOO
1012  if (libMesh::on_command_line ("--use-trilinos") ||
1013  libMesh::on_command_line ("--disable-petsc"))
1015 #endif
1016 
1017 #ifdef LIBMESH_HAVE_EIGEN
1018  if (libMesh::on_command_line ("--use-eigen" ) ||
1019 #if defined(LIBMESH_HAVE_MPI)
1020  // If the user bypassed MPI, we disable PETSc and Trilinos
1021  // too
1022  libMesh::on_command_line ("--disable-mpi") ||
1023 #endif
1024  libMesh::on_command_line ("--disable-petsc"))
1026 #endif
1027 
1028 #ifdef LIBMESH_HAVE_LASPACK
1029  if (libMesh::on_command_line ("--use-laspack" ) ||
1030 #if defined(LIBMESH_HAVE_MPI)
1031  // If the user bypassed MPI, we disable PETSc and Trilinos
1032  // too
1033  libMesh::on_command_line ("--disable-mpi") ||
1034 #endif
1035  libMesh::on_command_line ("--disable-petsc"))
1037 #endif
1038 
1039  if (libMesh::on_command_line ("--disable-laspack") &&
1040  libMesh::on_command_line ("--disable-trilinos") &&
1041  libMesh::on_command_line ("--disable-eigen") &&
1042  (
1043 #if defined(LIBMESH_HAVE_MPI)
1044  // If the user bypassed MPI, we disable PETSc too