61 if (
p.Normlp(2.0) > 0.4 &&
p.Normlp(2.0) < 0.6)
77 real_t xc = 0.75, yc = 0.5;
79 real_t r = sqrt(pow(x - xc,2.0) + pow(y - yc,2.0));
81 real_t denom = pow(r * ( pow(
alpha,2) * pow(r0,2) + pow(
alpha,2) * pow(r,2) \
82 - 2 * pow(
alpha,2) * r0 * r + 1.0 ),2);
83 denom = std::max(denom, (
real_t) 1.0e-8);
87int main(
int argc,
char *argv[])
96 const char *mesh_file =
"../data/star.mesh";
101 bool visualization =
true;
102 bool nc_simplices =
true;
103 real_t osc_threshold = 1e-3;
104 int enriched_order = 5;
107 args.
AddOption(&mesh_file,
"-m",
"--mesh",
108 "Mesh file to use.");
110 "Finite element order (polynomial degree).");
111 args.
AddOption(&nc_limit,
"-l",
"--nc-limit",
112 "Maximum level of hanging nodes.");
113 args.
AddOption(&double_max_elems,
"-me",
"--max-elems",
114 "Stop after reaching this many elements.");
115 args.
AddOption(&osc_threshold,
"-e",
"--error",
116 "relative data oscillation threshold.");
117 args.
AddOption(&enriched_order,
"-eo",
"--enriched_order",
118 "Enriched quadrature order.");
119 args.
AddOption(&nc_simplices,
"-ns",
"--nonconforming-simplices",
120 "-cs",
"--conforming-simplices",
121 "For simplicial meshes, enable/disable nonconforming"
123 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
124 "--no-visualization",
125 "Enable or disable GLVis visualization.");
140 max_elems = int(double_max_elems);
141 Mesh mesh(mesh_file, 1, 1);
148 for (
int i = 0; i < 2; i++)
163 ParMesh pmesh(MPI_COMM_WORLD, mesh);
183 int order_quad = 2*order + enriched_order;
207 mfem::out <<
"Number of Elements " << globalNE <<
"\n";
208 mfem::out <<
"Osc error " << osc <<
"\n";
216 osc = coeffrefiner.
GetOsc();
220 mfem::out <<
"Function 1 (discontinuous) \n";
221 mfem::out <<
"Number of Elements " << globalNE <<
"\n";
222 mfem::out <<
"Osc error " << osc <<
"\n";
230 osc = coeffrefiner.
GetOsc();
235 mfem::out <<
"Number of Elements " << globalNE <<
"\n";
236 mfem::out <<
"Osc error " << osc <<
"\n";
241 sol_sock.precision(8);
242 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
243 sol_sock <<
"mesh\n" << pmesh << flush;
Refinement operator to control data oscillation.
void SetNCLimit(int nc_limit_)
Set the maximum ratio of refinement levels of adjacent elements (0 = unlimited). The default value is...
void SetMaxElements(long long max_elements_)
Set the maximum number of elements stopping criterion: stop when the input mesh has num_elements >= m...
void SetIntRule(const IntegrationRule *irs_[])
virtual int PreprocessMesh(Mesh &mesh, int max_it)
Apply the operator to the mesh max_it times or until tolerance achieved.
void SetThreshold(real_t threshold_)
Set the refinement threshold. The default value is 1.0e-2.
void ResetCoefficient(Coefficient &coeff_)
Reset the function f.
A general function coefficient.
static void Init()
Initialize hypre by calling HYPRE_Init() and set default options. After calling Hypre::Init(),...
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.
NURBSExtension * NURBSext
Optional NURBS mesh extension.
void Clear()
Clear the contents of the Mesh.
long long GetGlobalNE() const
Return the total (global) number of elements.
void EnsureNCMesh(bool simplices_nonconforming=false)
virtual void SetCurvature(int order, bool discont=false, int space_dim=-1, int ordering=1)
Set the curvature of the mesh nodes using the given polynomial degree.
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
static int WorldRank()
Return the MPI rank in MPI_COMM_WORLD.
static int WorldSize()
Return the size of 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).
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.
Class for parallel meshes.
int open(const char hostname[], int port)
Open the socket stream on 'port' at 'hostname'.
real_t affine_function(const Vector &p)
real_t singular_function(const Vector &p)
real_t jump_function(const Vector &p)
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
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)