9 psi_(0.0,1.0), phi_(0.0,1.0), order(nu), l1(length_x), l2(length_y), l3(length_z){
15 template<
typename typearg>
17 double tau = -1.0 + (2.0*double(beta)-1.0)/double(
order);
23 if (tau>=-1.0 && tau<=1.0){
24 s = (2.0/double(
order))*(1.0-fabs(tau));
38 double psi, phi, w, arg;
40 Epetra_SerialDenseVector vector_x(3);
42 Epetra_SerialDenseMatrix matrix_X(3,Mesh.
el_type);
44 for (
int il=0; il<32; ++il){
46 ti = tau_beta<int>(
i);
49 tj = tau_beta<int>(
j);
52 tk = tau_beta<int>(
k);
56 w = std::sqrt(-std::log(psi));
57 for (
int e_lid=il; e_lid<n_local_cells; e_lid++){
60 for (
unsigned inode=0; inode<Mesh.
el_type; ++inode){
66 for (
int gp=0; gp<n_gauss_cells; ++gp){
79 vector_x.Multiply(
'N',
'N',1.0,matrix_X,shape_functions,0.0);
80 arg = 2.0*M_PI*phi + (M_PI/
l1)*ti*vector_x(0) + (M_PI/
l2)*tj*vector_x(1) + (M_PI/
l3)*tk*vector_x(2);
81 v(e_lid*n_gauss_cells+gp) += std::sqrt(2.0*si*sj*sk)*w*std::cos(arg);
100 double psi, phi, w, arg;
102 Epetra_SerialDenseVector vector_x(3);
104 Epetra_SerialDenseMatrix matrix_X(3,Mesh.
el_type);
118 for (
int il=0; il<32; ++il){
120 ti = tau_beta<int>(
i);
123 tj = tau_beta<int>(
j);
126 tk = tau_beta<int>(
k);
130 w = std::sqrt(-std::log(psi));
131 for (
int e_lid=0; e_lid<n_local_cells; ++e_lid){
133 if(phase[e_gid]==il){
134 for (
unsigned inode=0; inode<Mesh.
el_type; ++inode){
140 vector_x.Multiply(
'N',
'N',1.0,matrix_X,shape_functions,0.0);
141 arg = 2.0*M_PI*phi + (M_PI/
l1)*ti*vector_x(0) + (M_PI/
l2)*tj*vector_x(1) + (M_PI/
l3)*tk*vector_x(2);
142 v(e_lid) += std::sqrt(2.0*si*sj*sk)*w*std::cos(arg);
153 for (
unsigned int i=0;
i<V.MyLength(); ++
i){
154 double erfx = boost::math::erf<double>(V[
i]/std::sqrt(2.0));
155 double y = (1.0/2.0)*(1.0 + erfx);
156 double yinv = boost::math::gamma_p_inv<double,double>(alpha,y);
162 for (
unsigned int i=0;
i<V.MyLength(); ++
i){
163 double erfx = boost::math::erf<double>(V[
i]/std::sqrt(2.0));
164 double y = (1.0/2.0)*(1.0 + erfx);
165 B[
i] = boost::math::ibeta_inv<double,double,double>(tau1,tau2,y);
boost::random::mt19937 rng
void shape_functions(Epetra_SerialDenseVector &N, double &xi, double &eta, double &zeta)
double s_tau(double &tau)
double tau_beta(typearg &beta)
std::vector< double > nodes_coord
boost::random::uniform_real_distribution psi_
Epetra_SerialDenseVector eta_cells
void icdf_beta(Epetra_Vector &V, Epetra_Vector &B, double &tau1, double &tau2)
Epetra_SerialDenseVector xi_cells
std::vector< int > local_cells
boost::random::uniform_real_distribution phi_
void shape_functions(Epetra_SerialDenseVector &N, double &xi, double &eta, double &zeta)
std::vector< int > cells_nodes
void shape_functions(Epetra_SerialDenseVector &N, double &xi, double &eta)
unsigned int n_gauss_cells
void icdf_gamma(Epetra_Vector &V, Epetra_Vector &G, double &alpha, double &beta)
void generator_gauss_points(Epetra_SerialDenseVector &v, mesh &Mesh, std::vector< int > &phase)
void generator_one_gauss_point(Epetra_SerialDenseVector &v, mesh &Mesh, std::vector< int > &phase, double &xi, double &eta, double &zeta)
Epetra_SerialDenseVector zeta_cells
void shape_functions(Epetra_SerialDenseVector &N, double &xi, double &eta, double &zeta)