13 #ifndef _PETSCSOLVER_H_ 14 #define _PETSCSOLVER_H_ 25 #include "petscviewer.h" 28 #include "NamespaceHeader.H" 56 virtual void setFunctionAndJacobian( PetscErrorCode (*f)(SNES,Vec,Vec,
void*),
57 PetscErrorCode (*j)(SNES,Vec,Mat*,Mat*,MatStructure*,
void*)
70 virtual void solve( T& a_phi,
const T& a_rhs );
80 int applyOp(T & a_phi,
const T & a_rhs );
94 pout()<<
"getNNZPerRow PetscSolver"<<endl;
146 Vec m_xx, m_rr, m_bb;
150 PetscErrorCode (*m_function)(SNES,Vec,Vec,
void*);
151 PetscErrorCode (*m_jacobian)(SNES,Vec,Mat*,Mat*,MatStructure*,
void*);
164 int putPetscInChombo( T& a_phi,
const Vec xx );
165 int putChomboInPetsc( Vec out,
const T& a_phi );
166 virtual int formMatrix( Mat,
const T& a_rhs ) = 0;
171 virtual void defineData(T& a_data,
const T& a_template) = 0;
202 a_box = fabref.
box();
210 a_fab.
define( dbl, 1, idghosts );
270 #include "NamespaceFooter.H" 273 #ifndef CH_EXPLICIT_TEMPLATES 275 #endif // CH_EXPLICIT_TEMPLATES std::ostream & pout()
Use this in place of std::cout for program output.
Definition: LinearSolver.H:28
LevelData< FluxBox > * m_eta
Definition: PetscSolver.H:257
virtual void solve(T &a_phi, const T &a_rhs)
Definition: PetscSolverI.H:95
int solve_private(T &a_phi, const T &a_rhs)
Definition: PetscSolverI.H:297
virtual Real addBCdiagValue(const IntVect &a_iv, const IntVect &a_jv, const T &a_rhs, DataIterator dit, const Real coeff=1)
Definition: PetscSolver.H:115
Real m_beta
Definition: PetscSolver.H:254
Definition: PetscSolver.H:180
int m_gid0
Definition: PetscSolver.H:158
virtual void define(LinearOp< T > *a_operator, bool a_homogeneous=false)
Definition: PetscSolverI.H:78
Definition: DataIterator.H:140
BaseFab< Real > & getRegFab(LevelData< FArrayBox > &a_fab, DataIterator &dit)
Definition: PetscSolver.H:187
virtual void setHomogeneous(bool a_homogeneous)
Definition: PetscSolver.H:48
virtual int getNNZPerRow() const
Definition: PetscSolver.H:246
const Box & box() const
Definition: BaseFabImplem.H:202
const BaseFab< Real > & getRegFab(const LevelData< FArrayBox > &a_fab, DataIterator &a_dit, Box &a_box) const
Definition: PetscSolver.H:199
int applyOp(T &a_phi, const T &a_rhs)
Definition: PetscSolverI.H:507
int resetOperator()
Definition: PetscSolver.H:120
virtual ~PetscSolver()
Definition: PetscSolverI.H:71
Real m_dx
Definition: PetscSolver.H:107
bool m_null
Definition: PetscSolver.H:154
Real computeResidual()
Definition: PetscSolverI.H:478
PetscSolverFAB()
Definition: PetscSolver.H:183
void setNull(bool n=true)
Definition: PetscSolverI.H:88
LevelData< BaseFab< bool > > m_bccode
Definition: PetscSolver.H:157
Real m_alpha
Definition: PetscSolver.H:228
Definition: BoxLayoutData.H:136
virtual void defineData(T &a_data, const T &a_template)=0
LevelData< FluxBox > * m_lamb
Definition: PetscSolver.H:258
double Real
Definition: REAL.H:33
virtual void define(const DisjointBoxLayout &dp, int comps, const IntVect &ghost=IntVect::Zero, const DataFactory< T > &a_factory=DefaultDataFactory< T >())
Definition: LevelDataI.H:70
virtual BaseFab< Real > & getRegFab(T &a_fab, DataIterator &dit)=0
void setInitialGuessNonzero(bool b=true)
Definition: PetscSolver.H:84
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
Real m_beta
Definition: PetscSolver.H:229
void defineData(LevelData< FArrayBox > &a_fab, const LevelData< FArrayBox > &a_phi)
Definition: PetscSolver.H:206
const IntVect & ghostVect() const
Definition: LevelData.H:157
virtual int getNNZPerRow() const
Definition: PetscSolver.H:92
PetscSolver()
Definition: PetscSolverI.H:28
virtual Real addBCrhsValue(const IntVect &a_iv, const T &a_phi, DataIterator dit, const Real &coeff=1)
Definition: PetscSolver.H:136
bool m_nz_init_guess
Definition: PetscSolver.H:155
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
Real m_dxCrse
Definition: PetscSolver.H:255
Definition: LinearSolver.H:158
const DisjointBoxLayout & disjointBoxLayout() const
Definition: LevelData.H:196
int setup_solver(const T &a_phi)
Definition: PetscSolverI.H:193
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: PetscSolver.H:38
void destroy()
Definition: PetscSolverI.H:44
Definition: FArrayBox.H:44
Definition: PetscSolver.H:220
int create_mat_vec(const T &a_phi)
Definition: PetscSolverI.H:109
Definition: PetscSolver.H:238
LevelData< FArrayBox > * m_a
Definition: PetscSolver.H:256
bool m_homogeneous
Definition: PetscSolver.H:101
const BaseFab< Real > & getRegFab(const LevelData< FArrayBox > &a_fab, DataIterator &dit) const
Definition: PetscSolver.H:193
void setVTParams(Real alpha, Real beta, LevelData< FArrayBox > *a, LevelData< FluxBox > *eta, LevelData< FluxBox > *lam)
Definition: PetscSolver.H:260
T m_gids
Definition: PetscSolver.H:156