10#ifndef SRC_APPS_CHEM_GUESSFACTORY_H_
11#define SRC_APPS_CHEM_GUESSFACTORY_H_
18namespace guessfactory{
21#define SPLITCOORD(x,y,z,r) double x=r[0]-origin[0]; double y=r[1]-origin[1];double z=r[2]-origin[2];
26template<
typename T, std::
size_t NDIM>
27std::vector<coord_3d>
compute_centroids(
const std::vector<Function<T,NDIM> > & vf);
30template<
typename T,
size_t NDIM>
34 for (
size_t i = 0; i <
NDIM; ++i)
53 std::shared_ptr<FunctionFunctorInterface<double,3> >
exfunc;
55 template <
typename Archive>
void serialize(Archive& ar) {}
68 double operator ()(
const double& x,
const int& dim)
const;
71 return (*
this)(x[0],dim);
74 std::string
name(
const bool& compact =
false)
const;
77 const std::vector<double>
n;
125 if(
axis==0) result=
"x 1.0";
126 else if(
axis==1) result=
"y 1.0";
127 else if (
axis==2) result=
"z 1.0";
136 const std::vector<std::vector<double>>
data_;
141 std::vector<std::vector<double> >
read_string(
const std::string
string)
const;
181template<
typename T, std::
size_t NDIM>
183 const std::string& exop_input, std::vector<coord_3d> centers,
const bool& fence) {
184 if (vf.empty())
return vf;
190 for (
auto&
f : vf)
f.unaryop(exop,
false);
191 if (fence) vf.front().world().gop.fence();
197template<
typename T, std::
size_t NDIM>
199 std::vector<Function<T,NDIM> > vf(1,
f);
200 std::vector<coord_3d> centers(1, center);
long size() const
Returns the number of elements in the tensor.
Definition basetensor.h:138
FunctionCommonData holds all Function data common for given k.
Definition function_common_data.h:52
FunctionDefaults holds default paramaters as static class members.
Definition funcdefaults.h:204
Abstract base class interface required for functors used as input to Functions.
Definition function_interface.h:68
Key is the index for a node of the 2^NDIM-tree.
Definition key.h:66
A tensor is a multidimension array.
Definition tensor.h:317
A simple, fixed dimension vector.
Definition vector.h:64
Definition GuessFactory.h:43
void serialize(Archive &ar)
Definition GuessFactory.h:55
void operator()(const Key< 3 > &key, Tensor< double > &t) const
multiplies the target function by the excitation operator defined by exfunc
Definition GuessFactory.cc:124
std::shared_ptr< FunctionFunctorInterface< double, 3 > > exfunc
shared pointer to object of excitation operator
Definition GuessFactory.h:53
ExopUnaryOpStructure(const std::shared_ptr< FunctionFunctorInterface< double, 3 > > &f)
Definition GuessFactory.h:45
FunctionCommonData< double, 3 > cdata
Definition GuessFactory.h:54
Definition GuessFactory.h:86
GaussFunctor(const double &width)
Definition GuessFactory.h:89
GaussFunctor(const double &width, const Tensor< double > c)
Definition GuessFactory.h:95
GaussFunctor(const double &width, const coord_3d c)
Definition GuessFactory.h:92
double operator()(const coord_3d &rr) const
explicit construction
Definition GuessFactory.cc:199
const coord_3d center
Definition GuessFactory.h:99
const double width_
Definition GuessFactory.h:98
creates a plane-wave: sin (or cos) with argument (npi/L*x)
Definition GuessFactory.h:59
const coord_3d origin
Definition GuessFactory.h:79
const std::vector< bool > cosinus
Definition GuessFactory.h:78
double operator()(const coord_3d &r) const
for explicit construction of this plane-wave function
Definition GuessFactory.cc:214
double operator()(const coord_1d &x, const int &dim) const
in case this is needed at some point
Definition GuessFactory.h:70
std::string name(const bool &compact=false) const
Definition GuessFactory.cc:232
const std::vector< double > n
Definition GuessFactory.h:77
double resultT
Definition GuessFactory.h:63
const Tensor< double > L
Definition GuessFactory.h:76
PlaneWaveFunctor(std::vector< double > vn, std::vector< bool > vc, const coord_3d &c)
Definition GuessFactory.h:61
Project a general 3D polynomial to the MRA Grid.
Definition GuessFactory.h:108
PolynomialFunctor(const std::string input, const double &damp_width=0.0, const coord_3d &c=coord_3d())
Definition GuessFactory.h:113
coord_3d center
Definition GuessFactory.h:139
const std::vector< std::vector< double > > data_
Definition GuessFactory.h:136
double compute_value(const coord_3d &r) const
create the value of the polynomial according to the data in the data_ structure
Definition GuessFactory.cc:148
std::vector< std::vector< double > > give_data()
Definition GuessFactory.h:143
GaussFunctor dampf
damping function
Definition GuessFactory.h:138
double operator()(const coord_3d &rr) const
construction by coordinates
Definition GuessFactory.cc:138
PolynomialFunctor(const std::string input, const double &damp_width, const Tensor< double > &c)
Definition GuessFactory.h:114
void test()
Definition GuessFactory.cc:114
const std::string input_string_
Definition GuessFactory.h:133
std::vector< std::vector< double > > read_string(const std::string string) const
Definition GuessFactory.cc:158
PolynomialFunctor(const int &axis)
simple xyz moments constructor
Definition GuessFactory.h:111
std::string axis_to_string(const int &axis) const
convert a given axis to the appropriate input string
Definition GuessFactory.h:123
Definition GuessFactory.h:148
double compute_value(const coord_3d &r) const
Definition GuessFactory.cc:189
General header file for using MADNESS.
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition madness_exception.h:119
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
std::vector< std::string > make_predefined_exop_strings(const std::string what)
Makes an excitation operator string based on predefined keywords.
Definition GuessFactory.cc:252
vector_real_function_3d apply_polynomial_exop(vector_real_function_3d &vf, const std::string &exop_input, std::vector< coord_3d > centers, const bool &fence)
Definition GuessFactory.cc:56
coord_3d compute_centroid(const real_function_3d &f)
compute the centroid of a function i.e. c[xi]=<f|xi|f>/<f|f> i.e. position expectation value
Definition GuessFactory.cc:14
std::vector< Function< T, NDIM > > apply_trigonometric_exop(std::vector< Function< T, NDIM > > &vf, const std::string &exop_input, std::vector< coord_3d > centers, const bool &fence)
Definition GuessFactory.h:182
Vector< T, NDIM > tensor_to_coord(const Tensor< T > &t)
little helper for coord (Vector<3>) and Tensor data formats
Definition GuessFactory.h:31
std::vector< coord_3d > compute_centroids(const std::vector< Function< T, NDIM > > &vf)
Definition GuessFactory.cc:27
std::vector< std::string > make_auto_polynom_strings(const size_t order)
Makes an automated excitation operator string for the excitation operators needed to create virtuals ...
Definition GuessFactory.cc:348
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
std::vector< real_function_3d > vector_real_function_3d
Definition functypedefs.h:79
NDIM & f
Definition mra.h:2416
Function< double, 3 > real_function_3d
Definition functypedefs.h:65
Vector< double, 3 > coord_3d
Definition funcplot.h:1042
static const double c
Definition relops.cc:10
static const std::size_t NDIM
Definition testpdiff.cc:42
std::size_t axis
Definition testpdiff.cc:59