12#ifndef MFEM_COMPLEX_FEM
13#define MFEM_COMPLEX_FEM
87 { *gfr = value.real(); *gfi = value.imag();
return *
this; }
131 return sqrt(err_r * err_r + err_i * err_i);
147 return sqrt(err_r * err_r + err_i * err_i);
151 virtual void Save(std::ostream &
out)
const;
155 virtual void Save(
const char *fname,
int precision=16)
const;
164std::ostream &
operator<<(std::ostream &
out,
const ComplexGridFunction &sol);
204 { *
lfr = value.real(); *
lfi = value.imag();
return *
this; }
208 convention) { conv = convention; }
324 convention) { conv = convention; }
399 int copy_interior = 0);
480 { *pgfr = value.real(); *pgfi = value.imag();
return *
this; }
536 return hypot(err_r, err_i);
553 return hypot(err_r, err_i);
559 void Save(std::ostream &
out)
const;
565 void Save(
const char *fname,
int precision=16)
const;
573std::ostream &
operator<<(std::ostream &
out,
const ParComplexGridFunction &sol);
618 { *
plfr = value.real(); *
plfi = value.imag();
return *
this; }
622 convention) { conv = convention; }
740 convention) { conv = convention; }
821 int copy_interior = 0);
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
virtual void ProjectBdrCoefficientTangent(VectorCoefficient &real_coeff, VectorCoefficient &imag_coeff, Array< int > &attr)
virtual void ProjectBdrCoefficient(Coefficient &real_coeff, Coefficient &imag_coeff, Array< int > &attr)
virtual void ProjectCoefficient(Coefficient &real_coeff, Coefficient &imag_coeff)
const GridFunction & imag() const
const FiniteElementSpace * FESpace() const
virtual real_t ComputeL2Error(VectorCoefficient &exsolr, VectorCoefficient &exsoli, const IntegrationRule *irs[]=NULL, Array< int > *elems=NULL) const
Returns ||u_ex - u_h||_L2 for complex-valued vector fields.
FiniteElementCollection * fec_owned
Used when the grid function is read from a file. It can also be set explicitly, see MakeOwner().
void MakeOwner(FiniteElementCollection *fec_)
Make the ComplexGridFunction the owner of fec_owned and fes.
FiniteElementSpace * FESpace()
ComplexGridFunction & operator=(const std::complex< real_t > &value)
Assign constant values to the ComplexGridFunction data.
virtual void ProjectBdrCoefficientNormal(VectorCoefficient &real_coeff, VectorCoefficient &imag_coeff, Array< int > &attr)
ComplexGridFunction(FiniteElementSpace *f)
Construct a ComplexGridFunction associated with the FiniteElementSpace *f.
virtual void Save(std::ostream &out) const
Save the ComplexGridFunction to an output stream.
const GridFunction & real() const
virtual real_t ComputeL2Error(Coefficient &exsolr, Coefficient &exsoli, const IntegrationRule *irs[]=NULL) const
Returns ||u_ex - u_h||_L2 for complex-valued scalar fields.
virtual ~ComplexGridFunction()
Destroys the grid function.
FiniteElementCollection * OwnFEC()
Specialization of the ComplexOperator built from a pair of HypreParMatrices.
@ HERMITIAN
Native convention for Hermitian operators.
Specialization of the ComplexOperator built from a pair of Sparse Matrices.
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Class for grid function - Vector with associated FE space.
virtual real_t ComputeL2Error(Coefficient *exsol[], const IntegrationRule *irs[]=NULL, const Array< int > *elems=NULL) const
Returns ||exsol - u_h||_L2 for scalar or vector H1 or L2 elements.
Wrapper for hypre's parallel vector class.
Class for an integration rule - an Array of IntegrationPoint.
Pointer to an Operator of a specified type.
DiagonalPolicy
Defines operator diagonal policy upon elimination of rows and/or columns.
@ DIAG_ONE
Set the diagonal value to one.
FiniteElementSpace * FESpace()
const ParFiniteElementSpace * ParFESpace() const
const FiniteElementSpace * FESpace() const
void MakeOwner(FiniteElementCollection *fec_)
Make the ParComplexGridFunction the owner of fec_owned and pfes.
virtual void ProjectBdrCoefficient(Coefficient &real_coeff, Coefficient &imag_coeff, Array< int > &attr)
FiniteElementCollection * fec_owned
Used when the grid function is read from a file. It can also be set explicitly, see MakeOwner().
void ParallelProject(Vector &tv) const
Returns the vector restricted to the true dofs.
ParComplexGridFunction(ParFiniteElementSpace *pf)
Construct a ParComplexGridFunction associated with the ParFiniteElementSpace *pf.
ParFiniteElementSpace * ParFESpace()
virtual void ProjectBdrCoefficientNormal(VectorCoefficient &real_coeff, VectorCoefficient &imag_coeff, Array< int > &attr)
ParFiniteElementSpace * pfes
const ParGridFunction & real() const
void Distribute(const Vector *tv)
virtual void ProjectBdrCoefficientTangent(VectorCoefficient &real_coeff, VectorCoefficient &imag_coeff, Array< int > &attr)
virtual real_t ComputeL2Error(Coefficient &exsolr, Coefficient &exsoli, const IntegrationRule *irs[]=NULL, Array< int > *elems=NULL) const
Returns ||u_ex - u_h||_L2 in parallel for complex-valued scalar fields.
virtual ~ParComplexGridFunction()
Destroys grid function.
virtual void ProjectCoefficient(Coefficient &real_coeff, Coefficient &imag_coeff)
ParComplexGridFunction & operator=(const std::complex< real_t > &value)
Assign constant values to the ParComplexGridFunction data.
void Distribute(const Vector &tv)
const ParGridFunction & imag() const
FiniteElementCollection * OwnFEC()
void Save(std::ostream &out) const
Save the local portion of the ParComplexGridFunction.
virtual real_t ComputeL2Error(VectorCoefficient &exsolr, VectorCoefficient &exsoli, const IntegrationRule *irs[]=NULL, Array< int > *elems=NULL) const
Returns ||u_ex - u_h||_L2 in parallel for complex-valued vector fields.
Abstract parallel finite element space.
Class for parallel grid function.
real_t ComputeL2Error(Coefficient *exsol[], const IntegrationRule *irs[]=NULL, const Array< int > *elems=NULL) const override
Returns ||u_ex - u_h||_L2 in parallel for H1 or L2 elements.
Class for parallel meshes.
Base class for vector Coefficients that optionally depend on time and space.
void SyncAliasMemory(const Vector &v) const
Update the alias memory location of the vector to match v.
void SyncMemory(const Vector &v) const
Update the memory location of the vector to match v.
std::ostream & operator<<(std::ostream &os, SparseMatrix const &mat)
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
AssemblyLevel
Enumeration defining the assembly level for bilinear and nonlinear form classes derived from Operator...
std::function< real_t(const Vector &)> f(real_t mass_coeff)