-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread_DO.h
75 lines (59 loc) · 2.4 KB
/
read_DO.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef READ_DO_H
#define READ_DO_H
#include <iostream>
#include <stdio.h>
#include <math.h> // need only exp() from it.
#include <string.h>
#include <vector>
#include "fsu_soft/legendre_polynomial.hpp"
#include "fsu_soft/sphere_lebedev_rule.hpp" // compute theta,phi from x,y,z.
#include "libmesh/node.h"
#include "libmesh/point.h"
#ifdef __cplusplus
extern "C"{
#endif
extern void pass_arrays(const char* , int*, int*, int*, double*);
extern void pass_parameters(const char*, int*, int*, int*, int*, int*, int*);
extern char ang_label(int * ang);
extern void c_norm_contr_coeff(int *atom, int *basis, double *env);
extern void global_par_allocate();
extern void global_par_deallocate();
extern void pass_dyor(const char*, int*, double*, double*, double*);
// skip the character arrays for the moment. due to principle incompatibility with c.
#ifdef __cplusplus
}
#endif
void getDyson(const char *filename, int namelength, std::vector<std::vector<double> >& do_j, std::vector<unsigned int>& l, std::vector<double>& alpha, double& energy, double& normDO);
void makeDO_j(std::vector<std::vector<double> >& do_j, std::vector<unsigned int>& l, std::vector<double>& alpha, int nbas,int* basis,double* env, double* DyOr);
double solHar(double x,double y,double z, unsigned int l, unsigned int m);
double solHar2(double x,double y,double z, unsigned int l, unsigned int m);
double eval_DO(const std::vector<std::vector<double> >& do_j, const std::vector<unsigned int>& l, const std::vector<double>& alpha, const std::vector<libMesh::Node>& geometry, const libMesh::Point pt);
std::vector<libMesh::Node> getGeometry(std::string fname);
int factorial(unsigned int n);
class DOrbit{
public:
DOrbit(std::string DO_file)
{
geometry= getGeometry(DO_file);
//es.parameters.get<std::string>("DO_file");
const char* filename=DO_file.c_str();
int namelength=strlen(filename);
getDyson(filename, namelength, this->do_j, this->l, this->alpha, energy, normDO);
}
~DOrbit()
{}
libMesh::Real evalDO(libMesh::Point q_point){
return eval_DO(this->do_j, this->l, this->alpha, this->geometry, q_point);
}
libMesh::Real get_norm()
{return normDO;}
libMesh::Real get_energy()
{return energy;}
std::vector<libMesh::Node> geometry;
private:
std::vector<std::vector<double> > do_j;
std::vector<unsigned int> l;
std::vector<double> alpha;
libMesh::Real energy, normDO;
};
#endif //READ_DO_H