\doxysection{Gas.\+h}
\hypertarget{_gas_8h_source}{}\label{_gas_8h_source}\index{src/Gas.h@{src/Gas.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ }
\DoxyCodeLine{00009\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00010\ \textcolor{keyword}{class\ }\mbox{\hyperlink{class_gas}{Gas}}\ \{}
\DoxyCodeLine{00011\ }
\DoxyCodeLine{00012\ \ \ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00013\ \ \ \ \ \ \ \ \ T\ density;\ \ \ \ \ \ }
\DoxyCodeLine{00014\ \ \ \ \ \ \ \ \ T\ temperature;\ \ }
\DoxyCodeLine{00015\ \ \ \ \ \ \ \ \ T\ molar\_mass;\ \ \ }
\DoxyCodeLine{00016\ \ \ \ \ \ \ \ \ T\ speed;\ \ \ \ \ \ \ \ }
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \ \ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00025\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_gas_a1d4cde725515ac20ff04e029c4e7bfcc}{Gas}}()\ :\ density(0.0),\ temperature(0.0),\ molar\_mass(0.0),\ speed(0.0)\ \{\}}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00037\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_gas_ac05d52f693562a878831e07021d1cc0c}{Gas}}(T\ density,\ T\ temperature,\ T\ molar\_mass,\ T\ speed)\ :\ density(density),\ temperature(temperature),\ molar\_mass(molar\_mass),\ speed(speed)\ \{\}}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00046\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_gas_af84e4c03c584648deb3f88839deb941b}{Gas}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_gas}{Gas<T>}}\&\ other)\ :\ density(other.density),\ temperature(other.temperature),\ molar\_mass(other.molar\_mass),\ speed(other.speed)\ \{\}}
\DoxyCodeLine{00047\ }
\DoxyCodeLine{00056\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_gas_a5412a381824c93d8fb0413d1fb811880}{Gas}}(\mbox{\hyperlink{class_gas}{Gas<T>}}\&\&\ other)\ :\ density(other.density),\ temperature(other.temperature),\ molar\_mass(other.molar\_mass),\ speed(other.speed)\ \{}
\DoxyCodeLine{00057\ \ \ \ \ \ \ \ \ \ \ \ \ other.density\ =\ 0.0;}
\DoxyCodeLine{00058\ \ \ \ \ \ \ \ \ \ \ \ \ other.temperature\ =\ 0.0;}
\DoxyCodeLine{00059\ \ \ \ \ \ \ \ \ \ \ \ \ other.molar\_mass\ =\ 0.0;}
\DoxyCodeLine{00060\ \ \ \ \ \ \ \ \ \ \ \ \ other.speed\ =\ 0.0;}
\DoxyCodeLine{00061\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00068\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_gas_ab225fbaed0c92f740bb2680d9a3750f5}{\string~Gas}}()\ \{}
\DoxyCodeLine{00069\ \ \ \ \ \ \ \ \ \ \ \ \ density\ =\ 0.0;}
\DoxyCodeLine{00070\ \ \ \ \ \ \ \ \ \ \ \ \ temperature\ =\ 0.0;}
\DoxyCodeLine{00071\ \ \ \ \ \ \ \ \ \ \ \ \ molar\_mass\ =\ 0.0;}
\DoxyCodeLine{00072\ \ \ \ \ \ \ \ \ \ \ \ \ speed\ =\ 0.0;}
\DoxyCodeLine{00073\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00074\ }
\DoxyCodeLine{00083\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_gas}{Gas}}\&\ \mbox{\hyperlink{class_gas_af7aac37d50ef59e5ad35945d89f7fa6c}{operator=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_gas}{Gas}}\&\ other)\ \{}
\DoxyCodeLine{00084\ \ \ \ \ \ \ \ \ \ \ \ \ density\ =\ other.density;}
\DoxyCodeLine{00085\ \ \ \ \ \ \ \ \ \ \ \ \ temperature\ =\ other.temperature;}
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ \ \ \ \ molar\_mass\ =\ other.molar\_mass;}
\DoxyCodeLine{00087\ \ \ \ \ \ \ \ \ \ \ \ \ speed\ =\ other.speed;}
\DoxyCodeLine{00088\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00089\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00090\ }
\DoxyCodeLine{00099\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_gas}{Gas}}\&\ \mbox{\hyperlink{class_gas_ac08925b4dfb0f3225213bd4496453529}{operator=}}(\mbox{\hyperlink{class_gas}{Gas}}\&\&\ other)\ \{}
\DoxyCodeLine{00100\ \ \ \ \ \ \ \ \ \ \ \ \ density\ =\ other.density;}
\DoxyCodeLine{00101\ \ \ \ \ \ \ \ \ \ \ \ \ temperature\ =\ other.temperature;}
\DoxyCodeLine{00102\ \ \ \ \ \ \ \ \ \ \ \ \ molar\_mass\ =\ other.molar\_mass;}
\DoxyCodeLine{00103\ \ \ \ \ \ \ \ \ \ \ \ \ speed\ =\ other.speed;}
\DoxyCodeLine{00104\ }
\DoxyCodeLine{00105\ \ \ \ \ \ \ \ \ \ \ \ \ other.density\ =\ 0.0;}
\DoxyCodeLine{00106\ \ \ \ \ \ \ \ \ \ \ \ \ other.temperature\ =\ 0.0;}
\DoxyCodeLine{00107\ \ \ \ \ \ \ \ \ \ \ \ \ other.molar\_mass\ =\ 0.0;}
\DoxyCodeLine{00108\ \ \ \ \ \ \ \ \ \ \ \ \ other.speed\ =\ 0.0;}
\DoxyCodeLine{00109\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00110\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00111\ }
\DoxyCodeLine{00120\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_gas_aa8987a9d4cc3e28e5ae19c8c341d3b06}{get\_thermal\_velocity}}();}
\DoxyCodeLine{00121\ }
\DoxyCodeLine{00127\ \ \ \ \ \ \ \ \ T\ \mbox{\hyperlink{class_gas_aae9cf3b82b2eeb0b9ed96e2c973920cb}{get\_temperature}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ temperature;\ \}}
\DoxyCodeLine{00128\ }
\DoxyCodeLine{00134\ \ \ \ \ \ \ \ \ T\ \mbox{\hyperlink{class_gas_a7d97eadcb351e8d7d1043771712917fe}{get\_density}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ density;\ \}}
\DoxyCodeLine{00135\ }
\DoxyCodeLine{00141\ \ \ \ \ \ \ \ \ T\ \mbox{\hyperlink{class_gas_a6bd15f51e80e57db68a0b8763b800fb7}{get\_molar\_mass}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ molar\_mass;\ \}}
\DoxyCodeLine{00142\ }
\DoxyCodeLine{00148\ \ \ \ \ \ \ \ \ T\ \mbox{\hyperlink{class_gas_ae17c7893c96ce081e42e19a9a62abdfb}{get\_speed}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ speed;\ \}}
\DoxyCodeLine{00149\ \};}
\DoxyCodeLine{00150\ }
\DoxyCodeLine{00159\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00160\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_gas_aa8987a9d4cc3e28e5ae19c8c341d3b06}{Gas<T>::get\_thermal\_velocity}}()\ \{}
\DoxyCodeLine{00161\ \ \ \ \ \textcolor{comment}{//\ Set\ up\ random\ number\ generation}}
\DoxyCodeLine{00162\ \ \ \ \ std::random\_device\ rd;}
\DoxyCodeLine{00163\ \ \ \ \ std::seed\_seq\ fullSeed\{rd(),\ rd(),\ rd(),\ rd(),\ rd(),\ rd(),\ rd(),\ rd()\};}
\DoxyCodeLine{00164\ \ \ \ \ std::mt19937\ rng(fullSeed);}
\DoxyCodeLine{00165\ \ \ \ \ std::normal\_distribution<T>\ normDist(0.0f,\ 1.0f);}
\DoxyCodeLine{00166\ }
\DoxyCodeLine{00167\ \ \ \ \ \textcolor{comment}{//\ Compute\ the\ thermal\ velocities\ in\ each\ direction}}
\DoxyCodeLine{00168\ \ \ \ \ T\ v\_x\ =\ sqrt(R\_gas\ *\ temperature\ /\ molar\_mass)\ *\ normDist(rng);}
\DoxyCodeLine{00169\ \ \ \ \ T\ v\_y\ =\ sqrt(R\_gas\ *\ temperature\ /\ molar\_mass)\ *\ normDist(rng);}
\DoxyCodeLine{00170\ \ \ \ \ T\ v\_z\ =\ sqrt(R\_gas\ *\ temperature\ /\ molar\_mass)\ *\ normDist(rng);}
\DoxyCodeLine{00171\ }
\DoxyCodeLine{00172\ \ \ \ \ \textcolor{comment}{//\ Return\ the\ thermal\ velocity\ as\ a\ 3x1\ matrix}}
\DoxyCodeLine{00173\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ vel(3,\ 1,\ \{v\_x,\ v\_y,\ v\_z\});}
\DoxyCodeLine{00174\ \ \ \ \ \textcolor{keywordflow}{return}\ vel;}
\DoxyCodeLine{00175\ \}}

\end{DoxyCode}
