141#include "../common/mfem-common.hpp"
177 std::vector<complex<real_t>> &E);
180 std::vector<complex<real_t>> &curlE);
183 std::vector<complex<real_t>> &curlcurlE);
202static const char *enum_str[] =
207 "pml_plane_wave_scatter",
213int main(
int argc,
char *argv[])
219 const char *mesh_file =
"../../data/inline-quad.mesh";
224 bool static_cond =
false;
229 bool with_pml =
false;
230 bool visualization =
true;
231 bool paraview =
false;
234 args.
AddOption(&mesh_file,
"-m",
"--mesh",
235 "Mesh file to use.");
237 "Finite element order (polynomial degree)");
238 args.
AddOption(&rnum,
"-rnum",
"--number-of-wavelengths",
239 "Number of wavelengths");
241 "Permeability of free space (or 1/(spring constant)).");
243 "Permittivity of free space (or mass constant).");
244 args.
AddOption(&iprob,
"-prob",
"--problem",
"Problem case"
245 " 0: plane wave, 1: Fichera 'oven', "
246 " 2: Generic PML problem with point source given as a load "
247 " 3: Scattering of a plane wave, "
248 " 4: Point source given on the boundary");
249 args.
AddOption(&delta_order,
"-do",
"--delta-order",
250 "Order enrichment for DPG test space.");
251 args.
AddOption(&theta,
"-theta",
"--theta",
252 "Theta parameter for AMR");
253 args.
AddOption(&sr,
"-sref",
"--serial-ref",
254 "Number of parallel refinements.");
255 args.
AddOption(&pr,
"-pref",
"--parallel-ref",
256 "Number of parallel refinements.");
257 args.
AddOption(&static_cond,
"-sc",
"--static-condensation",
"-no-sc",
258 "--no-static-condensation",
"Enable static condensation.");
259 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
260 "--no-visualization",
261 "Enable or disable GLVis visualization.");
262 args.
AddOption(¶view,
"-paraview",
"--paraview",
"-no-paraview",
264 "Enable or disable ParaView visualization.");
275 if (iprob > 4) { iprob = 0; }
277 omega = 2.*M_PI*rnum;
285 mesh_file =
"meshes/fichera-waveguide.mesh";
287 rnum =
omega/(2.*M_PI);
296 mesh_file =
"meshes/scatter.mesh";
304 Mesh mesh(mesh_file, 1, 1);
306 MFEM_VERIFY(
dim > 1,
"Dimension = 1 is not supported in this example");
310 for (
int i = 0; i<sr; i++)
325 ParMesh pmesh(MPI_COMM_WORLD, mesh);
358 int test_order = order+delta_order;
379 trial_fes.
Append(hatE_fes);
380 trial_fes.
Append(hatH_fes);
394 rot_mat(0,0) = 0.; rot_mat(0,1) = 1.;
395 rot_mat(1,0) = -1.; rot_mat(1,1) = 0.;
422 epsomeg_cf = &epsomeg;
423 negepsomeg_cf = &negepsomeg;
424 eps2omeg2_cf = &eps2omeg2;
426 negmuomeg_cf = &negmuomeg;
427 mu2omeg2_cf = &mu2omeg2;
429 negepsrot_cf = &negepsrot;
456 abs_detJ_Jt_J_inv_2);
458 abs_detJ_Jt_J_inv_2);
465 epsomeg_detJ_Jt_J_inv_i,attrPML);
467 epsomeg_detJ_Jt_J_inv_r,attrPML);
469 negepsomeg_detJ_Jt_J_inv_r,attrPML);
473 negmuomeg_detJ_Jt_J_inv_i,attrPML);
475 negmuomeg_detJ_Jt_J_inv_r,attrPML);
477 mu2omeg2_detJ_Jt_J_inv_2,attrPML);
479 eps2omeg2_detJ_Jt_J_inv_2,attrPML);
491 epsomeg_detJ_Jt_J_inv_i, rot);
493 epsomeg_detJ_Jt_J_inv_r, rot);
495 negepsomeg_detJ_Jt_J_inv_r, rot);
497 *epsomeg_detJ_Jt_J_inv_i_rot, attrPML);
499 *epsomeg_detJ_Jt_J_inv_r_rot, attrPML);
501 *negepsomeg_detJ_Jt_J_inv_r_rot, attrPML);
509 nullptr,TrialSpace::E_space, TestSpace::F_space);
511 a->AddTrialIntegrator(
nullptr,
513 TrialSpace::E_space,TestSpace::G_space);
516 nullptr,TrialSpace::H_space, TestSpace::G_space);
519 TrialSpace::hatH_space, TestSpace::G_space);
523 TestSpace::G_space,TestSpace::G_space);
526 TestSpace::G_space,TestSpace::G_space);
533 TrialSpace::H_space,TestSpace::F_space);
536 TrialSpace::hatE_space, TestSpace::F_space);
541 TestSpace::F_space, TestSpace::F_space);
544 TestSpace::F_space,TestSpace::F_space);
547 TestSpace::F_space, TestSpace::F_space);
550 TestSpace::F_space, TestSpace::G_space);
553 TestSpace::F_space, TestSpace::G_space);
556 TestSpace::G_space, TestSpace::F_space);
559 TestSpace::G_space, TestSpace::F_space);
562 TestSpace::G_space, TestSpace::G_space);
568 TrialSpace::H_space, TestSpace::F_space);
571 TrialSpace::hatE_space, TestSpace::F_space);
575 TestSpace::F_space, TestSpace::F_space);
578 TestSpace::F_space, TestSpace::F_space);
581 TestSpace::F_space, TestSpace::F_space);
583 a->AddTestIntegrator(
nullptr,
585 TestSpace::F_space, TestSpace::G_space);
588 TestSpace::F_space, TestSpace::G_space);
591 TestSpace::G_space, TestSpace::F_space);
593 a->AddTestIntegrator(
nullptr,
596 TestSpace::G_space, TestSpace::F_space);
599 TestSpace::G_space, TestSpace::G_space);
606 a->AddTrialIntegrator(
608 epsomeg_detJ_Jt_J_inv_i_restr)),
610 negepsomeg_detJ_Jt_J_inv_r_restr)),
611 TrialSpace::E_space,TestSpace::G_space);
617 a->AddTrialIntegrator(
619 negmuomeg_detJ_Jt_J_inv_i_restr)),
621 muomeg_detJ_Jt_J_inv_r_restr)),
622 TrialSpace::H_space, TestSpace::F_space);
625 a->AddTestIntegrator(
627 TestSpace::F_space, TestSpace::F_space);
632 negmuomeg_detJ_Jt_J_inv_i_restr),
634 TestSpace::F_space,TestSpace::G_space);
638 epsomeg_detJ_Jt_J_inv_i_restr),
640 TestSpace::F_space,TestSpace::G_space);
644 negmuomeg_detJ_Jt_J_inv_i_restr),
646 TestSpace::G_space, TestSpace::F_space);
650 epsomeg_detJ_Jt_J_inv_i_restr),
652 TestSpace::G_space, TestSpace::F_space);
655 eps2omeg2_detJ_Jt_J_inv_2_restr),
nullptr,
656 TestSpace::G_space, TestSpace::G_space);
663 a->AddTrialIntegrator(
666 TrialSpace::H_space, TestSpace::F_space);
669 a->AddTestIntegrator(
new MassIntegrator(mu2omeg2_detJ_2_restr),
nullptr,
670 TestSpace::F_space, TestSpace::F_space);
673 a->AddTestIntegrator(
676 TestSpace::F_space, TestSpace::G_space);
680 *epsomeg_detJ_Jt_J_inv_i_rot_restr),
682 TestSpace::F_space, TestSpace::G_space);
687 TestSpace::G_space, TestSpace::F_space);
690 a->AddTestIntegrator(
692 *epsomeg_detJ_Jt_J_inv_i_rot_restr)),
694 *epsomeg_detJ_Jt_J_inv_r_rot_restr)),
695 TestSpace::G_space, TestSpace::F_space);
698 eps2omeg2_detJ_Jt_J_inv_2_restr),
nullptr,
699 TestSpace::G_space, TestSpace::G_space);
725 std::cout <<
"\n Ref |"
730 std::cout <<
" L2 Error |"
733 std::cout <<
" Residual |"
735 <<
" PCG it |" << endl;
736 std::cout << std::string((
exact_known) ? 82 : 60,
'-')
765 if (static_cond) {
a->EnableStaticCondensation(); }
766 for (
int it = 0; it<=pr; it++)
785 for (
int j = 0; j < ess_tdof_list.
Size(); j++)
819 a->FormLinearSystem(ess_tdof_list,x,Ah, X,B);
830 int skip = (static_cond) ? 0 : 2;
831 int k = (static_cond) ? 2 : 0;
832 for (
int i=0; i<num_blocks; i++)
834 tdof_offsets[i+1] = trial_fes[i+k]->GetTrueVSize();
835 tdof_offsets[num_blocks+i+1] = trial_fes[i+k]->GetTrueVSize();
840 for (
int i = 0; i<num_blocks; i++)
842 for (
int j = 0; j<num_blocks; j++)
844 blockA.
SetBlock(i,j,&BlockA_r->GetBlock(i,j));
846 blockA.
SetBlock(i+num_blocks,j+num_blocks,&BlockA_r->GetBlock(i,j));
857 BlockA_r->GetBlock(0,0));
861 BlockA_r->GetBlock(1,1));
885 dynamic_cast<HypreAMS*
>(solver_hatH)->SetPrintLevel(0);
901 for (
int i = 0; i<num_blocks; i++)
908 a->RecoverFEMSolution(X,x);
910 Vector & residuals =
a->ComputeResidual(x);
914 real_t globalresidual = residual * residual;
916 MPI_MAX, MPI_COMM_WORLD);
917 MPI_Allreduce(MPI_IN_PLACE, &globalresidual, 1,
920 globalresidual = sqrt(globalresidual);
925 H_r.
MakeRef(H_fes,x, offsets[1]);
929 for (
int i = 0; i<trial_fes.
Size(); i++)
931 dofs += trial_fes[i]->GlobalTrueVSize();
947 L2Error = sqrt( E_err_r*E_err_r + E_err_i*E_err_i
948 + H_err_r*H_err_r + H_err_i*H_err_i );
949 rate_err = (it) ?
dim*log(err0/L2Error)/log((
real_t)dof0/dofs) : 0.0;
953 real_t rate_res = (it) ?
dim*log(res0/globalresidual)/log((
956 res0 = globalresidual;
961 std::ios oldState(
nullptr);
962 oldState.copyfmt(std::cout);
963 std::cout << std::right << std::setw(5) << it <<
" | "
964 << std::setw(10) << dof0 <<
" | "
965 << std::setprecision(1) << std::fixed
966 << std::setw(4) << 2.0*rnum <<
" π | "
967 << std::setprecision(3);
970 std::cout << std::setw(10) << std::scientific << err0 <<
" | "
971 << std::setprecision(2)
972 << std::setw(6) << std::fixed << rate_err <<
" | " ;
974 std::cout << std::setprecision(3)
975 << std::setw(10) << std::scientific << res0 <<
" | "
976 << std::setprecision(2)
977 << std::setw(6) << std::fixed << rate_res <<
" | "
978 << std::setw(6) << std::fixed << num_iter <<
" | "
980 std::cout.copyfmt(oldState);
985 const char * keys = (it == 0 &&
dim == 2) ?
"jRcml\n" :
nullptr;
989 "Numerical Electric field (real part)", 0, 0, 500, 500, keys);
991 "Numerical Magnetic field (real part)", 501, 0, 500, 500, keys);
1008 elements_to_refine.
SetSize(0);
1009 for (
int iel = 0; iel<pmesh.
GetNE(); iel++)
1011 if (residuals[iel] > theta * maxresidual)
1013 elements_to_refine.
Append(iel);
1023 for (
int i =0; i<trial_fes.
Size(); i++)
1025 trial_fes[i]->Update(
false);
1030 if (pml &&
dim == 2)
1032 delete epsomeg_detJ_Jt_J_inv_i_rot;
1033 delete epsomeg_detJ_Jt_J_inv_r_rot;
1034 delete negepsomeg_detJ_Jt_J_inv_r_rot;
1035 delete epsomeg_detJ_Jt_J_inv_i_rot_restr;
1036 delete epsomeg_detJ_Jt_J_inv_r_rot_restr;
1037 delete negepsomeg_detJ_Jt_J_inv_r_rot_restr;
1062 std::vector<std::complex<real_t>> E;
1065 for (
unsigned i = 0; i < E.size(); i++)
1067 E_r[i]= E[i].real();
1073 std::vector<std::complex<real_t>> E;
1076 for (
unsigned i = 0; i < E.size(); i++)
1078 E_i[i]= E[i].imag();
1084 std::vector<std::complex<real_t>> curlE;
1086 curlE_r.
SetSize(curlE.size());
1087 for (
unsigned i = 0; i < curlE.size(); i++)
1089 curlE_r[i]= curlE[i].real();
1095 std::vector<std::complex<real_t>> curlE;
1097 curlE_i.
SetSize(curlE.size());
1098 for (
unsigned i = 0; i < curlE.size(); i++)
1100 curlE_i[i]= curlE[i].imag();
1106 std::vector<std::complex<real_t>> curlcurlE;
1108 curlcurlE_r.
SetSize(curlcurlE.size());
1109 for (
unsigned i = 0; i < curlcurlE.size(); i++)
1111 curlcurlE_r[i]= curlcurlE[i].real();
1117 std::vector<std::complex<real_t>> curlcurlE;
1119 curlcurlE_i.
SetSize(curlcurlE.size());
1120 for (
unsigned i = 0; i < curlcurlE.size(); i++)
1122 curlcurlE_i[i]= curlcurlE[i].imag();
1134 for (
int i = 0; i<
dimc; i++)
1136 H_r(i) = - curlE_i(i) / (
omega *
mu);
1147 for (
int i = 0; i<
dimc; i++)
1149 H_i(i) = curlE_r(i) / (
omega *
mu);
1159 for (
int i = 0; i<
dim; i++)
1161 curlH_r(i) = -curlcurlE_i(i) / (
omega *
mu);
1171 for (
int i = 0; i<
dim; i++)
1173 curlH_i(i) = curlcurlE_r(i) / (
omega *
mu);
1190 hatE_r[1] = -E_r[0];
1207 hatE_i[1] = -E_i[0];
1244 for (
int i = 0; i<
dim; i++)
1257 for (
int i = 0; i<
dim; i++)
1265 complex<real_t> zi = complex<real_t>(0., 1.);
1267 for (
int i = 0; i <
dim; ++i)
1275 E[0] = exp(zi *
omega * (X.
Sum()));
1280 E[1] = exp(zi *
omega * (X(0)));
1285 if (abs(X(2) - 3.0) < 1e-10)
1287 E[0] = sin(M_PI*X(1));
1299 real_t x0 = X(0) + shift(0);
1300 real_t x1 = X(1) + shift(1);
1301 real_t r = sqrt(x0 * x0 + x1 * x1);
1305 complex<real_t> Ho, Ho_r, Ho_rr;
1308 Ho_rr = -k * k * (1_r /
beta *
1315 real_t r_xy = -(r_x / r) * r_y;
1316 real_t r_xx = (1.0 / r) * (1.0 - r_x * r_x);
1318 complex<real_t> val, val_xx, val_xy;
1319 val = 0.25_r * zi * Ho;
1320 val_xx = 0.25_r * zi * (r_xx * Ho_r + r_x * r_x * Ho_rr);
1321 val_xy = 0.25_r * zi * (r_xy * Ho_r + r_x * r_y * Ho_rr);
1322 E[0] = zi / k * (k * k * val + val_xx);
1323 E[1] = zi / k * val_xy;
1327 real_t x0 = X(0) + shift(0);
1328 real_t x1 = X(1) + shift(1);
1329 real_t x2 = X(2) + shift(2);
1330 real_t r = sqrt(x0 * x0 + x1 * x1 + x2 * x2);
1335 real_t r_xx = (1.0 / r) * (1.0 - r_x * r_x);
1336 real_t r_yx = -(r_y / r) * r_x;
1337 real_t r_zx = -(r_z / r) * r_x;
1339 complex<real_t> val, val_r, val_rr;
1340 val = exp(zi * k * r) / r;
1341 val_r = val / r * (zi * k * r - 1_r);
1342 val_rr = val / (r * r) * (-k * k * r * r
1343 - 2_r * zi * k * r + 2_r);
1345 complex<real_t> val_xx, val_yx, val_zx;
1346 val_xx = val_rr * r_x * r_x + val_r * r_xx;
1347 val_yx = val_rr * r_x * r_y + val_r * r_yx;
1348 val_zx = val_rr * r_x * r_z + val_r * r_zx;
1349 complex<real_t>
alpha = zi * k / 4_r /
real_t(M_PI) / k / k;
1350 E[0] =
alpha * (k * k * val + val_xx);
1351 E[1] =
alpha * val_yx;
1352 E[2] =
alpha * val_zx;
1358 MFEM_ABORT(
"Should be unreachable");
1364 std::vector<complex<real_t>> &curlE)
1366 complex<real_t> zi = complex<real_t>(0., 1.);
1368 for (
int i = 0; i <
dimc; ++i)
1376 std::complex<real_t> pw = exp(zi *
omega * (X.
Sum()));
1380 curlE[1] = zi *
omega * pw;
1381 curlE[2] = -zi *
omega * pw;
1385 curlE[0] = -zi *
omega * pw;
1391 std::complex<real_t> pw = exp(zi *
omega * (X(0)));
1392 curlE[0] = zi *
omega * pw;
1396 MFEM_ABORT(
"Should be unreachable");
1402 std::vector<complex<real_t>> &curlcurlE)
1404 complex<real_t> zi = complex<real_t>(0., 1.);
1405 curlcurlE.resize(
dim);
1406 for (
int i = 0; i <
dim; ++i)
1414 std::complex<real_t> pw = exp(zi *
omega * (X.
Sum()));
1430 std::complex<real_t> pw = exp(zi *
omega * (X(0)));
1435 MFEM_ABORT(
"Should be unreachable");
1445 for (
int i = 0; i <
dim; ++i)
1447 r += pow(x[i] - center[i], 2.);
1450 real_t coeff = pow(n, 2) / M_PI;
Dynamic 2D array using row-major layout.
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.
int Size() const
Return the logical size of the array.
void PartialSum()
Fill the entries of the array with the cumulative sum of the entries.
int Append(const T &el)
Append element 'el' to array, resize if necessary.
T & Last()
Return the last element in the array.
A class to handle Block diagonal preconditioners in a matrix-free implementation.
Operator & GetDiagonalBlock(int iblock)
Return a reference to block i,i.
void SetDiagonalBlock(int iblock, Operator *op)
Add a square block op in the block-entry (iblock, iblock).
A class to handle Block systems in a matrix-free implementation.
void SetBlock(int iRow, int iCol, Operator *op, real_t c=1.0)
Add a block op in the block-entry (iblock, jblock).
Operator & GetBlock(int i, int j)
Return a reference to block i,j.
int NumRowBlocks() const
Return the number of row blocks.
Conjugate gradient method.
virtual void SetOperator(const Operator &op)
Also calls SetOperator for the preconditioner if there is one.
virtual void Mult(const Vector &b, Vector &x) const
Iterative solution of the linear system using the Conjugate Gradient method.
Class for setting up a simple Cartesian PML region.
void SetEpsilonAndMu(real_t epsilon_, real_t mu_)
void SetAttributes(Mesh *mesh_, Array< int > *attrNonPML=nullptr, Array< int > *attrPML=nullptr)
Mark element in the PML region.
void SetOmega(real_t omega_)
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
Mimic the action of a complex operator using two real operators.
virtual Operator & imag()
virtual Operator & real()
Real or imaginary part accessor methods.
A coefficient that is constant across space and time.
Integrator for for Nedelec elements.
virtual void RegisterField(const std::string &field_name, GridFunction *gf)
Add a grid function to the collection.
void SetCycle(int c)
Set time cycle (for time-dependent simulations)
void SetTime(real_t t)
Set physical time (for time-dependent simulations)
void SetPrefixPath(const std::string &prefix)
Set the path where the DataCollection will be saved.
Data type dense matrix using column-major storage.
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
int GetVSize() const
Return the number of vector dofs, i.e. GetNDofs() x GetVDim().
void ProjectBdrCoefficientNormal(VectorCoefficient &vcoeff, const Array< int > &bdr_attr)
Arbitrary order H1-conforming (continuous) finite elements.
Arbitrary order "H^{1/2}-conforming" trace finite elements defined on the interface between mesh elem...
The Auxiliary-space Maxwell Solver in hypre.
void SetPrintLevel(int print_lvl)
The BoomerAMG solver in hypre.
void SetSystemsOptions(int dim, bool order_bynodes=false)
void SetPrintLevel(int print_level)
Wrapper for hypre's ParCSR matrix class.
Abstract class for hypre's solvers and preconditioners.
static void Init()
Initialize hypre by calling HYPRE_Init() and set default options. After calling Hypre::Init(),...
void SetRelTol(real_t rtol)
virtual void SetPreconditioner(Solver &pr)
This should be called before SetOperator.
int GetNumIterations() const
Returns the number of iterations taken during the last call to Mult()
virtual void SetPrintLevel(int print_lvl)
Legacy method to set the level of verbosity of the solver output.
void SetMaxIter(int max_it)
Arbitrary order "L2-conforming" discontinuous finite elements.
Base class for Matrix Coefficients that optionally depend on time and space.
A matrix coefficient that is constant in space and time.
Matrix coefficient defined as the product of two matrices.
Derived matrix coefficient that has the value of the parent matrix coefficient where it is active and...
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
void GeneralRefinement(const Array< Refinement > &refinements, int nonconforming=-1, int nc_limit=0)
void Clear()
Clear the contents of the Mesh.
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
void EnsureNCMesh(bool simplices_nonconforming=false)
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
static int WorldRank()
Return the MPI rank in MPI_COMM_WORLD.
static void Init(int &argc, char **&argv, int required=default_thread_required, int *provided=nullptr)
Singleton creation with Mpi::Init(argc, argv).
Arbitrary order H(curl)-conforming Nedelec finite elements.
Arbitrary order H(curl)-trace finite elements defined on the interface between mesh elements (faces,...
Pointer to an Operator of a specified type.
OpType * As() const
Return the Operator pointer statically cast to a specified OpType. Similar to the method Get().
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
void PrintUsage(std::ostream &out) const
Print the usage message.
void PrintOptions(std::ostream &out) const
Print the options.
void AddOption(bool *var, const char *enable_short_name, const char *enable_long_name, const char *disable_short_name, const char *disable_long_name, const char *description, bool required=false)
Add a boolean option and set 'var' to receive the value. Enable/disable tags are used to set the bool...
bool Good() const
Return true if the command line options were parsed successfully.
Abstract parallel finite element space.
void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1) const override
int GetTrueVSize() const override
Return the number of local vector true dofs.
Class for parallel grid function.
real_t ComputeL2Error(Coefficient *exsol[], const IntegrationRule *irs[]=NULL, const Array< int > *elems=NULL) const override
void MakeRef(FiniteElementSpace *f, real_t *v) override
Make the ParGridFunction reference external data on a new FiniteElementSpace.
void ProjectBdrCoefficientTangent(VectorCoefficient &vcoeff, const Array< int > &bdr_attr) override
Project the tangential components of the given VectorCoefficient on the boundary. Only boundary attri...
Class for parallel meshes.
Helper class for ParaView visualization data.
void SetHighOrderOutput(bool high_order_output_)
void SetLevelsOfDetail(int levels_of_detail_)
virtual void Save() override
void SetDataFormat(VTKFormat fmt)
Scalar coefficient defined as the product of two scalar coefficients or a scalar and a scalar coeffic...
Arbitrary order "H^{-1/2}-conforming" face finite elements defined on the interface between mesh elem...
Derived coefficient that takes the value of the parent coefficient for the active attributes and is z...
Matrix coefficient defined as a product of a scalar coefficient and a matrix coefficient.
for VectorFiniteElements (Nedelec, Raviart-Thomas)
A general vector function coefficient.
real_t Norml2() const
Returns the l2 norm of the vector.
real_t Max() const
Returns the maximal element of the vector.
int Size() const
Returns the size of the vector.
real_t Sum() const
Return the sum of the vector entries.
void SetSize(int s)
Resize the vector to size s.
real_t f(const Vector &p)
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)
real_t detJ_r_function(const Vector &x, CartesianPML *pml)
PML stretching functions: See https://doi.org/10.1006/jcph.1994.1159.
void detJ_Jt_J_inv_r_function(const Vector &x, CartesianPML *pml, DenseMatrix &M)
real_t abs_detJ_2_function(const Vector &x, CartesianPML *pml)
real_t detJ_i_function(const Vector &x, CartesianPML *pml)
void abs_detJ_Jt_J_inv_2_function(const Vector &x, CartesianPML *pml, DenseMatrix &M)
void detJ_Jt_J_inv_i_function(const Vector &x, CartesianPML *pml, DenseMatrix &M)
void curlE_exact_i(const Vector &x, Vector &curlE_i)
void H_exact_i(const Vector &x, Vector &H_i)
void curlcurlE_exact_r(const Vector &x, Vector &curlcurlE_r)
void source_function(const Vector &x, Vector &f)
void hatH_exact_r(const Vector &X, Vector &hatH_r)
void hatE_exact_r(const Vector &X, Vector &hatE_r)
void H_exact_r(const Vector &x, Vector &H_r)
real_t hatH_exact_scalar_i(const Vector &X)
void curlH_exact_r(const Vector &x, Vector &curlH_r)
real_t hatH_exact_scalar_r(const Vector &X)
void rhs_func_r(const Vector &x, Vector &J_r)
void hatH_exact_i(const Vector &X, Vector &hatH_i)
void rhs_func_i(const Vector &x, Vector &J_i)
void curlcurlE_exact_i(const Vector &x, Vector &curlcurlE_i)
void E_exact_r(const Vector &x, Vector &E_r)
void maxwell_solution_curlcurl(const Vector &X, std::vector< complex< real_t > > &curlcurlE)
void E_exact_i(const Vector &x, Vector &E_i)
void hatE_exact_i(const Vector &X, Vector &hatE_i)
void maxwell_solution_curl(const Vector &X, std::vector< complex< real_t > > &curlE)
void maxwell_solution(const Vector &X, std::vector< complex< real_t > > &E)
void curlE_exact_r(const Vector &x, Vector &curlE_r)
void curlH_exact_i(const Vector &x, Vector &curlH_i)
Helper struct to convert a C++ type to an MPI type.