25 const int p,
const int space_dim,
const int type,
104 : H1FESpace_(&H1FESpace),
105 HCurlFESpace_(&HCurlFESpace),
115 ownsWeakDiv_(weakDiv == NULL),
116 ownsGrad_(grad == NULL)
118 ess_bdr_.SetSize(H1FESpace_->GetParMesh()->bdr_attributes.Max());
120 H1FESpace_->GetEssentialTrueDofs(ess_bdr_, ess_bdr_tdofs_);
122 int geom = H1FESpace_->GetFE(0)->GetGeomType();
130 s0_->AddDomainIntegrator(diffInteg);
135 if ( weakDiv_ == NULL )
140 weakDiv_->AddDomainIntegrator(wdivInteg);
141 weakDiv_->Assemble();
142 weakDiv_->Finalize();
170 IrrotationalProjector::InitSolver()
const
188 weakDiv_->
Mult(x,*xDiv_); *xDiv_ *= -1.0;
195 if ( pcg_ == NULL ) { this->InitSolver(); }
196 pcg_->
Mult(RHS_, Psi_);
202 grad_->
Mult(*psi_, y);
208 delete pcg_; pcg_ = NULL;
209 delete amg_; amg_ = NULL;
265 ParMesh &pmesh,
const char *title,
266 int x,
int y,
int w,
int h,
const char *keys,
bool vec)
268 MPI_Comm comm = pmesh.
GetComm();
271 MPI_Comm_size(comm, &num_procs);
272 MPI_Comm_rank(comm, &myid);
274 bool newly_opened =
false;
275 int connection_failed;
283 sock.
open(vishost, visport);
287 sock <<
"solution\n";
292 if (myid == 0 && newly_opened)
294 sock <<
"window_title '" << title <<
"'\n"
295 <<
"window_geometry "
296 << x <<
" " << y <<
" " << w <<
" " << h <<
"\n";
297 if ( keys ) { sock <<
"keys " << keys <<
"\n"; }
298 else { sock <<
"keys maaAc"; }
299 if ( vec ) { sock <<
"vvv"; }
305 connection_failed = !sock && !newly_opened;
307 MPI_Bcast(&connection_failed, 1, MPI_INT, 0, comm);
309 while (connection_failed);
314 int x,
int y,
int w,
int h,
const char *keys,
bool vec)
317 MPI_Comm comm = pmesh.
GetComm();
320 MPI_Comm_size(comm, &num_procs);
321 MPI_Comm_rank(comm, &myid);
323 bool newly_opened =
false;
324 int connection_failed;
332 sock.
open(vishost, visport);
336 sock <<
"solution\n";
342 if (myid == 0 && newly_opened)
344 sock <<
"window_title '" << title <<
"'\n"
345 <<
"window_geometry "
346 << x <<
" " << y <<
" " << w <<
" " << h <<
"\n";
347 if ( keys ) { sock <<
"keys " << keys <<
"\n"; }
348 else { sock <<
"keys maaAc"; }
349 if ( vec ) { sock <<
"vvv"; }
355 connection_failed = !sock && !newly_opened;
357 MPI_Bcast(&connection_failed, 1, MPI_INT, 0, comm);
359 while (connection_failed);
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1)
IrrotationalProjector(ParFiniteElementSpace &H1FESpace, ParFiniteElementSpace &HCurlFESpace, const int &irOrder, ParBilinearForm *s0=NULL, ParMixedBilinearForm *weakDiv=NULL, ParDiscreteGradOperator *grad=NULL)
Class for an integration rule - an Array of IntegrationPoint.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
virtual void Mult(const Vector &x, Vector &y) const
Operator application: y=A(x).
void SaveAsOne(std::ostream &out=mfem::out)
Merge the local grid functions.
Abstract parallel finite element space.
const FiniteElementCollection * fec
Associated FE collection (not owned).
void SetPrintLevel(int print_lvl)
void AddDomainInterpolator(DiscreteInterpolator *di)
Adds a domain interpolator. Assumes ownership of di.
The BoomerAMG solver in hypre.
ParDiscreteCurlOperator(ParFiniteElementSpace *dfes, ParFiniteElementSpace *rfes)
virtual ~DivergenceFreeProjector()
virtual void Update()
Transform by the Space UpdateMatrix (e.g., on Mesh change).
void PrintAsOne(std::ostream &out=mfem::out)
void SetPrintLevel(int print_level)
virtual void Mult(const Vector &x, Vector &y) const
Operator application: y=A(x).
L2_ParFESpace(ParMesh *m, const int p, const int space_dim, int vdim=1, int order=Ordering::byNODES)
virtual ~ParDiscreteInterpolationOperator()
void SetMaxIter(int max_iter)
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
ParDiscreteGradOperator(ParFiniteElementSpace *dfes, ParFiniteElementSpace *rfes)
virtual ~IrrotationalProjector()
ND_ParFESpace(ParMesh *m, const int p, const int space_dim, int vdim=1, int order=Ordering::byNODES)
void VisualizeMesh(socketstream &sock, const char *vishost, int visport, Mesh &mesh, const char *title, int x, int y, int w, int h, const char *keys, bool vec)
RT_ParFESpace(ParMesh *m, const int p, const int space_dim, int vdim=1, int order=Ordering::byNODES)
ParDiscreteDivOperator(ParFiniteElementSpace *dfes, ParFiniteElementSpace *rfes)
void SetPreconditioner(HypreSolver &precond)
Set the hypre solver to be used as a preconditioner.
int open(const char hostname[], int port)
Arbitrary order H(curl)-conforming Nedelec finite elements.
void VisualizeField(socketstream &sock, const char *vishost, int visport, GridFunction &gf, const char *title, int x, int y, int w, int h, const char *keys, bool vec)
Arbitrary order H1-conforming (continuous) finite elements.
Class for parallel grid function.
Wrapper for hypre's ParCSR matrix class.
virtual void Assemble(int skip_zeros=1)
Construct the internal matrix representation of the discrete linear operator.
virtual void Mult(const HypreParVector &b, HypreParVector &x) const
Solve Ax=b with hypre's PCG.
Class for parallel meshes.
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
DivergenceFreeProjector(ParFiniteElementSpace &H1FESpace, ParFiniteElementSpace &HCurlFESpace, const int &irOrder, ParBilinearForm *s0=NULL, ParMixedBilinearForm *weakDiv=NULL, ParDiscreteGradOperator *grad=NULL)
Arbitrary order "L2-conforming" discontinuous finite elements.
ParFiniteElementSpace * ParFESpace() const