Example #1
0
        public static void SaveToXml(string path, NaserModelSettings model)
        {
            var xdoc  = new XDocument();
            var xelem = ToXElement(model, "naser");

            xelem.Add(
                new XElement("TopConductivity", model.TopConductivity),
                new XElement("LeftConductivity", model.LeftConductivity),
                new XElement("RightConductivity", model.RightConductivity));

            xdoc.Add(xelem);
            xdoc.Save(path);
        }
Example #2
0
        public static NaserModelSettings LoadNaserFromXml(string path)
        {
            var xdoc      = XDocument.Load(path);
            var xsettings = xdoc.Element("ModelSettings");
            var mesh      = ReadMeshParameters(xsettings);
            var mb        = ReadManualBoundaries(xsettings);

            var model = new NaserModelSettings(mesh, mb)
                        .WithTopConductivity(xsettings.ElementAsDoubleOrNull("TopConductivity") ?? 0.002)
                        .WithLeftConductivity(xsettings.ElementAsDoubleOrNull("LeftConductivity") ?? 1)
                        .WithRightConductivity(xsettings.ElementAsDoubleOrNull("RightConductivity") ?? 0.002);

            return(model);
        }
Example #3
0
        public static CartesianModel CreateModelWithoutAnomalyData(NaserModelSettings settings)
        {
            var creater = new NaserModelCreater(settings);

            return(GenerateModelWithoutAnomalyData(settings, creater.CreateNonMeshedModel));
        }
Example #4
0
        public static CartesianModel CreateNaserModel(NaserModelSettings settings, Mpi mpi = null)
        {
            var creater = new NaserModelCreater(settings);

            return(GenerateModel(mpi, settings, creater.CreateNonMeshedModel));
        }
Example #5
0
 public NaserModelCreater(NaserModelSettings settings)
 {
     _settings = settings;
 }