/// <summary> /// Main entry point. Uses <see cref="PlotApplication"/> to plot all fields /// referenced in the config file supplied as a command line argument /// </summary> /// <param name="args"> /// Command line arguments. Currently, only the first entry is used /// which has to contain the path to the configuration file containing /// the plot information /// </param> static void Main(string[] args) { bool mustFinalizeMPI; var t = typeof(BoSSS.Application.Rheology.RheologyTimestepInfo); mustFinalizeMPI = BoSSS.Solution.Application.InitMPI(); csMPI.Raw.Comm_Rank(csMPI.Raw._COMM.WORLD, out rank); WriteLine(" --------------------------------------------"); WriteLine("| Process BoSSS.PlotGenerator.exe started |"); WriteLine("| Time: " + DateTime.Now.ToString() + " |"); WriteLine(" --------------------------------------------"); WriteLine(""); //Debugger.Break(); // path to the plotConfig.xml WriteLine("args[0]: " + args[0]); string outputPath = Path.GetDirectoryName(args[0]); // deserialize plotConfig.xml WriteLine("Reading plotConfig.xml ..."); FieldStateConfiguration config = FieldStateConfiguration.LoadConfig(args[0]); // In the next 5 lines of code you find all necessary data to create // plot files string[] basePaths = config.BasePaths; Guid sessionGuid = config.SessionGuid; FieldStateConfiguration.ExportFormats exportFormat = config.ExportFormat; List <string> fieldNameList = config.FieldNames; List <TimestepNumber> timeStepList = config.TimeSteps; // a few debug lines WriteLine("BasePaths[0] : " + basePaths[0]); WriteLine("SessionGuid : " + sessionGuid.ToString()); WriteLine("ExportFormat : " + exportFormat.ToString()); WriteLine("Count(FieldNames) : " + fieldNameList.Count.ToString()); WriteLine("Count(TimeSteps) : " + timeStepList.Count.ToString()); WriteLine("output to : " + outputPath); WriteLine("plotting..."); PlotApplication app = new PlotApplication(config, outputPath); app.Run(); csMPI.Raw.Barrier(csMPI.Raw._COMM.WORLD); if (mustFinalizeMPI) { BoSSS.Solution.Application.FinalizeMPI(); } }
/// <summary> /// Saves the <paramref name="config"/> and the <paramref name="path"/> /// and determines the reconstruction type (<see cref="m_showJumps"/>) and /// ghost level (<see cref="m_GhostZone"/>) /// from the <paramref name="config"/>. /// </summary> /// <param name="config">Configuration options</param> /// <param name="path">The output path</param> public PlotApplication(FieldStateConfiguration config, string path) { m_config = config; m_path = path; m_format = config.ExportFormat; switch (config.ReconstructionType) { case FieldStateConfiguration.ReconstructionTypes.None: m_showJumps = true; break; case FieldStateConfiguration.ReconstructionTypes.Average: m_showJumps = false; break; default: throw new ApplicationException("Unknown reconstruction type"); } switch (config.GhostLevel) { case FieldStateConfiguration.GhostLevels.One: m_GhostZone = true; break; case FieldStateConfiguration.GhostLevels.Zero: m_GhostZone = false; break; default: throw new ApplicationException("Unknown ghost level"); } m_Database = GetDatabase(); //init db-info this.GridDat = null; }