64#ifndef MADNESS_INTERIOR_BC_TEST_PROBLEMS_H__INCLUDED
65#define MADNESS_INTERIOR_BC_TEST_PROBLEMS_H__INCLUDED
89 if(key.
level() <= 1) {
156 error(
"Unknown mask");
181 printf(
"Solving problem: %s\nWavelet Order: %d\nThreshold: %.6e" \
182 "\nEpsilon: %.6e\nPenalty Prefactor, %s: %.6e\nUsing %s " \
183 "domain masking\n%s\n",
212 error(
"shouldn't be here...");
232 virtual std::vector< Vector<double, 3> >
check_pts()
const {
233 return std::vector< Vector<double, 3> >();
251 sprintf(str,
"Sphere radius: %.6e\n",
radius);
265 double r = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);
285 virtual std::vector< Vector<double, 3> >
check_pts()
const {
286 std::vector< Vector<double, 3> >
vec;
317 sprintf(str,
"Sphere radius: %.6e\n",
radius);
331 double r = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);
351 virtual std::vector< Vector<double, 3> >
check_pts()
const {
352 std::vector< Vector<double, 3> >
vec;
383 sprintf(str,
"Sphere radius: %.6e\n",
radius);
393 double r = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);
402 double r = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);
422 virtual std::vector< Vector<double, 3> >
check_pts()
const {
423 std::vector< Vector<double, 3> >
vec;
454 sprintf(str,
"Sphere radius: %.6e\n",
radius);
464 double r = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);
469 return 3.0* x[2] * x[2] / (r*r) - 1.0;
473 double r = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);
494 virtual std::vector< Vector<double, 3> >
check_pts()
const {
495 std::vector< Vector<double, 3> >
vec;
532 outvec = invec +
G(
f);
The constant on a sphere problem.
Definition test_problems.h:238
double SurfaceIntegral() const
The surface area of the domain.
Definition test_problems.h:277
double ExactSol(const Vector< double, 3 > &x) const
Definition test_problems.h:264
double VolumeIntegral() const
The volume of the domain.
Definition test_problems.h:281
bool isHomogeneous() const
Definition test_problems.h:242
double radius
Definition test_problems.h:240
ConstantSphere(int k, double thresh, double eps, std::string penalty_name, double penalty_prefact, double radius, Mask mask)
Definition test_problems.h:245
double Inhomogeneity(const Vector< double, 3 > &x) const
Definition test_problems.h:273
double DirichletCond(const Vector< double, 3 > &x) const
Definition test_problems.h:260
virtual std::vector< Vector< double, 3 > > check_pts() const
A list of points where we should compare the computed solution to the exact solution.
Definition test_problems.h:285
The cos(theta) on a sphere problem.
Definition test_problems.h:370
CosineSphere(int k, double thresh, double eps, std::string penalty_name, double penalty_prefact, double radius, Mask mask)
Definition test_problems.h:377
double DirichletCond(const Vector< double, 3 > &x) const
Definition test_problems.h:392
double SurfaceIntegral() const
The surface area of the domain.
Definition test_problems.h:414
double ExactSol(const Vector< double, 3 > &x) const
Definition test_problems.h:401
double VolumeIntegral() const
The volume of the domain.
Definition test_problems.h:418
bool isHomogeneous() const
Definition test_problems.h:374
virtual std::vector< Vector< double, 3 > > check_pts() const
A list of points where we should compare the computed solution to the exact solution.
Definition test_problems.h:422
double radius
Definition test_problems.h:372
double Inhomogeneity(const Vector< double, 3 > &x) const
Definition test_problems.h:410
The operator needed for solving for with GMRES.
Definition test_problems.h:513
DirichletCondIntOp(const SeparatedConvolution< double, 3 > &gin, const Function< double, 3 > &bin)
Definition test_problems.h:539
void action(const Function< double, 3 > &invec, Function< double, 3 > &outvec) const
Applies the operator to invec.
Definition test_problems.h:526
const SeparatedConvolution< double, 3 > & G
The Green's function.
Definition test_problems.h:516
const Function< double, 3 > & b
The surface function (normalized)
Definition test_problems.h:518
Abstract base class for embedded Dirichlet problems.
Definition test_problems.h:102
double thresh
Definition test_problems.h:107
EmbeddedDirichlet()
Definition test_problems.h:104
int k
Definition test_problems.h:106
virtual std::vector< Vector< double, 3 > > check_pts() const
A list of points where we should compare the computed solution to the exact solution.
Definition test_problems.h:232
virtual double VolumeIntegral() const =0
The volume of the domain.
FunctorOutput fop
Definition test_problems.h:127
virtual double Inhomogeneity(const Vector< double, 3 > &x) const =0
double eps
Definition test_problems.h:113
virtual double ExactSol(const Vector< double, 3 > &x) const =0
SignedDFInterface< 3 > * sdfi
Definition test_problems.h:112
EmbeddedDirichlet(double penalty_prefact, std::string penalty_name, double eps, int k, double thresh, Mask mask)
Sets up the data for the problem-inspecific parts.
Definition test_problems.h:132
double penalty_prefact
Definition test_problems.h:113
DomainMaskInterface * dmi
Definition test_problems.h:111
virtual double DirichletCond(const Vector< double, 3 > &x) const =0
std::string penalty_name
Definition test_problems.h:108
double operator()(const Vector< double, 3 > &x) const
The operator for projecting a MADNESS function.
Definition test_problems.h:191
virtual double SurfaceIntegral() const =0
The surface area of the domain.
void printout() const
Do a standard Printout of the problem details.
Definition test_problems.h:180
std::string problem_name
Definition test_problems.h:114
void load_balance(World &world, const Function< double, 3 > &f) const
Load balances using the provided Function.
Definition test_problems.h:169
virtual bool isHomogeneous() const =0
std::string domain_mask_name
Definition test_problems.h:116
std::string problem_specific_info
Definition test_problems.h:115
virtual ~EmbeddedDirichlet()
Definition test_problems.h:161
int initial_level
Definition test_problems.h:105
Definition test_derivative.cc:24
Definition dataloadbal.cc:141
The constant on a sphere problem, with inhomogeneity.
Definition test_problems.h:304
double DirichletCond(const Vector< double, 3 > &x) const
Definition test_problems.h:326
bool isHomogeneous() const
Definition test_problems.h:308
virtual std::vector< Vector< double, 3 > > check_pts() const
A list of points where we should compare the computed solution to the exact solution.
Definition test_problems.h:351
double radius
Definition test_problems.h:306
double SurfaceIntegral() const
The surface area of the domain.
Definition test_problems.h:343
double Inhomogeneity(const Vector< double, 3 > &x) const
Definition test_problems.h:339
double ExactSol(const Vector< double, 3 > &x) const
Definition test_problems.h:330
double VolumeIntegral() const
The volume of the domain.
Definition test_problems.h:347
InhomoConstantSphere(int k, double thresh, double eps, std::string penalty_name, double penalty_prefact, double radius, Mask mask)
Definition test_problems.h:311
The Y_2^0 on a sphere problem.
Definition test_problems.h:441
bool isHomogeneous() const
Definition test_problems.h:445
double radius
Definition test_problems.h:443
double SurfaceIntegral() const
The surface area of the domain.
Definition test_problems.h:486
double DirichletCond(const Vector< double, 3 > &x) const
Definition test_problems.h:463
double ExactSol(const Vector< double, 3 > &x) const
Definition test_problems.h:472
virtual std::vector< Vector< double, 3 > > check_pts() const
A list of points where we should compare the computed solution to the exact solution.
Definition test_problems.h:494
double Inhomogeneity(const Vector< double, 3 > &x) const
Definition test_problems.h:482
double VolumeIntegral() const
The volume of the domain.
Definition test_problems.h:490
Y20Sphere(int k, double thresh, double eps, std::string penalty_name, double penalty_prefact, double radius, Mask mask)
Definition test_problems.h:448
The interface for masking functions defined by signed distance functions.
Definition sdf_domainmask.h:104
virtual double mask(double d) const =0
Returns the characteristic mask function.
virtual double surface(double d) const =0
Returns the value of the normalized surface layer function.
static void redistribute(World &world, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &newpmap)
Sets the default process map and redistributes all functions using the old map.
Definition funcdefaults.h:513
static void set_initial_level(int value)
Sets the default initial projection level.
Definition funcdefaults.h:303
Abstract base class interface required for functors used as input to Functions.
Definition function_interface.h:68
FunctionNode holds the coefficients, etc., at each node of the 2^NDIM-tree.
Definition funcimpl.h:124
bool is_leaf() const
Returns true if this does not have children.
Definition funcimpl.h:210
A multiresolution adaptive numerical function.
Definition mra.h:122
void broaden(const BoundaryConditions< NDIM > &bc=FunctionDefaults< NDIM >::get_bc(), bool fence=true) const
Inplace broadens support in scaling function basis.
Definition mra.h:836
Function< T, NDIM > & scale(const Q q, bool fence=true)
Inplace, scale the function by a constant. No communication except for optional fence.
Definition mra.h:953
Function< T, NDIM > & truncate(double tol=0.0, bool fence=true)
Truncate the function with optional fence. Compresses with fence if not compressed.
Definition mra.h:602
Use a Gaussian for the surface function and the corresponding erf for the domain mask.
Definition sdf_domainmask.h:374
Key is the index for a node of the 2^NDIM-tree.
Definition key.h:66
Level level() const
Definition key.h:159
Provides the Li-Lowengrub-Ratz-Voight (LLRV) domain mask characteristic functions.
Definition sdf_domainmask.h:301
std::shared_ptr< WorldDCPmapInterface< keyT > > load_balance(double fac=1.0, bool printstuff=false)
Actually does the partitioning of the tree.
Definition lbdeux.h:320
void add_tree(const Function< T, NDIM > &f, const costT &costfn, bool fence=false)
Accumulates cost from a function.
Definition lbdeux.h:289
A generic operator: takes in one T and produces another T.
Definition gmres.h:62
A spherical surface (3 dimensions)
Definition sdf_shape_3D.h:103
Convolutions in separated form (including Gaussian)
Definition operator.h:136
The interface for a signed distance function (sdf).
Definition sdf_domainmask.h:74
virtual double sdf(const Vector< double, NDIM > &x) const =0
Returns the signed distance from the surface,.
A simple, fixed dimension vector.
Definition vector.h:64
A parallel world class.
Definition world.h:132
real_function_3d mask
Definition dirac-hatom.cc:27
Implements (2nd generation) static load/data balancing for functions.
Main include file for MADNESS and defines Function interface.
const double pi
Mathematical constant .
Definition constants.h:48
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
NDIM & f
Definition mra.h:2416
void error(const char *msg)
Definition world.cc:139
Vector< T, sizeof...(Ts)+1 > vec(T t, Ts... ts)
Factory function for creating a madness::Vector.
Definition vector.h:711
Implements the SignedDFInterface for common 3-D geometric objects.
Definition test_problems.h:80
double operator()(const Key< NDIM > &key, const FunctionNode< double, NDIM > &node) const
Definition test_problems.h:86
double parent_value
Definition test_problems.h:82
double leaf_value
Definition test_problems.h:81
DirichletLBCost(double leaf_value=1.0, double parent_value=1.0)
Definition test_problems.h:83
Mask
Definition test_problems.h:74
@ LLRV
Definition test_problems.h:74
@ Gaussian
Definition test_problems.h:74
FunctorOutput
Definition test_problems.h:76
@ EXACT
Definition test_problems.h:76
@ DIRICHLET_RHS
Definition test_problems.h:76
@ DOMAIN_MASK
Definition test_problems.h:76
@ SURFACE
Definition test_problems.h:76