47 double x =
p(0), y =
p(1);
75 double x =
p(0), y =
p(1);
76 double alpha = 1000.0;
77 double xc = 0.75, yc = 0.5;
79 double r = sqrt(pow(x - xc,2.0) + pow(y - yc,2.0));
80 double num = - ( alpha - pow(alpha,3) * (pow(r,2) - pow(r0,2)) );
81 double 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 = max(denom,1e-8);
87 int main(
int argc,
char *argv[])
90 const char *mesh_file =
"../data/star.mesh";
94 double double_max_elems = double(max_elems);
95 bool visualization =
true;
96 double 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++)
150 sol_sock.
open(vishost, visport);
155 int order_quad = 2*order + enriched_order;
156 for (
int i = 0; i < Geometry::NumGeom; ++i)
183 mfem::out <<
"Function 1 (discontinuous) \n";
198 sol_sock.precision(8);
199 sol_sock <<
"mesh\n" << mesh << flush;
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.
double jump_function(const Vector &p)
void ResetCoefficient(Coefficient &coeff_)
Reset the function f.
double singular_function(const Vector &p)
int GetNE() const
Returns number of elements.
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 SetMaxElements(long long max_elements_)
Set the maximum number of elements stopping criterion: stop when the input mesh has num_elements >= m...
double Normlp(double p) const
Returns the l_p norm of the vector.
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
virtual void SetCurvature(int order, bool discont=false, int space_dim=-1, int ordering=1)
void SetNCLimit(int nc_limit_)
Set the maximum ratio of refinement levels of adjacent elements (0 = unlimited). The default value is...
void PrintUsage(std::ostream &out) const
Print the usage message.
double p(const Vector &x, double t)
Refinement operator to control data oscillation.
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...
double affine_function(const Vector &p)
NURBSExtension * NURBSext
Optional NURBS mesh extension.
void SetThreshold(double threshold_)
Set the refinement threshold. The default value is 1.0e-2.
void PrintOptions(std::ostream &out) const
Print the options.
int open(const char hostname[], int port)
Open the socket stream on 'port' at 'hostname'.
A general function coefficient.
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)
bool Good() const
Return true if the command line options were parsed successfully.