Exemplo n.º 1
0
        private static CartesianModel GenerateModelWithoutAnomalyData(ModelSettings settings, Func <NonMeshedModel> genNonMeshed)
        {
            var nonMeshed = genNonMeshed();
            var converter = new NonMeshedToCartesianModelConverter(nonMeshed);
            var mesh      = settings.Mesh;

            converter.SetManualBoundaries(settings.ManualBoundaries);

            var cartesian = converter.ConvertWithoutAnomalyData(mesh);

            return(cartesian);
        }
Exemplo n.º 2
0
 private static XElement ToXElement(ModelSettings model, string modelType)
 {
     return(new XElement("ModelSettings", new XAttribute("model", modelType),
                         new XElement("Nx", model.Mesh.Nx),
                         new XElement("Ny", model.Mesh.Ny),
                         new XElement("Nz",
                                      new XAttribute("isGeom", model.Mesh.UseGeometricStepAlongZ),
                                      model.Mesh.UseGeometricStepAlongZ ?
                                      new XAttribute("geomRation", model.Mesh.GeometricRation) :
                                      null, model.Mesh.Nz),
                         ToXElement(model.ManualBoundaries)));
 }
Exemplo n.º 3
0
        private static CartesianModel GenerateModel(Mpi mpi, ModelSettings settings, Func <NonMeshedModel> genNonMeshed)
        {
            var nonMeshed = genNonMeshed();
            var converter = new NonMeshedToCartesianModelConverter(nonMeshed);
            var mesh      = settings.Mesh;

            converter.SetManualBoundaries(settings.ManualBoundaries);

            var nxStart  = 0;
            var nxLength = mesh.Nx;

            if (mpi != null && mpi.IsParallel)
            {
                nxStart  = mpi.CalcLocalHalfNxStart(mesh.Nx);
                nxLength = mpi.CalcLocalHalfNxLength(mesh.Nx);
            }

            var cartesian = converter.Convert(mesh, nxStart, nxLength);

            return(cartesian);
        }