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)
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);
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"; }
303 connection_failed = !sock && !newly_opened;
305 MPI_Bcast(&connection_failed, 1, MPI_INT, 0, comm);
307 while (connection_failed);
312 int x,
int y,
int w,
int h,
const char *keys,
bool vec)
315 MPI_Comm comm = pmesh.
GetComm();
318 MPI_Comm_size(comm, &num_procs);
319 MPI_Comm_rank(comm, &myid);
321 bool newly_opened =
false;
322 int connection_failed;
330 sock.
open(vishost, visport);
334 sock <<
"solution\n";
340 if (myid == 0 && newly_opened)
342 sock <<
"window_title '" << title <<
"'\n"
343 <<
"window_geometry "
344 << x <<
" " << y <<
" " << w <<
" " << h <<
"\n";
345 if ( keys ) { sock <<
"keys " << keys <<
"\n"; }
346 else { sock <<
"keys maaAc"; }
347 if ( vec ) { sock <<
"vvv"; }
353 connection_failed = !sock && !newly_opened;
355 MPI_Bcast(&connection_failed, 1, MPI_INT, 0, comm);
357 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.
ParMesh * GetParMesh() const
virtual void Mult(const Vector &x, Vector &y) const
Operator application: y=A(x).
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 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.
bool is_open()
True if the socketstream is open, false otherwise.
double p(const Vector &x, double t)
ParDiscreteGradOperator(ParFiniteElementSpace *dfes, ParFiniteElementSpace *rfes)
virtual ~IrrotationalProjector()
void SaveAsOne(const char *fname, int precision=16) const
ND_ParFESpace(ParMesh *m, const int p, const int space_dim, int vdim=1, int order=Ordering::byNODES)
RT_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)
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)
Open the socket stream on 'port' at 'hostname'.
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)
void PrintAsOne(std::ostream &out=mfem::out) const
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