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 ...
随机推荐
- LinkedList源码阅读笔记(基于JDK1.8)
LinkedList是List接口的一个有序链表实现,存储节点是内部类Node,Node中有两个属性prev和next,负责连接前后两个元素.由于不是使用数组进行存储,所以查询需要遍历链表一半的元素( ...
- java中的泛型的使用与理解
什么是泛型? 泛型是程序设计语言的一种特性.允许程序员在强类型程序设计语言中编写 体验泛型代码时定义一些可变部份,那些部份在使用前必须作出指明.各种程序设计语言和其编译器.运行环境对泛型的支持均不一样 ...
- nodejs复习01
console 格式化 console.log("%s:%s", "a", "b") //字符串 console.log("%d. ...
- Lattice Codes
最近在做的一些关于lattice codes的工作,想记录下来. 首先,我认为lattice coding是一种联合编码调制技术,将消息序列映射到星座点.其中一个良好的性质是lattice point ...
- js和css文件压缩
压缩网址 http://tool.chinaz.com/tools/jscodeconfusion.aspx http://tool.oschina.net/jscompress?type=3 htt ...
- mac 关于使用protobuf出现ld: symbol(s) not found for architecture x86_64的问题
主要是编译时没有添加protobuf库文件 g++ -o Writer.o lm.helloworld.pb.cc Writer.cpp -L/usr/local/lib -lprotobuf
- Print a Binary Tree in Vertical Order
http://www.geeksforgeeks.org/print-binary-tree-vertical-order/ package algorithms; import java.util. ...
- 【读书笔记】《编程珠玑》第一章之位向量&位图
此书的叙述模式是借由一个具体问题来引出的一系列算法,数据结构等等方面的技巧性策略.共分三篇,基础,性能,应用.每篇涵盖数章,章内案例都非常切实棘手,解说也生动有趣. 自个呢也是头一次接触编程技巧类的书 ...
- IDEA+Tomcat+JRebel热部署
在完成idea工程简单应用后,接下来实现热部署. 简单应用地址:http://wibiline.iteye.com/admin/blogs/2072454 一.安装JRebel插件 1. 在线安装 F ...
- MemCache 启动
这个MemCache在园子里面的文章也很多,这里只是我自己记录作下笔记 MemCache的官方网站为http://memcached.org/ 启动与关闭memCache # /usr/local/m ...