17 double testx, testy, testz, xi,
eta, residual;
20 int node, result, e_gid;
22 Epetra_SerialDenseVector x(nvert), y(nvert), z(nvert);
24 std::vector<double> data_xyz;
25 std::vector<double> data_exx, data_eyy, data_exy;
27 Teuchos::RCP<readnrldata> nrldata = Teuchos::rcp(
new readnrldata(
true,path));
35 testx = nrldata->points(
p,0);
36 testy = nrldata->points(
p,1);
37 testz = nrldata->points(
p,2);
38 for (
unsigned int e_lid=0; e_lid<n_local_faces; ++e_lid){
41 for (
unsigned int inode=0; inode<nvert; ++inode){
47 if (z(0)==testz && testx>=0.0 && testx<=50.0 && testy>=0.0 && testy<=25.0){
48 result =
pnpoly(nvert,x,y,testx,testy);
63 Epetra_SerialDenseSolver solver;
66 int nvert = x.Length();;
69 Epetra_SerialDenseVector f(2);
70 Epetra_SerialDenseVector dxi(2);
71 Epetra_SerialDenseVector N(nvert);
72 Epetra_SerialDenseMatrix D(nvert,2);
73 Epetra_SerialDenseMatrix A(2,2);
74 Epetra_SerialDenseMatrix mat_x(2,nvert);
76 for (
unsigned int i=0;
i<nvert; ++
i){
82 while (rhs_inf>1
e-10){
99 f.Multiply(
'N',
'N',-1.0,mat_x,N,1.0);
103 rhs_inf = f.NormInf();
105 std::cout <<
"Inverse Isoparametric Mapping: Newton-Raphson failed to converge.\n";
110 std::cout <<
"Inverse Isoparametric Mapping: Iteration number exceeds 1000.\n";
114 A.Multiply(
'N',
'N',1.0,mat_x,D,0.0);
117 solver.SetVectors(dxi,f);
118 int error = solver.Solve();
120 std::cout <<
"Inverse Isoparametric Mapping: Error with Epetra_SerialDenseSolver.\n";
void shape_functions(Epetra_SerialDenseVector &N, double &xi, double &eta)
Epetra_SerialDenseVector angles
std::vector< int > local_id_faces
std::vector< int > local_faces
std::vector< double > nodes_coord
void d_shape_functions(Epetra_SerialDenseMatrix &D, double &xi, double &eta)
std::vector< double > local_eta
void shape_functions(Epetra_SerialDenseVector &N, double &xi, double &eta)
std::vector< int > faces_nodes
double inverse_isoparametric_mapping(double &testx, double &testy, Epetra_SerialDenseVector &x, Epetra_SerialDenseVector &y, double &xi, double &eta)
std::vector< double > local_xi
void shape_functions(Epetra_SerialDenseVector &N, double &xi, double &eta)
distributenrldata(mesh &Mesh, std::string &path)
void d_shape_functions(Epetra_SerialDenseMatrix &D, double &xi, double &eta)
std::vector< int > global_id_faces
void retrieve_data(mesh &Mesh, std::string &path)
Epetra_SerialDenseVector boundaryconditions
void d_shape_functions(Epetra_SerialDenseMatrix &D, double &xi, double &eta)
int pnpoly(int &nvert, Epetra_SerialDenseVector &vertx, Epetra_SerialDenseVector &verty, double &testx, double &testy)