本文整理汇总了C#中IMesh.InitializeMesh方法的典型用法代码示例。如果您正苦于以下问题:C# IMesh.InitializeMesh方法的具体用法?C# IMesh.InitializeMesh怎么用?C# IMesh.InitializeMesh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMesh
的用法示例。
在下文中一共展示了IMesh.InitializeMesh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test
public void Test()
{
u = 100000;
particles = new ParticleArrayStorage<Particle>(1000000);
boundaryConditions = new BoundaryConditions
{
Top = new BoundaryCondition { Value = x => 0, Type = BoundaryConditionType.Neumann },
Bottom = new BoundaryCondition { Value = x => 0, Type = BoundaryConditionType.Neumann },
Left = new BoundaryCondition { Value = x => 0, Type = BoundaryConditionType.Dirichlet },
Right = new BoundaryCondition { Value = x => u, Type = BoundaryConditionType.Dirichlet }
};
grid = new Grid2D();
grid.InitializeGrid(5, 5, 0, 4, 0, 4);
mesh = new Mesh2D();
mesh.InitializeMesh(grid.N * grid.M);
interpolator = new CloudInCellCurrentLinkage(particles, grid, mesh, false);
poissonSolver = new Poisson2DFdmSolver(grid, boundaryConditions);
poissonSolver.FdmMatrix = poissonSolver.BuildMatrix();
var particle = new Particle(4, 1, 0, 0, 0, 0, 1);
var particleId = particles.Add(particle);
particles.Set(Field.PrevX, particleId, 2);
particles.Set(Field.PrevY, particleId, 1);
var cell = grid.FindCell(particles.Get(Field.X, particleId), particles.Get(Field.Y, particleId));
particles.SetParticleCell(particleId, cell);
interpolator.InterpolateDensity();
}
示例2: Prepare
public void Prepare(PICProject project)
{
w = project.Relaxation;
backscattering = project.Backscattering;
alfa = project.BackscatteringAlfa;
beta = project.BackscatteringBeta;
step = project.Step;
u = project.Voltage;
particles = new ParticleArrayStorage<Particle>(project.ParticlesCount);
boundaryConditions = new BoundaryConditions
{
Top = new BoundaryCondition { Value = x => 0, Type = BoundaryConditionType.Neumann },
Bottom = new BoundaryCondition { Value = x => 0, Type = BoundaryConditionType.Neumann },
Left = new BoundaryCondition { Value = x => 0, Type = BoundaryConditionType.Dirichlet },
Right = new BoundaryCondition { Value = x => u, Type = BoundaryConditionType.Dirichlet }
};
emitter = new Emitter2D(0, project.EmitterBottom, 0, project.EmitterTop, project.ParticlesCount, 0, 0, -0.5 * Constants.ChildLangmuirCurrent(project.Length, u), step);
mover = new Leapfrog();
grid = new Grid2D();
grid.InitializeGrid(project.GridN, project.GridM, 0, project.Length, 0, project.Height);
mesh = new Mesh2D();
mesh.InitializeMesh(grid.N * grid.M);
interpolator = new CloudInCellCurrentLinkage(particles, grid, mesh, false);
poissonSolver = new Poisson2DFdmSolver(grid, boundaryConditions);
poissonSolver.FdmMatrix = poissonSolver.BuildMatrix();
h = step * Constants.LightVelocity;
Monitor = new PICMonitor(grid, mesh, particles, this);
density = new double[grid.N * grid.M];
Trajectories = new List<Tuple<int, double, double>>(particles.Count * 1000);
}