https://mooseframework.inl.gov
PetscDMMoose.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "libmesh/petsc_macro.h"
13 
14 // PETSc includes
15 #include <petscdm.h>
16 #define DMMOOSE "moose"
17 
18 // C++ includes
19 #include <vector>
20 #include <set>
21 #include <string>
22 
23 // Forward declarations
25 namespace libMesh
26 {
27 class DofMapBase;
28 class System;
29 }
30 
31 extern PetscErrorCode DMMooseRegisterAll();
32 
41 extern PetscErrorCode DMCreateMoose(MPI_Comm comm,
43  const libMesh::DofMapBase & dof_map,
44  const libMesh::System & system,
45  const std::string & dm_name,
46  DM * dm);
47 
48 extern PetscErrorCode DMMooseReset(DM);
49 extern PetscErrorCode DMMooseSetNonlinearSystem(DM, NonlinearSystemBase &);
50 extern PetscErrorCode DMMooseGetNonlinearSystem(DM, NonlinearSystemBase *&);
51 extern PetscErrorCode DMMooseSetDofMap(DM, const libMesh::DofMapBase &);
52 extern PetscErrorCode DMMooseGetBlocks(DM, std::vector<std::string> &);
53 extern PetscErrorCode DMMooseGetVariables(DM, std::vector<std::string> &);
54 extern PetscErrorCode DMMooseGetSides(DM, std::set<std::string> &);
55 extern PetscErrorCode DMMooseGetUnSides(DM, std::set<std::string> &);
56 extern PetscErrorCode
57 DMMooseGetContacts(DM, std::vector<std::pair<std::string, std::string>> &, std::vector<bool> &);
58 extern PetscErrorCode
59 DMMooseGetUnContacts(DM, std::vector<std::pair<std::string, std::string>> &, std::vector<bool> &);
60 extern PetscErrorCode DMMooseSetBlocks(DM, const std::vector<std::string> &);
61 extern PetscErrorCode DMMooseSetVariables(DM, const std::vector<std::string> &);
62 extern PetscErrorCode DMMooseSetSides(DM, const std::set<std::string> &);
63 extern PetscErrorCode DMMooseSetUnSides(DM, const std::set<std::string> &);
64 extern PetscErrorCode DMMooseSetContacts(DM,
65  const std::vector<std::pair<std::string, std::string>> &,
66  const std::vector<bool> &);
67 extern PetscErrorCode DMMooseSetUnContacts(DM,
68  const std::vector<std::pair<std::string, std::string>> &,
69  const std::vector<bool> &);
70 extern PetscErrorCode DMMooseSetSplitNames(DM, const std::vector<std::string> &);
71 extern PetscErrorCode DMMooseGetSplitNames(DM, const std::vector<std::string> &);
72 extern PetscErrorCode DMMooseSetSplitVars(DM, const std::string &, const std::set<std::string> &);
73 extern PetscErrorCode DMMooseGetSplitVars(DM, const std::string &, std::set<std::string> &);
74 extern PetscErrorCode DMMooseSetSplitBlocks(DM, const std::string &, const std::set<std::string> &);
75 extern PetscErrorCode DMMooseGetSplitBlocks(DM, const std::string &, std::set<std::string> &);
76 extern PetscErrorCode DMMooseSetSplitSides(DM, const std::string &, const std::set<std::string> &);
77 extern PetscErrorCode DMMooseGetSplitSides(DM, const std::string &, std::set<std::string> &);
78 extern PetscErrorCode SNESUpdateDMMoose(SNES snes, PetscInt iteration);
PetscErrorCode DMMooseSetBlocks(DM, const std::vector< std::string > &)
PetscErrorCode DMMooseSetUnSides(DM, const std::set< std::string > &)
Definition: PetscDMMoose.C:355
PetscErrorCode DMMooseGetSplitSides(DM, const std::string &, std::set< std::string > &)
PetscErrorCode DMMooseGetNonlinearSystem(DM, NonlinearSystemBase *&)
Definition: PetscDMMoose.C:446
PetscErrorCode PetscOptionItems *PetscErrorCode DM dm
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
PetscErrorCode DMMooseSetSplitVars(DM, const std::string &, const std::set< std::string > &)
PetscErrorCode DMMooseSetSplitSides(DM, const std::string &, const std::set< std::string > &)
Nonlinear system to be solved.
PetscErrorCode DMMooseSetSides(DM, const std::set< std::string > &)
Definition: PetscDMMoose.C:340
PetscErrorCode DMCreateMoose(MPI_Comm comm, NonlinearSystemBase &nl, const libMesh::DofMapBase &dof_map, const libMesh::System &system, const std::string &dm_name, DM *dm)
Create a MOOSE DM.
PetscErrorCode DMMooseGetSplitBlocks(DM, const std::string &, std::set< std::string > &)
PetscErrorCode DMMooseSetVariables(DM, const std::vector< std::string > &)
PetscErrorCode DMMooseGetSplitVars(DM, const std::string &, std::set< std::string > &)
PetscErrorCode SNESUpdateDMMoose(SNES snes, PetscInt iteration)
PetscErrorCode DMMooseSetSplitBlocks(DM, const std::string &, const std::set< std::string > &)
PetscErrorCode DMMooseSetSplitNames(DM, const std::vector< std::string > &)
Definition: PetscDMMoose.C:456
PetscErrorCode DMMooseGetUnContacts(DM, std::vector< std::pair< std::string, std::string >> &, std::vector< bool > &)
PetscErrorCode DMMooseGetUnSides(DM, std::set< std::string > &)
PetscErrorCode DMMooseReset(DM)
PetscErrorCode DMMooseGetContacts(DM, std::vector< std::pair< std::string, std::string >> &, std::vector< bool > &)
PetscErrorCode DMMooseGetSides(DM, std::set< std::string > &)
PetscErrorCode DMMooseGetSplitNames(DM, const std::vector< std::string > &)
PetscErrorCode DMMooseSetNonlinearSystem(DM, NonlinearSystemBase &)
Definition: PetscDMMoose.C:225
PetscErrorCode DMMooseGetVariables(DM, std::vector< std::string > &)
Definition: PetscDMMoose.C:214
PetscErrorCode DMMooseSetUnContacts(DM, const std::vector< std::pair< std::string, std::string >> &, const std::vector< bool > &)
PetscErrorCode DMMooseRegisterAll()
PetscErrorCode DMMooseSetContacts(DM, const std::vector< std::pair< std::string, std::string >> &, const std::vector< bool > &)
PetscErrorCode DMMooseGetBlocks(DM, std::vector< std::string > &)
Definition: PetscDMMoose.C:203
PetscErrorCode DMMooseSetDofMap(DM, const libMesh::DofMapBase &)
Definition: PetscDMMoose.C:239