Example #1
0
 /// <summary>
 /// 更新小球的位置、速度、角加速度、半径和质量信息
 /// 导入文件时,利用重新生成的SimpleModelForSave类进行更新
 /// </summary>
 /// <param name="balls"></param>
 public void UpdateBallInfo(SimpleModelForSave sModel)
 {
     currIter = sModel.currIter;
     for (int i = 0; i < sModel.Radii.Rows; i++)
     {
         radii[i, 0] = sModel.Radii[i, 0];
         mass[i, 0]  = 4 / 3 * Math.PI * Math.Pow(radii[i, 0], 3);
         for (int j = 0; j < sModel.RtPos.Cols; j++)
         {
             rtPos[i, j] = sModel.RtPos[i, j];
             rtVel[i, j] = sModel.RtVel[i, j];
             rtAcc[i, j] = sModel.RtAcc[i, j];
         }
     }
 }
Example #2
0
        public ModelDem3D(SpherePlot balls, SimpleModelForSave sModel = null)
        {
            this.objNum   = balls.Spheres.Count();
            this.porosity = new Matrix <double>(iteration, 1);

            InitStatus(balls);

            if (PackingSystemSetting.SystemBoundType == BoundType.CubeType)
            {
                //kns = 1e3;
                cubeBound = new CubeBound(PackingSystemSetting.CubeLength, PackingSystemSetting.CubeLength, PackingSystemSetting.CubeLength);
            }
            else if (PackingSystemSetting.SystemBoundType == BoundType.CylinderType)
            {
                //kns = 1e3;
                cylinderBound = new CylinderBound(PackingSystemSetting.Radius, PackingSystemSetting.Height);
            }
        }
Example #3
0
 /// <summary>
 /// 从简化的模型中更新小球的半径和位置
 /// </summary>
 /// <param name="sModel"></param>
 public void ReloadInfo(SimpleModelForSave sModel)
 {
     UpdateSpheresLocation(sModel.RtPos);
     UpdateSpheresRadius(sModel.Radii);
 }