37 #include <lifev/core/fem/BCManage.hpp> 49 std::map< ID, std::vector< Real > >::iterator mapIt;
50 for ( mapIt = triad.begin() ; mapIt != triad.end(); ++mapIt )
55 Real nx ( (*mapIt).second[6]);
56 Real ny ( (*mapIt).second[7]);
57 Real nz ( (*mapIt).second[8]);
58 Real nxi = sqrt (ny * ny + nz * nz);
59 Real nxj = sqrt (nx * nx + nz * nz);
60 Real nxk = sqrt (nx * nx + ny * ny);
61 if ( (nxi >= nxj) && (nxi >= nxk) )
64 (*mapIt).second[0] = 0;
65 (*mapIt).second[1] = nz / nxi;
66 (*mapIt).second[2] = -ny / nxi;
69 (*mapIt).second[3] = -nxi;
70 (*mapIt).second[4] = nx * ny / nxi;
71 (*mapIt).second[5] = nx * nz / nxi;
73 else if ( (nxj >= nxi) && (nxj >= nxk) )
76 (*mapIt).second[0] = -nz / nxj;
77 (*mapIt).second[1] = 0;
78 (*mapIt).second[2] = nx / nxj;
81 (*mapIt).second[3] = nx * ny / nxj;
82 (*mapIt).second[4] = -nxj;
83 (*mapIt).second[5] = ny * nz / nxj;
88 (*mapIt).second[0] = ny / nxk;
89 (*mapIt).second[1] = -nx / nxk;
90 (*mapIt).second[2] = 0;
93 (*mapIt).second[3] = nx * nz / nxk;
94 (*mapIt).second[4] = ny * nz / nxk;
95 (*mapIt).second[5] = -nxk;
103 std::map< ID, std::vector< Real > >::iterator mapIt;
105 filename.append (
".vtk");
106 std::ofstream file (filename.c_str() );
111 std::cerr <<
"Error: The file is not opened " << std::endl;
116 unsigned int nbPoints (triad.size() );
119 file <<
"# vtk DataFile Version 2.0" << std::endl;
120 file <<
"Normal directions" << std::endl;
121 file <<
"ASCII" << std::endl;
124 file <<
"DATASET POLYDATA" << std::endl;
125 file <<
"POINTS " << nbPoints <<
" float" << std::endl;
126 for ( mapIt = triad.begin() ; mapIt != triad.end(); ++mapIt )
128 file << (*mapIt).second[9] <<
"\t" << (*mapIt).second[10] <<
"\t" << (*mapIt).second[11] << std::endl;
132 file <<
"POINT_DATA " << nbPoints << std::endl;
135 file <<
"VECTORS cell_tangent_1 float" << std::endl;
136 for ( mapIt = triad.begin() ; mapIt != triad.end(); ++mapIt )
138 file << (*mapIt).second[0] <<
"\t" << (*mapIt).second[1] <<
"\t" << (*mapIt).second[2] << std::endl;
142 file <<
"VECTORS cell_tangent_2 float" << std::endl;
143 for ( mapIt = triad.begin() ; mapIt != triad.end(); ++mapIt )
145 file << (*mapIt).second[3] <<
"\t" << (*mapIt).second[4] <<
"\t" << (*mapIt).second[5] << std::endl;
149 file <<
"VECTORS cell_normals float" << std::endl;
150 for ( mapIt = triad.begin() ; mapIt != triad.end(); ++mapIt )
152 file << (*mapIt).second[6] <<
"\t" << (*mapIt).second[7] <<
"\t" << (*mapIt).second[8] << std::endl;
void bcCalculateTangentVectors(std::map< ID, std::vector< Real > > &triad)
void updateInverseJacobian(const UInt &iQuadPt)
void bcExportTriadToParaview(std::map< ID, std::vector< Real > > &triad, std::string filename)