|
advection.xmds
Script source: advection.xmds.gz
<?xml version="1.0"?>
<simulation>
<!-- Global system parameters and functionality -->
<name> advection </name> <!-- the name of the simulation -->
<author> Paul Cochrane </author> <!-- the author of the simulation -->
<description>
Solves the one-dimensional advection equation for an initial
cosine-modulated Gaussian pulse.
Adapted from A. L. Garcia, "Numerical Methods in Physics" (1994).
</description>
<prop_dim> t </prop_dim> <!-- name of main propagation dim -->
<error_check> yes </error_check> <!-- defaults to yes -->
<use_wisdom> yes </use_wisdom> <!-- defaults to no -->
<benchmark> yes </benchmark> <!-- defaults to no -->
<!-- Command line arguments -->
<argv>
<arg>
<name> v </name>
<type> double </type>
<default_value> 1.0 </default_value>
</arg>
<arg>
<name> x0 </name>
<type> double </type>
<default_value> 0.0 </default_value>
</arg>
<arg>
<name> sigma </name>
<type> double </type>
<default_value> 0.1 </default_value>
</arg>
</argv>
<!-- Global variables for the simulation -->
<globals>
<![CDATA[
//const double v = 1.0;
//const double x0 = 0.0;
//const double sigma = 0.1;
double k = M_PI/sigma;
]]>
</globals>
<!-- Field to be integrated over -->
<field>
<name> main </name>
<dimensions> x </dimensions> <!-- transverse dims -->
<lattice> 50 </lattice> <!-- no. pts for each dim -->
<domains> (-0.5,0.5) </domains> <!-- domain of each dim -->
<samples> 1 </samples> <!-- sample 1st point of dim? -->
<vector>
<name> main </name>
<type> complex </type> <!-- data type of vector -->
<components> A </components> <!-- names of components -->
<fourier_space> no </fourier_space> <!-- def in k-space? -->
<![CDATA[
A = rcomplex(
cos(k*(x-x0)) * exp(-(x-x0)*(x-x0)/(2.0*sigma*sigma))
, 0.0);
]]>
</vector>
</field>
<!-- The sequence of integrations to perform -->
<sequence>
<integrate>
<algorithm> RK4EX </algorithm> <!-- RK4EX, RK4IP, SIEX, SIIP -->
<interval> 1 </interval> <!-- how far in main dim? -->
<lattice> 500 </lattice> <!-- no. points in main dim -->
<samples> 50 </samples> <!-- no. pts in output moment group -->
<k_operators>
<constant> yes </constant> <!-- yes/no -->
<operator_names> L </operator_names>
<![CDATA[
L = rcomplex(0.0, -v*kx);
]]>
</k_operators>
<![CDATA[
dA_dt = L[A];
]]>
</integrate>
</sequence>
<!-- The output to generate -->
<output format="ascii">
<group>
<sampling>
<fourier_space> no </fourier_space> <!-- sample in k-space? -->
<lattice> 50 </lattice> <!-- no. points to sample -->
<moments> amp </moments> <!-- names of moments -->
<![CDATA[
amp = A;
]]>
</sampling>
</group>
</output>
</simulation>
Generated by GNU enscript 1.6.3.
|