⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 diffusion.xmds

📁 XMDS is a code generator that integrates equations. You write them down in human readable form in a
💻 XMDS
字号:
<?xml version="1.0"?><!-- Example simulation: Diffusion Equation --><!-- $Id: diffusion.xmds,v 1.7 2004/06/15 01:30:03 paultcochrane Exp $ --><!--  Copyright (C) 2000-2004                                           --><!--                                                                    --><!--  Code contributed by Greg Collecutt, Joseph Hope and Paul Cochrane --><!--                                                                    --><!--  This file is part of xmds.                                        --><!--                                                                    --><!--  This program is free software; you can redistribute it and/or     --><!--  modify it under the terms of the GNU General Public License       --><!--  as published by the Free Software Foundation; either version 2    --><!--  of the License, or (at your option) any later version.            --><!--                                                                    --><!--  This program is distributed in the hope that it will be useful,   --><!--  but WITHOUT ANY WARRANTY; without even the implied warranty of    --><!--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     --><!--  GNU General Public License for more details.                      --><!--                                                                    --><!--  You should have received a copy of the GNU General Public License --><!--  along with this program; if not, write to the Free Software       --><!--  Foundation, Inc., 59 Temple Place - Suite 330, Boston,            --><!--  MA  02111-1307, USA.                                              --><simulation>  <!-- Global system parameters and functionality -->  <name>diffusion</name>  <author> Paul Cochrane </author>  <description>    Solves the one-dimensional diffusion equation for an initial    Gaussian pulse.  </description>  <prop_dim>t</prop_dim>  <error_check>yes</error_check>  <stochastic>no</stochastic>  <use_wisdom>yes</use_wisdom>  <!-- Default is no -->  <!-- Global variables for the simulation -->  <globals>  <![CDATA[    const double sigma = 0.1;    const double kappa = 0.1;    const double x0 = 0.0;  ]]>  </globals>  <!-- Field to be integrated over -->  <field>    <name>main</name>    <dimensions>  x   </dimensions>    <lattice>    128  </lattice>    <domains>  (-1,1) </domains>    <samples>1</samples>    <vector>      <name>main</name>      <type>complex</type>      <components>T</components>      <fourier_space>no</fourier_space>      <![CDATA[        T = rcomplex(exp(-(x - x0)*(x - x0)/(2.0*sigma*sigma))/(sigma*sqrt(2.0*M_PI)),0.0);      ]]>    </vector>  </field>  <!-- The sequence of integrations to perform -->  <sequence>    <integrate>      <algorithm>RK4EX</algorithm>      <interval>1</interval>      <lattice>10000</lattice>      <samples>50</samples>      <k_operators>        <constant>yes</constant>        <operator_names>L</operator_names>        <![CDATA[          L = -kappa*kx*kx;        ]]>      </k_operators>      <vectors>main</vectors>        <![CDATA[          dT_dt =  L[T];        ]]>    </integrate>  </sequence>  <!-- The output to generate -->  <output>    <filename>diffusion.xsil</filename>    <group>      <sampling>        <fourier_space> no </fourier_space>        <lattice>       50 </lattice>        <moments>temp</moments>	<![CDATA[	  temp = T;	]]>      </sampling>    </group>  </output></simulation>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -