Generate input file for OVITO
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace appbigdata
{
class ParticlesGenerator
{ public void GenerateParticles(int count)
{
String fileName = @"C:\opengl\data\random.xyz";
int seed = (int)(System.DateTime.Now.Ticks / );
Random random = new Random(seed); StreamWriter writer = new StreamWriter(fileName);
try
{
writer.WriteLine(count);
writer.WriteLine("Random Particles");
String[] particleTypes = new String[] { "C", "H" };
int maxValue = count;
for (int i = ; i < count; i++)
{
double x = random.Next(maxValue) * 0.01;
double y = random.Next(maxValue) * 0.01;
double z = random.Next(maxValue) * 0.001;
double v = random.NextDouble();
int index = v >= 0.5d ? : ;
writer.WriteLine(String.Format("{0} {1} {2} {3}", particleTypes[index], x, y, z));
}
}
finally
{
writer.Close();
}
System.Console.WriteLine(String.Format("save to:{0}", fileName)); }
}
}
Generate input file for OVITO的更多相关文章
- 在执行 php artisan key:generate ,报 Could not open input file: artisan 错误
Could not open input file: artisan 必须保证命令是在项目根目录,如下图所示:
- HTML中上传与读取图片或文件(input file)----在路上(25)
input file相关知识简例 在此介绍的input file相关知识为: 上传照片及文件,其中包括单次上传.批量上传.删除照片.增加照片.读取图片.对上传的图片或文件的判断,比如限制图片的张数.限 ...
- Apache服务器网站访问伪静态内页出现No input file specified.的完美解决方案
原文地址:Apache服务器网站访问伪静态内页出现No input file specified.的完美解决方案 启用REWRITE的伪静态功能的时候,首页可以访问,而访问内页的时候,就提示:&quo ...
- 编译安装mmseg提示cannot find input file: src/Makefile.in错误
今天安装中文词检索功能模块 coreseek,其中一个分词模块 mmseg ,编译安装到最后,出现annot find input file: src/Makefile.in aclocal // ...
- HTML5的 input:file上传类型控制
一.input:file属性 属性值有以下几个比较常用: accept:表示可以选择的文件MIME类型,多个MIME类型用英文逗号分开,常用的MIME类型见下表. multiple:是否可以选择多个文 ...
- input file控件限制上传文件类型
网页上添加一个input file HTML控件: <input id="File1" type="file" /> 默认是这样的,所有文件类型都会 ...
- 完美解决 nginx No input file specified.
一次开发中遇到了这个问题:No input file specified nginx版本1.8 找遍网络都是说 fastcgi_param SCRIPT_FILENAME $document_root ...
- 在webapp上使用input:file, 指定capture属性调用默许相机,摄像,录音功能
## 在webapp上使用input:file, 指定capture属性调用默认相机,摄像,录音功能 在iOS6下开发webapp,使用inputz之file,很有用 <input type=& ...
- 移动端头像上传AJax input file
jQuery中的Ajax不能支持 input file 需要用ajaxupload.js但是先需要引入jQuery文件 <script src="__PUBLIC__/js/ajaxf ...
随机推荐
- mysql基本信息收集
1.下载安装 percona-toolkit 工具包http://www.percona.com/downloads/percona-toolkit/LATEST/tarball/2.运行下面两个工具 ...
- Java集合框架练习-计算表达式的值
最近在看<算法>这本书,正好看到一个计算表达式的问题,于是就打算写一下,也正好熟悉一下Java集合框架的使用,大致测试了一下,没啥问题. import java.util.*; /* * ...
- 高性能的JavaScript--数据访问(1)
写在前面 数据存储在哪里,关系到代码运行期间数据被检索到的速度.在JavaScript中,此问题相对简单,因为数据存储只有少量方式可供选择.正如其他语言那样,数据存储位置关系到访问速度.在JavaSc ...
- 修改socket为keepAlive
参考文章:http://blog.csdn.net/ctthuangcheng/article/details/8596818 [root@mdw- gpadmin]# vi /etc/sysctl. ...
- C#ListBox对Item进行重绘,包括颜色
别的不多说了,上代码,直接看 首先设置这行,或者属性窗口设置,这样才可以启动手动绘制,参数有三个 Normal: 自动绘制 OwnerDrawFixed:手动绘制,但间距相同 OwnerDrawVar ...
- iOS 有TabBar的VC界面push后隐藏TabBar的方法
当一个UITabbarController管理多个UINavigationController的时候, 我们要从这每一个UINavigationController中push一个ViewControl ...
- [BZOJ1127][POI2008] KUP子矩阵
Description 给一个n*n的地图,每个格子有一个价格,找一个矩形区域,使其价格总和位于[k,2k] Input 输入k n(n<2000)和一个n*n的地图 Output 输出矩形的左 ...
- 一些gcd计数问题
数论什么的全都忘光了吧QAQ 做了几道简单的题练习一下. bzoj1101: [POI2007]Zap 求有多少对数满足 gcd(x,y)=d, 1<=x<=a, 1<=y<= ...
- POJ 1163 The Triangle(简单动态规划)
http://poj.org/problem?id=1163 The Triangle Time Limit: 1000MS Memory Limit: 10000K Total Submissi ...
- Centos 7 安装 设置 IP地址,DNS,主机名,防火墙,端口,SELinux (实测+笔记)
环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7.0-1406-x86_64-DVD.iso 安装步骤: 1.虚拟系统安装 1.1 使 ...