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[])
90 const char *mesh_file =
"../data/star.mesh";
93 int max_elems = 100*1000;
95 bool visualization =
true;
96 real_t osc_threshold = 1e-3;
97 int enriched_order = 5;
100 args.
AddOption(&mesh_file,
"-m",
"--mesh",
101 "Mesh file to use.");
103 "Finite element order (polynomial degree).");
104 args.
AddOption(&nc_limit,
"-l",
"--nc-limit",
105 "Maximum level of hanging nodes.");
106 args.
AddOption(&double_max_elems,
"-me",
"--max-elems",
107 "Stop after reaching this many elements.");
108 args.
AddOption(&osc_threshold,
"-e",
"--error",
109 "relative data oscillation threshold.");
110 args.
AddOption(&enriched_order,
"-eo",
"--enriched_order",
111 "Enriched quadrature order.");
112 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
113 "--no-visualization",
114 "Enable or disable GLVis visualization.");
123 max_elems = int(double_max_elems);
124 Mesh mesh(mesh_file, 1, 1);
131 for (
int i = 0; i < 2; i++)
155 int order_quad = 2*order + enriched_order;
183 mfem::out <<
"Function 1 (discontinuous) \n";
198 sol_sock.precision(8);
199 sol_sock <<
"mesh\n" << mesh << 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.
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.
int GetNE() const
Returns number of elements.
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 *)
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.
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)