예제 #1
0
        private FieldStateConfiguration CreateConfiguration()
        {
            FieldStateConfiguration fsConfig = new FieldStateConfiguration();

            fsConfig.BasePaths          = new string[] { Session.Database.Path };
            fsConfig.SessionGuid        = Session.ID;
            fsConfig.FieldNames         = FieldNames;
            fsConfig.TimeSteps          = TimeSteps;
            fsConfig.SuperSampling      = SuperSampling;
            fsConfig.ReconstructionType = reconstructionType;
            fsConfig.GhostLevel         = GhostLevels;
            fsConfig.NumberOfProcesses  = NumberOfProcesses;
            fsConfig.ExportFormat       = ExportFormat;
            return(fsConfig);
        }
예제 #2
0
        /// <summary>
        /// Does the actual plotting using the plot generator
        /// </summary>
        /// <param name="config">
        /// The field state configuration to be plotted
        /// </param>
        /// <param name="outputPath">
        /// Path where the output should be placed
        /// </param>
        protected Process PrepareProcess(FieldStateConfiguration config, string outputPath)
        {
            if (Directory.Exists(outputPath) == false)
            {
                Directory.CreateDirectory(outputPath);
            }
            string plotConfigPath = Path.Combine(outputPath, "plotConfig.xml");

            FieldStateConfiguration.Serialize(plotConfigPath, config);

            // we are expecting 'BoSSS.PlotGen.exe' to be in the same dir as DBE.exe
            Assembly a           = System.Reflection.Assembly.GetEntryAssembly();
            string   plotGenPath = Path.Combine(
                System.IO.Path.GetDirectoryName(a.Location),
                "BoSSS.PlotGenerator.exe");

            if (!File.Exists(plotGenPath))
            {
                throw new Exception(plotGenPath + " could not be found.");
            }

            Process plotProcess = new Process();

            plotProcess.StartInfo.WindowStyle      = ProcessWindowStyle.Minimized;
            plotProcess.StartInfo.WorkingDirectory = outputPath; // quick fix: Tecplot creates temp files, working dir needs to be writeable
            if (config.NumberOfProcesses == 1)
            {
                plotProcess.StartInfo.FileName = plotGenPath;
            }
            else
            {
                plotProcess.StartInfo.FileName  = MPI_EXECUTABLE;
                plotProcess.StartInfo.Arguments = string.Format(
                    " -n {0} {1} ", config.NumberOfProcesses, plotGenPath);
            }
            plotProcess.StartInfo.Arguments += "\"" + plotConfigPath + "\"";

            return(plotProcess);
        }