\doxysection{Raytracer.\+h}
\hypertarget{_raytracer_8h_source}{}\label{_raytracer_8h_source}\index{src/Raytracer.h@{src/Raytracer.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ }
\DoxyCodeLine{00010\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00011\ \textcolor{keyword}{class\ }\mbox{\hyperlink{class_raytracer}{Raytracer}}\ \{}
\DoxyCodeLine{00012\ }
\DoxyCodeLine{00013\ \ \ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00014\ }
\DoxyCodeLine{00018\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_surface}{Surface<T>}}\ surface;}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00023\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_gas}{Gas<T>}}\ gas;}
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00028\ \ \ \ \ \ \ \ \ void\ (*local\_kernel)(T*,\ T*,\ T*,\ T*,\ T*);}
\DoxyCodeLine{00029\ }
\DoxyCodeLine{00033\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ incident\_velocity;}
\DoxyCodeLine{00034\ }
\DoxyCodeLine{00038\ \ \ \ \ \ \ \ \ std::string\ sim\_name;}
\DoxyCodeLine{00039\ }
\DoxyCodeLine{00043\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{long}\ num\_particles;}
\DoxyCodeLine{00044\ }
\DoxyCodeLine{00045\ \ \ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00052\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_raytracer_a61a672333819291367de3774d6d7146a}{Raytracer}}()\ \{\}}
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00067\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_raytracer_a61a672333819291367de3774d6d7146a}{Raytracer}}(\mbox{\hyperlink{class_surface}{Surface<T>}}\ surface,\ \mbox{\hyperlink{class_gas}{Gas<T>}}\ gas,\ \textcolor{keywordtype}{void}\ (*local\_kernel)(T*,\ T*,\ T*,\ T*,\ T*),\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ incident\_velocity,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{long}\ num\_particles,\ std::string\ sim\_name);}
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00072\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_raytracer_af96b71478f69c8e418e54e6b00c899c1}{\string~Raytracer}}()\ \{\}}
\DoxyCodeLine{00073\ }
\DoxyCodeLine{00082\ \ \ \ \ \ \ \ \ std::vector<trajectory<T>>\ \mbox{\hyperlink{class_raytracer_a7abf90f0fa44bd936dc370b264de137a}{simulate}}();}
\DoxyCodeLine{00083\ }
\DoxyCodeLine{00092\ \ \ \ \ \ \ \ \ std::vector<trajectory<T>>\ \mbox{\hyperlink{class_raytracer_acccb8cdfb07917d0b7fd0b37045ee847}{import\_data}}(std::string\ filename);}
\DoxyCodeLine{00093\ }
\DoxyCodeLine{00102\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_raytracer_a3ea58c978b74c06cc9c5a51b67e74e0b}{save}}(std::vector<\mbox{\hyperlink{structtrajectory}{trajectory<T>}}>\ trajectories,\ std::string\ filename);}
\DoxyCodeLine{00103\ }
\DoxyCodeLine{00113\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_raytracer_a1d9e2848566aa6be8afc97fcbbbde7e5}{combine\_files}}(std::string\ filename,\ \textcolor{keywordtype}{int}\ num\_procs);}
\DoxyCodeLine{00114\ }
\DoxyCodeLine{00120\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_raytracer_a903705d5c8472a4c6ac6dce9cea69eb7}{set\_num\_particles}}(\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{long}\ num\_particles)\ \{\ this-\/>num\_particles\ =\ num\_particles;\ \}}
\DoxyCodeLine{00121\ }
\DoxyCodeLine{00127\ \ \ \ \ \ \ \ \ std::string\&\ \mbox{\hyperlink{class_raytracer_ab892a900767cdded428146d0f18e9829}{get\_sim\_name}}()\ \{\ \textcolor{keywordflow}{return}\ sim\_name;\ \}}
\DoxyCodeLine{00128\ }
\DoxyCodeLine{00134\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{long}\ \mbox{\hyperlink{class_raytracer_a6ab154fab889b7e57a9faeaf304089ff}{get\_num\_particles}}()\ \{\ \textcolor{keywordflow}{return}\ num\_particles;\ \}}
\DoxyCodeLine{00135\ }
\DoxyCodeLine{00136\ \};}
\DoxyCodeLine{00137\ }
\DoxyCodeLine{00138\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00139\ \mbox{\hyperlink{class_raytracer_a61a672333819291367de3774d6d7146a}{Raytracer<T>::Raytracer}}(\mbox{\hyperlink{class_surface}{Surface<T>}}\ surface,\ \mbox{\hyperlink{class_gas}{Gas<T>}}\ gas,\ \textcolor{keywordtype}{void}\ (*local\_kernel)(T*,\ T*,\ T*,\ T*,\ T*),\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ incident\_velocity,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{long}\ num\_particles,\ std::string\ sim\_name)\ \{}
\DoxyCodeLine{00140\ }
\DoxyCodeLine{00141\ \ \ \ \ this-\/>surface\ =\ surface;}
\DoxyCodeLine{00142\ \ \ \ \ this-\/>gas\ =\ gas;}
\DoxyCodeLine{00143\ \ \ \ \ this-\/>local\_kernel\ =\ local\_kernel;}
\DoxyCodeLine{00144\ \ \ \ \ this-\/>incident\_velocity\ =\ incident\_velocity;}
\DoxyCodeLine{00145\ \ \ \ \ this-\/>num\_particles\ =\ num\_particles;}
\DoxyCodeLine{00146\ \ \ \ \ this-\/>sim\_name\ =\ sim\_name;}
\DoxyCodeLine{00147\ }
\DoxyCodeLine{00148\ \}}
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00150\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00151\ std::vector<trajectory<T>>\ \mbox{\hyperlink{class_raytracer_a7abf90f0fa44bd936dc370b264de137a}{Raytracer<T>::simulate}}()\ \{}
\DoxyCodeLine{00152\ }
\DoxyCodeLine{00153\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ unit\_incident\ =\ this-\/>incident\_velocity\ /\ this-\/>incident\_velocity.\mbox{\hyperlink{class_matrix_a7ef7109486e3ba18eced478f5cc568cc}{norm}}()\ *\ (-\/1.0);}
\DoxyCodeLine{00154\ }
\DoxyCodeLine{00155\ \ \ \ \ T\ theta\_i\ =\ std::acos(-\/\ this-\/>incident\_velocity(2,\ 0)\ /\ this-\/>incident\_velocity.\mbox{\hyperlink{class_matrix_a7ef7109486e3ba18eced478f5cc568cc}{norm}}());}
\DoxyCodeLine{00156\ }
\DoxyCodeLine{00157\ \ \ \ \ \textcolor{keywordtype}{long}\ num\_col\ =\ 0;}
\DoxyCodeLine{00158\ \ \ \ \ \textcolor{keywordtype}{bool}\ collided\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{00159\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ collision\_index;}
\DoxyCodeLine{00160\ }
\DoxyCodeLine{00161\ \ \ \ \ std::vector<trajectory<T>>\ trajectories;}
\DoxyCodeLine{00162\ }
\DoxyCodeLine{00163\ \ \ \ \ std::random\_device\ rd;}
\DoxyCodeLine{00164\ \ \ \ \ std::seed\_seq\ fullSeed\{rd(),\ rd(),\ rd(),\ rd(),\ rd(),\ rd(),\ rd(),\ rd(),\ rd(),\ rd()\};}
\DoxyCodeLine{00165\ \ \ \ \ std::mt19937\ rng(fullSeed);}
\DoxyCodeLine{00166\ \ \ \ \ std::uniform\_real\_distribution<T>\ uniformDist(0.0f,\ 1.0f);}
\DoxyCodeLine{00167\ \ \ \ \ std::normal\_distribution<T>\ normDist(0.0f,\ 1.0f);}
\DoxyCodeLine{00168\ }
\DoxyCodeLine{00169\ \ \ \ \ T\ offset\_size\ =\ 15.0;}
\DoxyCodeLine{00170\ }
\DoxyCodeLine{00171\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ this-\/>num\_particles;\ i\ ++)\ \{}
\DoxyCodeLine{00172\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00173\ \ \ \ \ \ \ \ \ std::vector<Matrix<T>>\ p\_positions;}
\DoxyCodeLine{00174\ \ \ \ \ \ \ \ \ std::vector<Matrix<T>>\ p\_velocities;}
\DoxyCodeLine{00175\ }
\DoxyCodeLine{00176\ \ \ \ \ \ \ \ \ T\ m\_dot\ =\ 1.0;}
\DoxyCodeLine{00177\ \ \ \ \ \ \ \ \ num\_col\ =\ 0;}
\DoxyCodeLine{00178\ }
\DoxyCodeLine{00179\ \ \ \ \ \ \ \ \ collided\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{00180\ }
\DoxyCodeLine{00181\ \ \ \ \ \ \ \ \ T\ rotation\_angle\ =\ uniformDist(rng)\ *\ 2.0\ *\ M\_PI;}
\DoxyCodeLine{00182\ }
\DoxyCodeLine{00183\ \ \ \ \ \ \ \ \ surface.\mbox{\hyperlink{class_surface_aff444bd60c6740c96b2218f876e98d21}{get\_geometry}}().rotate(2,\ rotation\_angle);}
\DoxyCodeLine{00184\ }
\DoxyCodeLine{00185\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ origin\ =\ unit\_incident\ /\ std::cos(theta\_i)\ *\ 100.0;}
\DoxyCodeLine{00186\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ offset(3,\ 1,\ \{2.0\ *\ (uniformDist(rng)\ -\/\ 0.5)\ *\ offset\_size,\ 2.0\ *\ (uniformDist(rng)\ -\/\ 0.5)\ *\ offset\_size,\ 0.0\});}
\DoxyCodeLine{00187\ \ \ \ \ \ \ \ \ origin\ +=\ offset;}
\DoxyCodeLine{00188\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_ray}{Ray<T>}}\ ray(origin,\ incident\_velocity,\ m\_dot,\ 1,\ -\/1);}
\DoxyCodeLine{00189\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{while}\ (collided)\ \{}
\DoxyCodeLine{00190\ }
\DoxyCodeLine{00191\ \ \ \ \ \ \ \ \ \ \ \ \ std::vector<Ray<T>>\ new\_rays\ =\ ray.\mbox{\hyperlink{class_ray_abd9d51036947e4b7e6e145d9095e51a1}{propagate}}(this-\/>surface.\mbox{\hyperlink{class_surface_aff444bd60c6740c96b2218f876e98d21}{get\_geometry}}(),\ this-\/>gas,\ this-\/>local\_kernel,\ \&collision\_index);}
\DoxyCodeLine{00192\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(new\_rays.size()\ ==\ 0)\ \{}
\DoxyCodeLine{00193\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ collided\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{00194\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00195\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00196\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ray\ =\ new\_rays.back();}
\DoxyCodeLine{00197\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ p\_velocities.push\_back(ray.\mbox{\hyperlink{class_ray_a4bc1a761f283f394fd0c166ca387ec08}{get\_velocity}}());}
\DoxyCodeLine{00198\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ p\_positions.push\_back(ray.\mbox{\hyperlink{class_ray_afe655d44c6fdf82302a23277c70ad855}{get\_origin}}());}
\DoxyCodeLine{00199\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00200\ \ \ \ \ \ \ \ \ num\_col\ ++;}
\DoxyCodeLine{00201\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00202\ }
\DoxyCodeLine{00203\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structtrajectory}{trajectory<T>}}\ \mbox{\hyperlink{structtrajectory}{trajectory}}\ =\ \{p\_velocities,\ p\_positions\};}
\DoxyCodeLine{00204\ \ \ \ \ \ \ \ \ trajectories.push\_back(\mbox{\hyperlink{structtrajectory}{trajectory}});}
\DoxyCodeLine{00205\ \ \ \ \ \}}
\DoxyCodeLine{00206\ \ \ \ \ \textcolor{keywordflow}{return}\ trajectories;}
\DoxyCodeLine{00207\ \}}
\DoxyCodeLine{00208\ }
\DoxyCodeLine{00209\ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00210\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_raytracer_a3ea58c978b74c06cc9c5a51b67e74e0b}{Raytracer<T>::save}}(std::vector<\mbox{\hyperlink{structtrajectory}{trajectory<T>}}>\ trajectories,\ std::string\ filename)\ \{}
\DoxyCodeLine{00211\ }
\DoxyCodeLine{00212\ \ \ \ \ std::ofstream\ myfile;}
\DoxyCodeLine{00213\ \ \ \ \ myfile.open(filename);}
\DoxyCodeLine{00214\ \ \ \ \ }
\DoxyCodeLine{00215\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{long}\ num\_particles\ =\ trajectories.size();}
\DoxyCodeLine{00216\ }
\DoxyCodeLine{00217\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{auto}\ i\ =\ 0;\ i\ <\ num\_particles;\ i\ ++)\ \{}
\DoxyCodeLine{00218\ }
\DoxyCodeLine{00219\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structtrajectory}{trajectory<T>}}\ p\_trajectory\ =\ trajectories[i];}
\DoxyCodeLine{00220\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{long}\ num\_bounces\ =\ p\_trajectory.positions.size();}
\DoxyCodeLine{00221\ }
\DoxyCodeLine{00222\ \ \ \ \ \ \ \ \ myfile\ <<\ num\_bounces\ <<\ \textcolor{stringliteral}{"{}\(\backslash\)n"{}};}
\DoxyCodeLine{00223\ }
\DoxyCodeLine{00224\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{auto}\ j\ =\ 0;\ j\ <\ 3;\ j\ ++)\ \{}
\DoxyCodeLine{00225\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{auto}\ k\ =\ 0;\ k\ <\ num\_bounces;\ k\ ++)\ \{}
\DoxyCodeLine{00226\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ myfile\ <<\ p\_trajectory.positions[k](j,\ 0)\ <<\ \textcolor{stringliteral}{"{}\ "{}};}
\DoxyCodeLine{00227\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00228\ \ \ \ \ \ \ \ \ \ \ \ \ myfile\ <<\ \textcolor{stringliteral}{"{}\(\backslash\)n"{}};}
\DoxyCodeLine{00229\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00230\ }
\DoxyCodeLine{00231\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{auto}\ j\ =\ 0;\ j\ <\ 3;\ j\ ++)\ \{}
\DoxyCodeLine{00232\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{auto}\ k\ =\ 0;\ k\ <\ num\_bounces;\ k\ ++)\ \{}
\DoxyCodeLine{00233\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ myfile\ <<\ p\_trajectory.velocities[k](j,\ 0)\ <<\ \textcolor{stringliteral}{"{}\ "{}};}
\DoxyCodeLine{00234\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00235\ \ \ \ \ \ \ \ \ \ \ \ \ myfile\ <<\ \textcolor{stringliteral}{"{}\(\backslash\)n"{}};}
\DoxyCodeLine{00236\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00237\ }
\DoxyCodeLine{00238\ \ \ \ \ \}}
\DoxyCodeLine{00239\ \ \ \ \ myfile.close();}
\DoxyCodeLine{00240\ }
\DoxyCodeLine{00241\ \}}
\DoxyCodeLine{00242\ }
\DoxyCodeLine{00243\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00244\ std::vector<trajectory<T>>\ \mbox{\hyperlink{class_raytracer_acccb8cdfb07917d0b7fd0b37045ee847}{Raytracer<T>::import\_data}}(std::string\ filename)\ \{}
\DoxyCodeLine{00245\ }
\DoxyCodeLine{00246\ \ \ \ \ std::ifstream\ linecounter(filename);}
\DoxyCodeLine{00247\ \ \ \ \ std::string\ line;}
\DoxyCodeLine{00248\ \ \ \ \ std::vector<trajectory<T>>\ trajectories;}
\DoxyCodeLine{00249\ }
\DoxyCodeLine{00250\ \ \ \ \ \textcolor{keywordtype}{long}\ num\_lines\ =\ 0;}
\DoxyCodeLine{00251\ }
\DoxyCodeLine{00252\ \ \ \ \ \textcolor{keywordflow}{while}(\ std::getline(linecounter,\ line))\ \{}
\DoxyCodeLine{00253\ \ \ \ \ \ \ \ \ ++\ num\_lines;}
\DoxyCodeLine{00254\ \ \ \ \ \}}
\DoxyCodeLine{00255\ }
\DoxyCodeLine{00256\ \ \ \ \ \textcolor{keywordtype}{long}\ num\_particles\ =\ num\_lines\ /\ 7;}
\DoxyCodeLine{00257\ \ \ \ \ \textcolor{keywordtype}{long}\ num\_bounces;}
\DoxyCodeLine{00258\ }
\DoxyCodeLine{00259\ \ \ \ \ std::ifstream\ myfile(filename);}
\DoxyCodeLine{00260\ }
\DoxyCodeLine{00261\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ num\_particles;\ i\ ++)\ \{}
\DoxyCodeLine{00262\ }
\DoxyCodeLine{00263\ \ \ \ \ \ \ \ \ myfile\ >>\ num\_bounces;}
\DoxyCodeLine{00264\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ position(3,\ 1);}
\DoxyCodeLine{00265\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ velocity(3,\ 1);}
\DoxyCodeLine{00266\ \ \ \ \ \ \ \ \ std::vector<Matrix<T>>\ p\_positions(num\_bounces,\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}(3,\ 1));}
\DoxyCodeLine{00267\ \ \ \ \ \ \ \ \ std::vector<Matrix<T>>\ p\_velocities(num\_bounces,\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}(3,\ 1));}
\DoxyCodeLine{00268\ }
\DoxyCodeLine{00269\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ k\ =\ 0;\ k\ <\ 3;\ k\ ++)\ \{}
\DoxyCodeLine{00270\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ j\ =\ 0;\ j\ <\ num\_bounces;\ j\ ++)\ \{}
\DoxyCodeLine{00271\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ myfile\ >>\ p\_positions[j](k,\ 0);}
\DoxyCodeLine{00272\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00273\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00274\ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ k\ =\ 0;\ k\ <\ 3;\ k\ ++)\ \{}
\DoxyCodeLine{00275\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ j\ =\ 0;\ j\ <\ num\_bounces;\ j\ ++)\ \{}
\DoxyCodeLine{00276\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ myfile\ >>\ p\_velocities[j](k,\ 0);}
\DoxyCodeLine{00277\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00278\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00279\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structtrajectory}{trajectory<T>}}\ \mbox{\hyperlink{structtrajectory}{trajectory}}\ =\ \{p\_velocities,\ p\_positions\};}
\DoxyCodeLine{00280\ \ \ \ \ \ \ \ \ trajectories.push\_back(\mbox{\hyperlink{structtrajectory}{trajectory}});}
\DoxyCodeLine{00281\ \ \ \ \ \}}
\DoxyCodeLine{00282\ \ \ \ \ }
\DoxyCodeLine{00283\ \ \ \ \ \textcolor{keywordflow}{return}\ trajectories;}
\DoxyCodeLine{00284\ \}}
\DoxyCodeLine{00285\ }
\DoxyCodeLine{00286\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00287\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_raytracer_a1d9e2848566aa6be8afc97fcbbbde7e5}{Raytracer<T>::combine\_files}}(std::string\ filename,\ \textcolor{keywordtype}{int}\ num\_procs)\ \{}
\DoxyCodeLine{00288\ }
\DoxyCodeLine{00289\ \ \ \ \ std::vector<trajectory<T>>\ trajectories\_total;}
\DoxyCodeLine{00290\ }
\DoxyCodeLine{00291\ \ \ \ \ \textcolor{keywordflow}{for}(\ \textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ num\_procs;\ i\ ++)\ \{}
\DoxyCodeLine{00292\ \ \ \ \ \ \ \ \ std::vector<trajectory<T>>\ trajectories\ =\ import\_data(filename\ +\ \textcolor{stringliteral}{"{}\_"{}}\ +\ std::to\_string(i)\ +\ \textcolor{stringliteral}{"{}.dat"{}});}
\DoxyCodeLine{00293\ \ \ \ \ \ \ \ \ trajectories\_total.insert(trajectories\_total.end(),\ trajectories.begin(),\ trajectories.end());}
\DoxyCodeLine{00294\ \ \ \ \ \ \ \ \ std::remove((filename\ +\ \textcolor{stringliteral}{"{}\_"{}}\ +\ std::to\_string(i)\ +\ \textcolor{stringliteral}{"{}.dat"{}}).c\_str());\ }
\DoxyCodeLine{00295\ \ \ \ \ \}}
\DoxyCodeLine{00296\ \ \ \ \ save(trajectories\_total,\ filename\ +\ \textcolor{stringliteral}{"{}.dat"{}});}
\DoxyCodeLine{00297\ \}}

\end{DoxyCode}
