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));
35 double psi, phi, w, arg;
39 ti = tau_beta<int>(
i);
42 tj = tau_beta<int>(
j);
45 tk = tau_beta<int>(
k);
49 w = std::sqrt(-std::log(psi));
50 for (
int inode=0; inode<v.MyLength(); ++inode){
55 arg = 2.0*M_PI*phi + (M_PI/
l1)*ti*x + (M_PI/
l2)*tj*y + (M_PI/
l3)*tk*z;
56 v[inode] += std::sqrt(2.0*si*sj*sk)*w*std::cos(arg);
73 double psi, phi, w, arg;
75 Epetra_SerialDenseVector vector_x(3);
77 Epetra_SerialDenseMatrix matrix_X(3,Mesh.
el_type);
80 ti = tau_beta<int>(
i);
84 tj = tau_beta<int>(
j);
88 tk = tau_beta<int>(
k);
92 w = std::sqrt(-std::log(psi));
94 for (
int e_lid=0; e_lid<n_local_cells; ++e_lid){
96 for (
unsigned inode=0; inode<Mesh.
el_type; ++inode){
102 for (
int gp=0; gp<n_gauss_cells; ++gp){
115 vector_x.Multiply(
'N',
'N',1.0,matrix_X,shape_functions,0.0);
116 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);
117 v(e_lid*n_gauss_cells+gp) += std::sqrt(2.0*si*sj*sk)*w*std::cos(arg);
135 double psi, phi, w, arg;
137 Epetra_SerialDenseVector vector_x(3);
139 Epetra_SerialDenseMatrix matrix_X(3,Mesh.
el_type);
154 ti = tau_beta<int>(
i);
158 tj = tau_beta<int>(
j);
162 tk = tau_beta<int>(
k);
166 w = std::sqrt(-std::log(psi));
168 for (
int e_lid=0; e_lid<n_local_cells; ++e_lid){
170 for (
unsigned inode=0; inode<Mesh.
el_type; ++inode){
176 vector_x.Multiply(
'N',
'N',1.0,matrix_X,shape_functions,0.0);
177 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);
178 v(e_lid) += std::sqrt(2.0*si*sj*sk)*w*std::cos(arg);
188 for (
unsigned int i=0;
i<V.MyLength(); ++
i){
189 double erfx = boost::math::erf<double>(V[
i]/std::sqrt(2.0));
190 double y = (1.0/2.0)*(1.0 + erfx);
191 double yinv = boost::math::gamma_p_inv<double,double>(alpha,y);
197 for (
unsigned int i=0;
i<V.MyLength(); ++
i){
198 double erfx = boost::math::erf<double>(V[
i]/std::sqrt(2.0));
199 double y = (1.0/2.0)*(1.0 + erfx);
200 B[
i] = boost::math::ibeta_inv<double,double,double>(tau1,tau2,y);
void shape_functions(Epetra_SerialDenseVector &N, double &xi, double &eta, double &zeta)
std::vector< double > nodes_coord
double s_tau(double &tau)
void generator_one_gauss_point(Epetra_SerialDenseVector &v, mesh &Mesh, double &xi, double &eta, double &zeta)
Epetra_SerialDenseVector eta_cells
void generator(Epetra_Vector &v, mesh &Mesh)
boost::random::uniform_real_distribution psi_
Epetra_SerialDenseVector xi_cells
boost::random::uniform_real_distribution phi_
std::vector< int > local_cells
void icdf_beta(Epetra_Vector &V, Epetra_Vector &B, double &tau1, double &tau2)
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
boost::random::mt19937 rng
std::vector< int > local_nodes_without_ghosts
void icdf_gamma(Epetra_Vector &V, Epetra_Vector &G, double &alpha, double &beta)
double tau_beta(typearg &beta)
Epetra_SerialDenseVector zeta_cells
void generator_gauss_points(Epetra_SerialDenseVector &v, mesh &Mesh)
void shape_functions(Epetra_SerialDenseVector &N, double &xi, double &eta, double &zeta)