1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
<?xml version="1.0" encoding="UTF-8"?>
<simulation xmds-version="2">
<testing>
<xsil_file name="nlse_sampling.xsil" expected="nlse_sampling_expected.xsil" absolute_tolerance="1e-6" relative_tolerance="1e-5" />
</testing>
<name>nlse_sampling</name>
<author>Joe Hope</author>
<description>
The nonlinear Schrodinger equation in one dimension,
which is a simple partial differential equation.
We introduce several new features in this script.
</description>
<features>
<benchmark />
<bing />
<fftw plan="patient" />
<openmp />
<auto_vectorise />
<globals>
<![CDATA[
const double energy = 4;
const double vel = 0.3;
const double hwhm = 1.0;
]]>
</globals>
</features>
<geometry>
<propagation_dimension> xi </propagation_dimension>
<transverse_dimensions>
<dimension name="tau" lattice="128" domain="(-6, 6)" />
</transverse_dimensions>
</geometry>
<vector name="wavefunction" type="complex" dimensions="tau">
<components> phi </components>
<initialisation>
<![CDATA[
const double w0 = hwhm*sqrt(2/log(2));
const double amp = sqrt(energy/w0/sqrt(M_PI/2));
phi = amp*exp(-tau*tau/w0/w0)*exp(i*vel*tau);
]]>
</initialisation>
</vector>
<vector name="dampingVector" type="real">
<components> Gamma </components>
<initialisation>
<![CDATA[
Gamma=1.0*(1-exp(-pow(tau*tau/4.0/4.0,10)));
]]>
</initialisation>
</vector>
<sequence>
<integrate algorithm="ARK45" interval="20.0" tolerance="1e-7">
<samples>10 100 10</samples>
<operators>
<integration_vectors>wavefunction</integration_vectors>
<operator kind="ex" constant="yes">
<operator_names>Ltt</operator_names>
<![CDATA[
Ltt = -i*ktau*ktau*0.5;
]]>
</operator>
<![CDATA[
dphi_dxi = Ltt[phi] - phi*Gamma + i*mod2(phi)*phi;
]]>
<dependencies>dampingVector</dependencies>
</operators>
</integrate>
</sequence>
<output>
<sampling_group basis="tau" initial_sample="yes">
<moments>density</moments>
<dependencies>wavefunction</dependencies>
<![CDATA[
density = mod2(phi);
]]>
</sampling_group>
<sampling_group basis="tau(0)" initial_sample="yes">
<moments>normalisation</moments>
<dependencies>wavefunction</dependencies>
<![CDATA[
normalisation = mod2(phi);
]]>
</sampling_group>
<sampling_group basis="ktau(1)" initial_sample="yes">
<moments>densityK</moments>
<dependencies>wavefunction</dependencies>
<![CDATA[
densityK = mod2(phi);
]]>
</sampling_group>
</output>
<info>
Script compiled with XMDS2 version VERSION_PLACEHOLDER (SUBVERSION_REVISION_PLACEHOLDER)
See http://www.xmds.org for more information.
</info>
<XSIL Name="moment_group_1">
<Param Name="n_independent">2</Param>
<Array Name="variables" Type="Text">
<Dim>3</Dim>
<Stream><Metalink Format="Text" Delimiter=" \n"/>
xi tau density
</Stream>
</Array>
<Array Name="data" Type="double">
<Dim>11</Dim>
<Dim>128</Dim>
<Dim>3</Dim>
<Stream><Metalink Format="HDF5" Type="Remote" Group="/1"/>
nlse_sampling_expected.h5
</Stream>
</Array>
</XSIL>
<XSIL Name="moment_group_2">
<Param Name="n_independent">1</Param>
<Array Name="variables" Type="Text">
<Dim>2</Dim>
<Stream><Metalink Format="Text" Delimiter=" \n"/>
xi normalisation
</Stream>
</Array>
<Array Name="data" Type="double">
<Dim>101</Dim>
<Dim>2</Dim>
<Stream><Metalink Format="HDF5" Type="Remote" Group="/2"/>
nlse_sampling_expected.h5
</Stream>
</Array>
</XSIL>
<XSIL Name="moment_group_3">
<Param Name="n_independent">1</Param>
<Array Name="variables" Type="Text">
<Dim>2</Dim>
<Stream><Metalink Format="Text" Delimiter=" \n"/>
xi densityK
</Stream>
</Array>
<Array Name="data" Type="double">
<Dim>11</Dim>
<Dim>2</Dim>
<Stream><Metalink Format="HDF5" Type="Remote" Group="/3"/>
nlse_sampling_expected.h5
</Stream>
</Array>
</XSIL>
</simulation>
|