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)
135 if ( weakDiv_ == NULL )
169void IrrotationalProjector::InitSolver()
const
186 weakDiv_->
Mult(x,*xDiv_); *xDiv_ *= -1.0;
193 if ( pcg_ == NULL ) { this->InitSolver(); }
194 pcg_->
Mult(RHS_, Psi_);
200 grad_->
Mult(*psi_, y);
205 delete pcg_; pcg_ = NULL;
206 delete amg_; amg_ = NULL;
234DivergenceFreeProjector
260 ParMesh &pmesh,
const char *title,
261 int x,
int y,
int w,
int h,
const char *keys)
263 MPI_Comm comm = pmesh.
GetComm();
266 MPI_Comm_size(comm, &num_procs);
267 MPI_Comm_rank(comm, &myid);
269 bool newly_opened =
false;
270 int connection_failed;
287 if (myid == 0 && newly_opened)
289 sock <<
"window_title '" << title <<
"'\n"
290 <<
"window_geometry "
291 << x <<
" " << y <<
" " << w <<
" " << h <<
"\n";
292 if ( keys ) { sock <<
"keys " << keys <<
"\n"; }
298 connection_failed = !sock && !newly_opened;
300 MPI_Bcast(&connection_failed, 1, MPI_INT, 0, comm);
302 while (connection_failed);
306 Mesh &mesh, MPI_Comm comm,
const char *title,
307 int x,
int y,
int w,
int h,
const char *keys)
310 MPI_Comm_size(comm, &num_procs);
311 MPI_Comm_rank(comm, &myid);
313 bool newly_opened =
false;
314 int connection_failed;
316 const int max_tries = 5;
327 sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
328 sock <<
"mesh\n" << mesh << std::flush;
332 sock <<
"window_title '" << title <<
"'\n"
333 <<
"window_geometry "
334 << x <<
" " << y <<
" " << w <<
" " << h <<
"\n";
335 if ( keys ) { sock <<
"keys " << keys <<
"\n"; }
337 newly_opened =
false;
339 connection_failed = !sock && !newly_opened;
341 while (connection_failed && ++ntries < max_tries);
346 int x,
int y,
int w,
int h,
const char *keys,
bool vec)
349 MPI_Comm comm = pmesh.
GetComm();
352 MPI_Comm_size(comm, &num_procs);
353 MPI_Comm_rank(comm, &myid);
355 bool newly_opened =
false;
356 int connection_failed;
368 sock <<
"solution\n";
374 if (myid == 0 && newly_opened)
376 sock <<
"window_title '" << title <<
"'\n"
377 <<
"window_geometry "
378 << x <<
" " << y <<
" " << w <<
" " << h <<
"\n";
379 if ( keys ) { sock <<
"keys " << keys <<
"\n"; }
380 else { sock <<
"keys maaAc"; }
381 if ( vec ) { sock <<
"vvv"; }
387 connection_failed = !sock && !newly_opened;
389 MPI_Bcast(&connection_failed, 1, MPI_INT, 0, comm);
391 while (connection_failed);
395 const GridFunction &gf, MPI_Comm comm,
const char *title,
396 int x,
int y,
int w,
int h,
const char *keys,
bool vec)
400 MPI_Comm_rank(comm, &myid);
401 MPI_Comm_size(comm, &num_procs);
403 bool newly_opened =
false;
404 bool connection_failed;
406 const int max_tries = 5;
417 sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
418 sock <<
"solution " << mesh << gf << std::flush;
422 sock <<
"window_title '" << title <<
"'\n"
423 <<
"window_geometry "
424 << x <<
" " << y <<
" " << w <<
" " << h <<
"\n";
425 if ( keys ) { sock <<
"keys " << keys <<
"\n"; }
426 else { sock <<
"keys maaAc"; }
427 if ( vec ) { sock <<
"vvv"; }
429 newly_opened =
false;
431 connection_failed = !sock && !newly_opened;
433 while (connection_failed && ++ntries < max_tries);
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
void AddDomainInterpolator(DiscreteInterpolator *di)
Adds a domain interpolator. Assumes ownership of di.
virtual void Assemble(int skip_zeros=1)
Construct the internal matrix representation of the discrete linear operator.
const FiniteElementCollection * fec
Associated FE collection (not owned).
Mesh * GetMesh() const
Returns the mesh.
Class for grid function - Vector with associated FE space.
FiniteElementSpace * FESpace()
Arbitrary order H1-conforming (continuous) finite elements.
The BoomerAMG solver in hypre.
void SetPrintLevel(int print_level)
void Mult(const HypreParVector &b, HypreParVector &x) const override
Solve Ax=b with hypre's PCG.
void SetPrintLevel(int print_lvl)
void SetPreconditioner(HypreSolver &precond)
Set the hypre solver to be used as a preconditioner.
void SetMaxIter(int max_iter)
Wrapper for hypre's ParCSR matrix class.
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 SetIntRule(const IntegrationRule *ir)
Prescribe a fixed IntegrationRule to use, or set to null to let the integrator choose an appropriate ...
Arbitrary order "L2-conforming" discontinuous finite elements.
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
Geometry::Type GetTypicalElementGeometry() const
If the local mesh is not empty, return GetElementGeometry(0); otherwise, return a typical Geometry pr...
Arbitrary order H(curl)-conforming Nedelec finite elements.
Abstract parallel finite element space.
void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1) const override
ParMesh * GetParMesh() const
Class for parallel grid function.
ParFiniteElementSpace * ParFESpace() const
void SaveAsOne(const char *fname, int precision=16) const
void Update() override
Transform by the Space UpdateMatrix (e.g., on Mesh change).
Class for parallel meshes.
void PrintAsOne(std::ostream &out=mfem::out, const std::string &comments="") const
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
void Mult(const Vector &x, Vector &y) const override
Operator application: y=A(x).
virtual ~DivergenceFreeProjector()
H1_ParFESpace(ParMesh *m, const int p, const int space_dim=3, const int type=BasisType::GaussLobatto, int vdim=1, int order=Ordering::byNODES)
virtual ~IrrotationalProjector()
void Mult(const Vector &x, Vector &y) const override
Operator application: y=A(x).
L2_ParFESpace(ParMesh *m, const int p, const int space_dim, int vdim=1, int order=Ordering::byNODES)
ND_ParFESpace(ParMesh *m, const int p, const int space_dim, int vdim=1, int order=Ordering::byNODES)
ParDiscreteCurlOperator(ParFiniteElementSpace *dfes, ParFiniteElementSpace *rfes)
ParDiscreteDivOperator(ParFiniteElementSpace *dfes, ParFiniteElementSpace *rfes)
ParDiscreteGradOperator(ParFiniteElementSpace *dfes, ParFiniteElementSpace *rfes)
virtual ~ParDiscreteInterpolationOperator()
RT_ParFESpace(ParMesh *m, const int p, const int space_dim, int vdim=1, int order=Ordering::byNODES)
int open(const char hostname[], int port)
Open the socket stream on 'port' at 'hostname'.
bool is_open()
True if the socketstream is open, false otherwise.
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)
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)
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
real_t p(const Vector &x, real_t t)