├── .ackrc
├── .agignore
├── .project
├── COPYING
├── DTDs
├── casebuilder.dtd
└── comparator.dtd
├── MANIFEST.in
├── Makefile
├── Obsolet
└── OldParsedParameterFile.py
├── PlotTest
├── runTest.sh
├── writeNonUniform.py
└── writeUniform.py
├── PyFoam.kpf
├── PyFoam
├── Applications
│ ├── APoMaFoXiiQt.py
│ ├── AddCaseDataToDatabase.py
│ ├── Benchmark.py
│ ├── BinarySize.py
│ ├── BlockMeshConverter.py
│ ├── BlockMeshRewrite.py
│ ├── BuildHelper.py
│ ├── CaseBuilder.py
│ ├── CaseBuilderBackend.py
│ ├── CaseReport.py
│ ├── ChangeBoundaryName.py
│ ├── ChangeBoundaryType.py
│ ├── ChangePython.py
│ ├── ClearBoundaryValue.py
│ ├── ClearCase.py
│ ├── ClearInternalField.py
│ ├── CloneCase.py
│ ├── ClusterTester.py
│ ├── CommonBlink1.py
│ ├── CommonCaseBuilder.py
│ ├── CommonChangeBoundary.py
│ ├── CommonClearCase.py
│ ├── CommonLibFunctionTrigger.py
│ ├── CommonMultiRegion.py
│ ├── CommonParallel.py
│ ├── CommonParserOptions.py
│ ├── CommonPickledDataInput.py
│ ├── CommonPlotLines.py
│ ├── CommonPlotOptions.py
│ ├── CommonPrePostHooks.py
│ ├── CommonReadWriteCSV.py
│ ├── CommonReportRunnerData.py
│ ├── CommonReportUsage.py
│ ├── CommonRestart.py
│ ├── CommonSafeTrigger.py
│ ├── CommonSelectTimesteps.py
│ ├── CommonServer.py
│ ├── CommonStandardOutput.py
│ ├── CommonTemplateBehaviour.py
│ ├── CommonTemplateFormat.py
│ ├── CommonVCSCommit.py
│ ├── CommonWriteAllTrigger.py
│ ├── Comparator.py
│ ├── CompareDictionary.py
│ ├── CompressCaseFiles.py
│ ├── ConvertToCSV.py
│ ├── CopyLastToFirst.py
│ ├── CreateBoundaryPatches.py
│ ├── CreateModuleFile.py
│ ├── CursesApplicationWrapper.py
│ ├── Decomposer.py
│ ├── DisplayBlockMesh.py
│ ├── DisplayBlockMeshQt.py
│ ├── DumpRunDatabaseToCSV.py
│ ├── EchoDictionary.py
│ ├── EchoPickledApplicationData.py
│ ├── Execute.py
│ ├── FromTemplate.py
│ ├── FunkyDoCalcFiles.py
│ ├── IPythonNotebook.py
│ ├── InitVCSCase.py
│ ├── JoinCSV.py
│ ├── JoinTimelines.py
│ ├── ListCases.py
│ ├── ListProfilingInfo.py
│ ├── MeshUtilityRunner.py
│ ├── ModifyGGIBoundary.py
│ ├── NetList.py
│ ├── NetShell.py
│ ├── PVLoadState.py
│ ├── PVSnapshot.py
│ ├── PackCase.py
│ ├── PlotHelpers.py
│ ├── PlotRunner.py
│ ├── PlotWatcher.py
│ ├── PotentialRunner.py
│ ├── PrepareCase.py
│ ├── PrintData2DStatistics.py
│ ├── PyFoamApplication.py
│ ├── PyFoamApplicationQt4.py
│ ├── ReadDictionary.py
│ ├── RedoPlot.py
│ ├── RestartRunner.py
│ ├── RunAtMultipleTimes.py
│ ├── RunParameterVariation.py
│ ├── Runner.py
│ ├── STLUtility.py
│ ├── SamplePlot.py
│ ├── SteadyRunner.py
│ ├── SurfacePlot.py
│ ├── SymlinkToFile.py
│ ├── TestConfiguration.py
│ ├── TimelinePlot.py
│ ├── UpdateDictionary.py
│ ├── UpgradeDictionariesTo17.py
│ ├── UpgradeDictionariesTo20.py
│ ├── UtilityRunnerApp.py
│ ├── WriteDictionary.py
│ └── __init__.py
├── Basics
│ ├── BasicFile.py
│ ├── BlockMeshComponents.py
│ ├── CSVCollection.py
│ ├── CustomPlotInfo.py
│ ├── Data2DStatistics.py
│ ├── DataStructures.py
│ ├── DummyPlotTimelines.py
│ ├── FoamFileGenerator.py
│ ├── FoamOptionParser.py
│ ├── GeneralPlotTimelines.py
│ ├── GeneralVCSInterface.py
│ ├── GitInterface.py
│ ├── GnuplotCompare.py
│ ├── GnuplotFile.py
│ ├── GnuplotTimelines.py
│ ├── Helpers.py
│ ├── HgInterface.py
│ ├── LineReader.py
│ ├── MatplotlibTimelines.py
│ ├── OutFileCollection.py
│ ├── OutputFile.py
│ ├── PlotTimelinesFactory.py
│ ├── PlyParser.py
│ ├── ProgressOutput.py
│ ├── QwtPlotTimelines.py
│ ├── RestructuredTextHelper.py
│ ├── RingBuffer.py
│ ├── RunDatabase.py
│ ├── STLFile.py
│ ├── SpreadsheetData.py
│ ├── SvkInterface.py
│ ├── SvnInterface.py
│ ├── TableData.py
│ ├── TemplateFile.py
│ ├── TerminalFormatter.py
│ ├── TimeLineCollection.py
│ ├── Utilities.py
│ ├── XkcdMatplotlibTimelines.py
│ └── __init__.py
├── Error.py
├── Execution
│ ├── AnalyzedCommon.py
│ ├── AnalyzedRunner.py
│ ├── AnalyzedWatcher.py
│ ├── BasicRunner.py
│ ├── BasicWatcher.py
│ ├── ConvergenceRunner.py
│ ├── FoamThread.py
│ ├── GnuplotRunner.py
│ ├── ParallelExecution.py
│ ├── StepAnalyzedCommon.py
│ ├── StepAnalyzedRunner.py
│ ├── StepAnalyzedWatcher.py
│ ├── UtilityRunner.py
│ └── __init__.py
├── FoamInformation.py
├── IPythonHelpers
│ ├── Case.py
│ ├── Notebook.py
│ ├── PermanentStorage.py
│ └── __init__.py
├── Infrastructure
│ ├── Authentication.py
│ ├── Blink1.py
│ ├── CTestRun.py
│ ├── ClusterJob.py
│ ├── Configuration.py
│ ├── FoamMetaServer.py
│ ├── FoamServer.py
│ ├── Hardcoded.py
│ ├── Logging.py
│ ├── NetworkHelpers.py
│ ├── RunHook.py
│ ├── RunHooks
│ │ ├── MailToAddress.py
│ │ ├── PrintMessageHook.py
│ │ ├── SendToWebservice.py
│ │ ├── WriteToSqliteDatabase.py
│ │ └── __init__.py
│ ├── ServerBase.py
│ ├── ZeroConf.py
│ └── __init__.py
├── LogAnalysis
│ ├── BoundingLineAnalyzer.py
│ ├── BoundingLogAnalyzer.py
│ ├── ContextLineAnalyzer.py
│ ├── ContinuityLineAnalyzer.py
│ ├── DeltaTLineAnalyzer.py
│ ├── EchoLineAnalyzer.py
│ ├── EchoLogAnalyzer.py
│ ├── ExecNameLineAnalyzer.py
│ ├── ExecutionTimeLineAnalyzer.py
│ ├── FileLineAnalyzer.py
│ ├── FoamLogAnalyzer.py
│ ├── GeneralLineAnalyzer.py
│ ├── LinearSolverLineAnalyzer.py
│ ├── LogAnalyzerApplication.py
│ ├── LogLineAnalyzer.py
│ ├── NameFinderLineAnalyzer.py
│ ├── PhaseChangerLineAnalyzer.py
│ ├── RegExpLineAnalyzer.py
│ ├── SimpleLineAnalyzer.py
│ ├── StandardLogAnalyzer.py
│ ├── SteadyConvergedLineAnalyzer.py
│ ├── TimeLineAnalyzer.py
│ ├── TimeLineLineAnalyzer.py
│ ├── UtilityAnalyzer.py
│ ├── ValueLineAnalyzer.py
│ └── __init__.py
├── Paraview
│ ├── Data.py
│ ├── ServermanagerWrapper.py
│ ├── SimpleFilters.py
│ ├── SimpleSources.py
│ ├── SourceBase.py
│ ├── StateFile.py
│ └── __init__.py
├── RunDictionary
│ ├── BlockMesh.py
│ ├── BlockMesh2D.py
│ ├── BoundaryDict.py
│ ├── FileBasis.py
│ ├── LagrangianCloudData.py
│ ├── LagrangianPatchData.py
│ ├── ListFile.py
│ ├── MeshInformation.py
│ ├── ParameterFile.py
│ ├── ParsedBlockMeshDict.py
│ ├── ParsedParameterFile.py
│ ├── RegionCases.py
│ ├── SampleDirectory.py
│ ├── SolutionDirectory.py
│ ├── SolutionFile.py
│ ├── SurfaceDirectory.py
│ ├── TimeDirectory.py
│ ├── TimelineDirectory.py
│ └── __init__.py
├── Site
│ └── __init__.py
├── ThirdParty
│ ├── Gnuplot
│ │ ├── ANNOUNCE.txt
│ │ ├── CREDITS.txt
│ │ ├── Errors.py
│ │ ├── LICENSE.txt
│ │ ├── PlotItems.py
│ │ ├── README.txt
│ │ ├── _Gnuplot.py
│ │ ├── __init__.py
│ │ ├── demo.py
│ │ ├── enableNumeric.patch
│ │ ├── funcutils.py
│ │ ├── gnuplot_Suites.py
│ │ ├── gp.py
│ │ ├── gp_cygwin.py
│ │ ├── gp_java.py
│ │ ├── gp_mac.py
│ │ ├── gp_macosx.py
│ │ ├── gp_unix.py
│ │ ├── gp_win32.py
│ │ ├── setup.cfg
│ │ ├── setup.py
│ │ ├── termdefs.py
│ │ ├── test.py
│ │ └── utils.py
│ ├── IPy.py
│ ├── __init__.py
│ ├── ply
│ │ ├── README
│ │ ├── __init__.py
│ │ ├── lex.py
│ │ └── yacc.py
│ ├── pyratemp.py
│ ├── pyratemp
│ │ ├── LICENSE
│ │ ├── NEWS
│ │ ├── README
│ │ ├── example.html
│ │ ├── example.json
│ │ ├── pyratemp.html
│ │ ├── pyratemp.txt
│ │ └── yaml2pyratemp.py
│ ├── six.py
│ ├── six
│ │ ├── CHANGES
│ │ ├── LICENSE
│ │ ├── MANIFEST.in
│ │ ├── PKG-INFO
│ │ ├── README
│ │ ├── documentation
│ │ │ ├── Makefile
│ │ │ ├── conf.py
│ │ │ └── index.rst
│ │ ├── setup.py
│ │ └── test_six.py
│ ├── tqdm
│ │ ├── .coveragerc
│ │ ├── .gitignore
│ │ ├── .mailmap
│ │ ├── .travis.yml
│ │ ├── CONTRIBUTE
│ │ ├── LICENCE
│ │ ├── MANIFEST.in
│ │ ├── Makefile
│ │ ├── PKG-INFO
│ │ ├── README.rst
│ │ ├── RELEASE
│ │ ├── __init__.py
│ │ ├── examples
│ │ │ ├── include_no_requirements.py
│ │ │ ├── pandas_progress_apply.py
│ │ │ ├── progressbar
│ │ │ │ ├── __init__.py
│ │ │ │ ├── compat.py
│ │ │ │ ├── progressbar.py
│ │ │ │ └── widgets.py
│ │ │ ├── simple_examples.py
│ │ │ └── tqdm_wget.py
│ │ ├── logo.png
│ │ ├── setup.cfg
│ │ ├── setup.py
│ │ ├── tox.ini
│ │ ├── tqdm.gif
│ │ └── tqdm
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── _main.py
│ │ │ ├── _tqdm.py
│ │ │ ├── _tqdm_gui.py
│ │ │ ├── _tqdm_notebook.py
│ │ │ ├── _tqdm_pandas.py
│ │ │ ├── _utils.py
│ │ │ ├── _version.py
│ │ │ └── tests
│ │ │ ├── tests_main.py
│ │ │ ├── tests_pandas.py
│ │ │ ├── tests_perf.py
│ │ │ ├── tests_tqdm.py
│ │ │ └── tests_version.py
│ └── winhacks.py
├── Wrappers
│ ├── Pandas.py
│ └── __init__.py
└── __init__.py
├── README
├── ReleaseNotes
├── ReleaseNotes.md
├── bin
├── pyFoamAPoMaFoXiiQt.py
├── pyFoamAddCaseDataToDatabase.py
├── pyFoamAddEmptyBoundary.py
├── pyFoamBench.py
├── pyFoamBinarySize.py
├── pyFoamBlockMeshConverter.py
├── pyFoamBlockMeshRewrite.py
├── pyFoamBuildHelper.py
├── pyFoamCaseBuilder.py
├── pyFoamCaseReport.py
├── pyFoamChangeBoundaryName.py
├── pyFoamChangeBoundaryType.py
├── pyFoamClearBoundaryValue.py
├── pyFoamClearCase.py
├── pyFoamClearEmptyBoundaries.py
├── pyFoamClearInternalField.py
├── pyFoamCloneCase.py
├── pyFoamClusterTester.py
├── pyFoamComparator.py
├── pyFoamCompareDictionary.py
├── pyFoamCompressCaseFiles.py
├── pyFoamConvertToCSV.py
├── pyFoamCopyLastToFirst.py
├── pyFoamCreateBoundaryPatches.py
├── pyFoamCreateModuleFile.py
├── pyFoamDecompose.py
├── pyFoamDisplayBlockMesh.py
├── pyFoamDumpConfiguration.py
├── pyFoamDumpRunDatabaseToCSV.py
├── pyFoamEchoDictionary.py
├── pyFoamEchoPickledApplicationData.py
├── pyFoamExecute.py
├── pyFoamFromTemplate.py
├── pyFoamFunkyDoCalcFiles.py
├── pyFoamIPythonNotebook.py
├── pyFoamInitVCSCase.py
├── pyFoamJoinCSV.py
├── pyFoamJoinTimelines.py
├── pyFoamListCases.py
├── pyFoamListProfilingInfo.py
├── pyFoamMeshUtilityRunner.py
├── pyFoamModifyGGIBoundary.py
├── pyFoamNetList.py
├── pyFoamNetShell.py
├── pyFoamPVLoadState.py
├── pyFoamPVSnapshot.py
├── pyFoamPVSnapshotMesa.py
├── pyFoamPVSnapshotMesaLLVM.py
├── pyFoamPVSnapshotMesaSWR.py
├── pyFoamPVSnapshotNative.py
├── pyFoamPackCase.py
├── pyFoamPlotRunner.py
├── pyFoamPlotWatcher.py
├── pyFoamPotentialRunner.py
├── pyFoamPrepareCase.py
├── pyFoamPrintData2DStatistics.py
├── pyFoamReadDictionary.py
├── pyFoamRedoPlot.py
├── pyFoamRestartRunner.py
├── pyFoamRunAtMultipleTimes.py
├── pyFoamRunParameterVariation.py
├── pyFoamRunner.py
├── pyFoamSTLUtility.py
├── pyFoamSamplePlot.py
├── pyFoamStandardLogAnalyzer.py
├── pyFoamSteadyRunner.py
├── pyFoamSurfacePlot.py
├── pyFoamSymlinkToFile.py
├── pyFoamTestConfiguration.py
├── pyFoamTimelinePlot.py
├── pyFoamUpdateDictionary.py
├── pyFoamUpgradeDictionariesTo17.py
├── pyFoamUpgradeDictionariesTo20.py
├── pyFoamUtilityRunner.py
├── pyFoamVersion.py
└── pyFoamWriteDictionary.py
├── breaksUnittest
└── TimeLineAnalyzer.py
├── contrib
├── Mercurial_extension
│ └── foamdiff.py
├── Olesen_centralInstallation
│ ├── makelinks-pyFoam
│ ├── profile.pyfoam
│ └── pyFoam
└── README
├── debian
├── changelog
├── compat
├── control
├── copyright
├── debianInstallation.cfg
├── docs
├── pyfoam.install
└── rules
├── debianInstallation.cfg
├── distScripts
└── makeManFiles.py
├── doc
├── Makefile
├── _build
│ └── .stubForHgGit
├── _static
│ └── .stubForHgGit
├── _templates
│ └── .stubForHgGit
├── conf.py
└── index.rst
├── exampleSite
├── etc
│ └── pyfoamrc.d
│ │ └── helloHook.cfg
└── lib
│ └── EchoHook.py
├── examples
├── CaseBuilder
│ ├── lesSnappy.pfcb
│ └── simpleFluent.pfcb
├── ClusterScripts
│ └── runPitzDaily.py
├── TestRunner
│ ├── CMakeLists.txt
│ ├── PitzDailyData
│ │ ├── additionalFunctionObjects
│ │ └── copyToCase
│ │ │ ├── customRegexp
│ │ │ ├── referenceSet
│ │ │ └── 760
│ │ │ │ ├── lineXis01_U.xy
│ │ │ │ ├── lineXis0285_U.xy
│ │ │ │ ├── lineXis02_U.xy
│ │ │ │ └── lineYis0_U.xy
│ │ │ └── system
│ │ │ └── sampleDict
│ ├── runCTest.txt
│ ├── runIcoFoamCavity.py
│ ├── runIcoFoamCavityParallel.py
│ ├── runMultiRegionHeater.py
│ ├── runMultiRegionHeaterParallel.py
│ ├── runPitzDailyBasic.py
│ ├── runPitzDailyExptInlet.py
│ ├── runPitzDailyLinear.py
│ └── runPitzDailyParallel.py
├── compactOutput.py
├── data
│ ├── defaultBench.cfg
│ ├── standardBench.cfg
│ ├── standardBench_v1.cfg
│ ├── standardBench_v1_pre12.cfg
│ └── standardBench_v2.cfg
├── doInletVariation.py
├── interFoamLogAnalyzer.py
├── paraview3
│ ├── gDirection.py
│ ├── gDirection_old.py
│ ├── probeAndSetDisplay.py
│ ├── snappyDisplay.py
│ └── testSimpleSources.py
├── printLastResiduals.py
├── tailReplacement.py
├── templates
│ ├── newSchool.template
│ ├── newSchool.values
│ └── oldSchool.template
├── transformSolvers.py
└── trivialLogAnalyzer.py
├── maintainance
└── makeUnitTestStubFiles.py
├── obsolete
├── bin
│ ├── pyFoamAPoMaFoX.py
│ └── pyFoamPlotResiduals.py
└── lib
│ └── APoMaFoX.py
├── pytest.ini
├── sbin
├── pyFoamMetaServer.py
├── pyFoamSGECheckpointCommand.sh
├── pyFoamSGECleanCommand.sh
├── pyFoamSGECommand.py
└── pyFoamSGEMigrateCommand.sh
├── setDevelopmentPath.sh
├── setup.cfg
├── setup.py
├── test
├── checkFoamServers.py
├── doLogging.py
├── errorTest.py
├── findServerports.py
├── queryFoamServer.py
├── queryMetaServer.py
├── readFoamFile.py
├── testBlockMeshPArser.py
├── testParameterFile.py
├── testSolutionDir.py
├── testSolutionFile.py
└── zeroConfFoamServerBrowser.py
└── unittests
├── Applications
├── __init__.py
├── test_APoMaFoXiiQt.py
├── test_AddCaseDataToDatabase.py
├── test_Benchmark.py
├── test_BinarySize.py
├── test_BlockMeshConverter.py
├── test_BlockMeshRewrite.py
├── test_BuildHelper.py
├── test_CaseBuilder.py
├── test_CaseBuilderBackend.py
├── test_CaseReport.py
├── test_ChangeBoundaryName.py
├── test_ChangeBoundaryType.py
├── test_ChangePython.py
├── test_ClearBoundaryValue.py
├── test_ClearCase.py
├── test_ClearInternalField.py
├── test_CloneCase.py
├── test_ClusterTester.py
├── test_CommonBlink1.py
├── test_CommonCaseBuilder.py
├── test_CommonChangeBoundary.py
├── test_CommonClearCase.py
├── test_CommonLibFunctionTrigger.py
├── test_CommonMultiRegion.py
├── test_CommonParallel.py
├── test_CommonParserOptions.py
├── test_CommonPickledDataInput.py
├── test_CommonPlotLines.py
├── test_CommonPlotOptions.py
├── test_CommonPrePostHooks.py
├── test_CommonReadWriteCSV.py
├── test_CommonReportRunnerData.py
├── test_CommonReportUsage.py
├── test_CommonRestart.py
├── test_CommonSafeTrigger.py
├── test_CommonSelectTimesteps.py
├── test_CommonServer.py
├── test_CommonStandardOutput.py
├── test_CommonTemplateBehaviour.py
├── test_CommonTemplateFormat.py
├── test_CommonVCSCommit.py
├── test_CommonWriteAllTrigger.py
├── test_Comparator.py
├── test_CompareDictionary.py
├── test_CompressCaseFiles.py
├── test_ConvertToCSV.py
├── test_CopyLastToFirst.py
├── test_CreateBoundaryPatches.py
├── test_CreateModuleFile.py
├── test_Decomposer.py
├── test_DisplayBlockMesh.py
├── test_DisplayBlockMeshQt.py
├── test_DumpRunDatabaseToCSV.py
├── test_EchoDictionary.py
├── test_EchoPickledApplicationData.py
├── test_Execute.py
├── test_FromTemplate.py
├── test_IPythonNotebook.py
├── test_InitVCSCase.py
├── test_JoinCSV.py
├── test_ListCases.py
├── test_ListProfilingInfo.py
├── test_MeshUtilityRunner.py
├── test_ModifyGGIBoundary.py
├── test_PVLoadState.py
├── test_PVSnapshot.py
├── test_PackCase.py
├── test_PlotHelpers.py
├── test_PlotRunner.py
├── test_PlotWatcher.py
├── test_PotentialRunner.py
├── test_PrepareCase.py
├── test_PrintData2DStatistics.py
├── test_PyFoamApplication.py
├── test_PyFoamApplicationQt4.py
├── test_ReadDictionary.py
├── test_RedoPlot.py
├── test_RunAtMultipleTimes.py
├── test_RunParameterVariation.py
├── test_Runner.py
├── test_STLUtility.py
├── test_SamplePlot.py
├── test_SteadyRunner.py
├── test_SurfacePlot.py
├── test_SymlinkToFile.py
├── test_TestConfiguration.py
├── test_TimelinePlot.py
├── test_UpdateDictionary.py
├── test_UpgradeDictionariesTo17.py
├── test_UpgradeDictionariesTo20.py
├── test_UtilityRunnerApp.py
└── test_WriteDictionary.py
├── Basics
├── __init__.py
├── test_BasicFile.py
├── test_BlockMeshComponents.py
├── test_CSVCollection.py
├── test_CustomPlotInfo.py
├── test_Data2DStatistics.py
├── test_DataStructures.py
├── test_DummyPlotTimelines.py
├── test_FoamFileGenerator.py
├── test_FoamOptionParser.py
├── test_GeneralPlotTimelines.py
├── test_GeneralVCSInterface.py
├── test_GitInterface.py
├── test_GnuplotCompare.py
├── test_GnuplotFile.py
├── test_GnuplotTimelines.py
├── test_Helpers.py
├── test_HgInterface.py
├── test_LineReader.py
├── test_MatplotlibTimelines.py
├── test_OutFileCollection.py
├── test_OutputFile.py
├── test_PlotTimelinesFactory.py
├── test_PlyParser.py
├── test_ProgressOutput.py
├── test_QwtPlotTimelines.py
├── test_RestructuredTextHelper.py
├── test_RingBuffer.py
├── test_RunDatabase.py
├── test_STLFile.py
├── test_SpreadsheetData.py
├── test_SvkInterface.py
├── test_SvnInterface.py
├── test_TableData.py
├── test_TemplateFile.py
├── test_TerminalFormatter.py
├── test_TimeLineCollection.py
├── test_Utilities.py
└── test_XkcdMatplotlibTimelines.py
├── Execution
├── __init__.py
├── test_AnalyzedCommon.py
├── test_AnalyzedRunner.py
├── test_AnalyzedWatcher.py
├── test_BasicRunner.py
├── test_BasicWatcher.py
├── test_ConvergenceRunner.py
├── test_FoamThread.py
├── test_GnuplotRunner.py
├── test_ParallelExecution.py
├── test_StepAnalyzedCommon.py
├── test_StepAnalyzedRunner.py
├── test_StepAnalyzedWatcher.py
└── test_UtilityRunner.py
├── IPythonHelpers
├── __init__.py
├── test_Case.py
├── test_Notebook.py
└── test_PermanentStorage.py
├── Infrastructure
├── RunHooks
│ ├── test_MailToAddress.py
│ ├── test_PrintMessageHook.py
│ ├── test_SendToWebservice.py
│ └── test_WriteToSqliteDatabase.py
├── __init__.py
├── test_Blink1.py
├── test_CTestRun.py
├── test_ClusterJob.py
├── test_Configuration.py
├── test_FoamMetaServer.py
├── test_FoamServer.py
├── test_Hardcoded.py
├── test_Logging.py
├── test_NetworkHelpers.py
├── test_RunHook.py
└── test_ServerBase.py
├── LogAnalysis
├── __init__.py
├── test_BoundingLineAnalyzer.py
├── test_BoundingLogAnalyzer.py
├── test_ContextLineAnalyzer.py
├── test_ContinuityLineAnalyzer.py
├── test_DeltaTLineAnalyzer.py
├── test_EchoLineAnalyzer.py
├── test_EchoLogAnalyzer.py
├── test_ExecNameLineAnalyzer.py
├── test_ExecutionTimeLineAnalyzer.py
├── test_FileLineAnalyzer.py
├── test_FoamLogAnalyzer.py
├── test_GeneralLineAnalyzer.py
├── test_LineFeeder.py
├── test_LinearSolverLineAnalyzer.py
├── test_LogAnalyzerApplication.py
├── test_LogLineAnalyzer.py
├── test_NameFinderLineAnalyzer.py
├── test_PhaseChangerLineAnalyzer.py
├── test_RegExpLineAnalyzer.py
├── test_SimpleLineAnalyzer.py
├── test_StandardLogAnalyzer.py
├── test_SteadyConvergedLineAnalyzer.py
├── test_TimeLineAnalyzer.py
├── test_TimeLineLineAnalyzer.py
├── test_UtilityAnalyzer.py
└── test_ValueLineAnalyzer.py
├── RunDictionary
├── __init__.py
├── test_BlockMesh.py
├── test_BlockMesh2D.py
├── test_BoundaryDict.py
├── test_FileBasis.py
├── test_LagrangianCloudData.py
├── test_LagrangianPatchData.py
├── test_ListFile.py
├── test_MeshInformation.py
├── test_ParameterFile.py
├── test_ParsedBlockMeshDict.py
├── test_ParsedParameterFile.py
├── test_RegionCases.py
├── test_SampleDirectory.py
├── test_SolutionDirectory.py
├── test_SolutionFile.py
├── test_SurfaceDirectory.py
├── test_TimeDirectory.py
└── test_TimelineDirectory.py
├── Wrappers
├── __init__.py
└── test_Pandas.py
├── test_Error.py
└── test_FoamInformation.py
/.ackrc:
--------------------------------------------------------------------------------
1 | --ignore-dir=doc
2 | --ignore-dir=.pybuild
3 | --ignore-dir=build
4 | --ignore-dir=htmlcov
5 | --ignore-dir=debian
6 | --ignore-dir=PyFoam.docset
7 | --ignore-dir=doc.old
8 |
--------------------------------------------------------------------------------
/.agignore:
--------------------------------------------------------------------------------
1 | doc
2 | build
3 |
4 | *~
5 |
6 | *.pickle
7 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | PyFoam
4 |
5 |
6 |
7 |
8 |
9 | org.python.pydev.PyDevBuilder
10 |
11 |
12 |
13 |
14 |
15 | org.python.pydev.pythonNature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | recursive-include doc *
2 | recursive-include examples *.py
3 | recursive-include examples *.pfcb
4 | recursive-include examples/data *.cfg
5 | recursive-include test *.py
6 | recursive-include unittests *.py
7 | recursive-include contrib *
8 | global-exclude *~
9 | prune */.svn
10 | prune */*/.svn
11 | include ReleaseNotes
12 | include ReleaseNotes.md
13 | include ReleaseNotes.html
14 | include README
15 | include COPYING
16 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | all: docu sdist rpm
2 |
3 | docuold:
4 | # epydoc --graph=all --output=doc PyFoam --parse-only -v --include-log --css=grayscale
5 | # epydoc --output=doc PyFoam --parse-only -v --include-log --css=grayscale
6 | epydoc --output=doc.old PyFoam --introspect-only -v --include-log --inheritance=grouped --show-imports --include-log --graph=umlclasstree
7 |
8 | docu:
9 | sphinx-apidoc --separate -o doc/api PyFoam
10 | (cd doc; make html)
11 |
12 | docset: docu
13 | doc2dash -I index.html -n PyFoam doc/_build/html
14 |
15 | sdist: docu ReleaseNotes.md ReleaseNotes.html
16 | python setup.py sdist
17 |
18 | wheel: sdist
19 | python setup.py bdist_wheel --universal
20 |
21 | rpm:
22 | python setup.py bdist_rpm
23 |
24 | dpkg:
25 | dpkg-buildpackage
26 | # dpkg-buildpackage -us -uc
27 |
28 | source-dpkg:
29 | dpkg-buildpackage -S
30 |
31 | ReleaseNotes.md: ReleaseNotes
32 | pandoc --from=org --to=markdown ReleaseNotes -o ReleaseNotes.md
33 |
34 | ReleaseNotes.html: ReleaseNotes
35 | pandoc --from=org --to=html ReleaseNotes -o ReleaseNotes.html
36 |
--------------------------------------------------------------------------------
/PlotTest/runTest.sh:
--------------------------------------------------------------------------------
1 | # python writeUniform.py >data
2 | python writeNonUniform.py >data
3 | pyFoamPlotWatcher.py --custom="Test (%f%)" data --write --tail=0
4 |
--------------------------------------------------------------------------------
/PlotTest/writeNonUniform.py:
--------------------------------------------------------------------------------
1 |
2 | from math import sin,pi,tan
3 |
4 | total=10000
5 | nr=100
6 | totalRise=3
7 | amplitude=1
8 |
9 | alpha=2*pi/(total/float(nr))
10 |
11 | for t in range(total):
12 | time=tan(0.9*pi*t/float(total)/2)
13 | print "Time =",time
14 | print "Test",totalRise*time+amplitude*sin(t*alpha)
15 |
16 |
--------------------------------------------------------------------------------
/PlotTest/writeUniform.py:
--------------------------------------------------------------------------------
1 |
2 | from math import sin,pi
3 |
4 | total=10000
5 | nr=100
6 | totalRise=3
7 | amplitude=1
8 |
9 | alpha=2*pi/(total/float(nr))
10 |
11 | for t in range(total):
12 | time=t/float(total)
13 | print "Time =",time
14 | print "Test",totalRise*time+amplitude*sin(t*alpha)
15 |
16 |
--------------------------------------------------------------------------------
/PyFoam/Applications/CommonReportUsage.py:
--------------------------------------------------------------------------------
1 | """
2 | Class that implements the common functionality for reporting the usage of a run
3 | """
4 |
5 | from PyFoam.ThirdParty.six import print_
6 |
7 | class CommonReportUsage(object):
8 | """ The class that reports the resource usage
9 | """
10 |
11 | def addOptions(self):
12 | self.ensureGeneralOptions()
13 | self.generalOpts.add_option("--report-usage",
14 | action="store_true",
15 | default=False,
16 | dest="reportUsage",
17 | help="After the execution the maximum memory usage is printed to the screen")
18 |
19 | def reportUsage(self,run):
20 | if self.opts.reportUsage:
21 | print_("\n Used Memory: ",run.run.usedMemory(),"MB")
22 |
23 | # Should work with Python3 and Python2
24 |
--------------------------------------------------------------------------------
/PyFoam/Applications/CommonRestart.py:
--------------------------------------------------------------------------------
1 | """
2 | Class that implements the common functionality for restarting cases
3 | """
4 |
5 | class CommonRestart(object):
6 | """ The class that restarts the case
7 | """
8 |
9 | def addOptions(self):
10 | self.ensureGeneralOptions()
11 | self.generalOpts.add_option("--restart",
12 | action="store_true",
13 | default=False,
14 | dest="restart",
15 | help="Restart the simulation from the last time-step")
16 |
17 |
18 |
--------------------------------------------------------------------------------
/PyFoam/Applications/CommonServer.py:
--------------------------------------------------------------------------------
1 | """
2 | Class that implements the common functionality for having a server
3 | """
4 |
5 | class CommonServer(object):
6 | """ The class that switches on and off the server
7 | """
8 |
9 | def addOptions(self,haveServer=True):
10 | self.ensureGeneralOptions()
11 | from PyFoam import configuration as conf
12 | defaultForServer=conf().getboolean("Network","startServerThread")
13 |
14 | if haveServer and defaultForServer:
15 | self.generalOpts.add_option("--no-server-process",
16 | action="store_false",
17 | default=True,
18 | dest="server",
19 | help="Do not start a server process that can control the process")
20 | else:
21 | self.generalOpts.add_option("--start-server-process",
22 | action="store_true",
23 | default=True,
24 | dest="server",
25 | help="Start a server process that can control the process")
26 |
--------------------------------------------------------------------------------
/PyFoam/Applications/CommonTemplateFormat.py:
--------------------------------------------------------------------------------
1 | """
2 | Class that implements the common functionality for the format of templates
3 | """
4 | from optparse import OptionGroup
5 |
6 | from PyFoam import configuration as config
7 |
8 | class CommonTemplateFormat(object):
9 | """ The class that defines options for template formats
10 | """
11 |
12 | def addOptions(self):
13 | tformat=OptionGroup(self.parser,
14 | "Format",
15 | "Specifying details about the format of the pyratemp-templates (new format)")
16 | self.parser.add_option_group(tformat)
17 | tformat.add_option("--expression-delimiter",
18 | action="store",
19 | default=config().get("Template","expressionDelimiter"),
20 | dest="expressionDelimiter",
21 | help="String that delimits an expression. At the end of the expression the reverse string is being used. Default: %default")
22 | tformat.add_option("--assignment-line-start",
23 | action="store",
24 | default=config().get("Template","assignmentLineStart"),
25 | dest="assignmentLineStart",
26 | help="String at the start of a line that signifies that this is an assignment. Default: %default")
27 |
--------------------------------------------------------------------------------
/PyFoam/Applications/EchoPickledApplicationData.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """
3 | Application class that implements pyFoamEchoPickledApplicationData
4 | """
5 |
6 | from .PyFoamApplication import PyFoamApplication
7 |
8 | from .CommonPickledDataInput import CommonPickledDataInput
9 |
10 | class EchoPickledApplicationData(PyFoamApplication,
11 | CommonPickledDataInput):
12 | def __init__(self,
13 | args=None,
14 | inputApp=None,
15 | **kwargs):
16 | description="""\ Reads a file with pickled application data
17 | and if asked for prints it. Mainly used for testing the exchange of
18 | data via pickled data
19 | """
20 |
21 | PyFoamApplication.__init__(self,
22 | args=args,
23 | description=description,
24 | usage="%prog [options]",
25 | nr=0,
26 | changeVersion=False,
27 | interspersed=True,
28 | inputApp=inputApp,
29 | **kwargs)
30 |
31 | def addOptions(self):
32 | CommonPickledDataInput.addOptions(self)
33 |
34 | def run(self):
35 | self.setData(self.readPickledData())
36 |
37 | # Should work with Python3 and Python2
38 |
--------------------------------------------------------------------------------
/PyFoam/Applications/PlotHelpers.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """
3 | Helper-functions for the plots
4 | """
5 | from os import path
6 |
7 | def cleanFilename(orig):
8 | """
9 | Clean the filename in such a way that it is suitable for use in
10 | HTML and LaTeX-documents
11 | """
12 | dName,fName=path.split(orig)
13 | fName,ext=path.splitext(fName)
14 |
15 | # HTML doesn't like spaces
16 | fName=fName.replace(' ','space')
17 | # LaTeX doesn't like dots
18 | fName=fName.replace('.','dot')
19 | result=path.join(dName,fName)+ext
20 |
21 | return result
22 |
--------------------------------------------------------------------------------
/PyFoam/Applications/__init__.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ Application-Classes
3 |
4 | Classes that implement application
5 | """
6 |
--------------------------------------------------------------------------------
/PyFoam/Basics/GitInterface.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """A VCS-interface to Mercurial"""
3 |
4 | from PyFoam.Error import warning,error,notImplemented
5 |
6 | from .GeneralVCSInterface import GeneralVCSInterface
7 |
8 | from os import path as opath
9 | import subprocess
10 | import os
11 |
12 | class GitInterface(GeneralVCSInterface):
13 | """\
14 | The interface class to git
15 |
16 | Only a partial implementation (As much as the BuildHelper needs)"""
17 |
18 | def __init__(self,
19 | path,
20 | init=False):
21 |
22 | GeneralVCSInterface.__init__(self,path,init)
23 | if init:
24 | notImplemented(self,"__init__ (creation of a repository)")
25 |
26 |
27 | def getRoot(self,path):
28 | oldDir=os.getcwd()
29 | os.chdir(path)
30 | result=self.executeWithOuput("git rev-parse --show-toplevel")
31 | os.chdir(oldDir)
32 | return result
33 |
34 | def branchName(self):
35 | return self.doInPath(self.executeWithOuput,"git rev-parse --abbrev-ref HEAD")
36 |
37 | def getRevision(self):
38 | return self.doInPath(self.executeWithOuput,"git rev-parse --short HEAD")
39 |
40 | def update(self,
41 | timeout=None):
42 | ok=self.doInPath(subprocess.call,["git","pull"])
43 | return ok==0
44 |
45 |
46 | # Should work with Python3 and Python2
47 |
--------------------------------------------------------------------------------
/PyFoam/Basics/Helpers.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """Utility functions"""
3 |
4 | from os import listdir
5 |
6 | def getLinearNames(d):
7 | """get a list of all the files with information about the
8 | residuals of the linear solver (only the ones without _2 etc
9 |
10 | d - the directory"""
11 | names=[]
12 | for f in listdir(d):
13 | tmp=f.split("_")
14 | if len(tmp)>1:
15 | if tmp[0]=="linear":
16 | name=tmp[1]
17 | if names.count(name)==0:
18 | names.append(name)
19 |
20 | return names
21 |
22 | # Should work with Python3 and Python2
23 |
--------------------------------------------------------------------------------
/PyFoam/Basics/ProgressOutput.py:
--------------------------------------------------------------------------------
1 | """Output of progress"""
2 |
3 | class ProgressOutput(object):
4 | """This class generates output for recording the progress"""
5 |
6 | def __init__(self,oFile=None):
7 | """:param oFile: file-type object that gets the progress output"""
8 | self.oFile=oFile
9 | self.oLen=0
10 | self.storedLen=0
11 | self._lastProgress=""
12 | self._currentProgress=""
13 |
14 | def reset(self):
15 | """reset for the next time"""
16 | if self.storedLen>self.oLen and self.oFile:
17 | # clear residual fro mprevious outputs
18 | self.oFile.write(" "*(self.storedLen-self.oLen))
19 |
20 | self._lastProgress=self._currentProgress
21 | self._currentProgress=""
22 |
23 | if self.oFile:
24 | self.oFile.write("\r")
25 | self.oFile.flush()
26 |
27 | self.storedLen=self.oLen
28 | self.oLen=0
29 |
30 | def lastProgress(self):
31 | return self._lastProgress
32 |
33 | def __call__(self,msg):
34 | """Add to the progress message
35 | :param msg: the text to add"""
36 | self._currentProgress+=" "+msg
37 | if self.oFile:
38 | self.oFile.write(" "+msg)
39 | self.oFile.flush()
40 | self.oLen+=len(msg)+1
41 |
--------------------------------------------------------------------------------
/PyFoam/Basics/RingBuffer.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """A ring-buffer data structure"""
3 |
4 | class RingBuffer(object):
5 | """A data structure that stores a number N of elements. The
6 | N+1-element overwrites the first and so on ...."""
7 |
8 | def __init__(self,nr=1000):
9 | """
10 | :param nr: Number of elements to store
11 | """
12 | self.nr=nr
13 | self.list=[None]*nr
14 | self.point=0
15 | self.full=False
16 |
17 | def insert(self,dings):
18 | """ Inserts am element into the ring-buffer
19 | """
20 | # print "Inserting at",self.point,":",dings
21 | self.list[self.point]=dings
22 | self.point+=1
23 | if self.point==self.nr:
24 | self.point=0
25 | self.full=True
26 |
27 | def last(self):
28 | """:return: the latest element in the buffer, None if
29 | nothing was inserted into the buffer"""
30 | if self.point>0:
31 | return self.list[self.point-1]
32 | elif self.full:
33 | return self.list[-1]
34 | else:
35 | return None
36 |
37 | def dump(self):
38 | """:return: A list with all the values in the ring buffer in the correct order
39 | (starting with the oldest)"""
40 | result=[]
41 |
42 | if self.full:
43 | for i in range(self.point,self.nr):
44 | result+=self.list[i]+"\n"
45 | for i in range(self.point):
46 | result+=self.list[i]+"\n"
47 |
48 | return result
49 |
--------------------------------------------------------------------------------
/PyFoam/Basics/SvkInterface.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """A VCS-interface to Mercurial"""
3 |
4 | from PyFoam.Error import warning,error,notImplemented
5 |
6 | from .GeneralVCSInterface import GeneralVCSInterface
7 |
8 | from os import path as opath
9 | import subprocess
10 | import os
11 |
12 | class SvkInterface(GeneralVCSInterface):
13 | """\
14 | The interface class to svk
15 |
16 | Only a partial implementation (As much as the BuildHelper needs)"""
17 |
18 | def __init__(self,
19 | path,
20 | init=False):
21 |
22 | GeneralVCSInterface.__init__(self,path,init)
23 | if init:
24 | notImplemented(self,"__init__ (creation of a repository)")
25 |
26 | def getInfo(self,info):
27 | output=self.doInPath(self.executeWithOuput,"svk info")
28 | for l in output.split("\n"):
29 | if l.find(info)==0:
30 | return l[len(info)+2:]
31 |
32 | return "nix"
33 |
34 | def getRevision(self):
35 | return self.getInfo("Revision")
36 |
37 | def branchName(self):
38 | # svk does not have branch names
39 | return self.getInfo("Depot Path")
40 |
41 | def update(self,
42 | timeout=None):
43 | ok=self.doInPath(subprocess.call,["svk","pull"])
44 | return ok==0
45 |
46 | # Should work with Python3 and Python2
47 |
--------------------------------------------------------------------------------
/PyFoam/Basics/SvnInterface.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """A VCS-interface to Mercurial"""
3 |
4 | from PyFoam.Error import warning,error,notImplemented
5 |
6 | from .GeneralVCSInterface import GeneralVCSInterface
7 |
8 | from os import path as opath
9 | import subprocess
10 | import os
11 |
12 | class SvnInterface(GeneralVCSInterface):
13 | """\
14 | The interface class to svn
15 |
16 | Only a partial implementation (As much as the BuildHelper needs)"""
17 |
18 | def __init__(self,
19 | path,
20 | init=False):
21 |
22 | GeneralVCSInterface.__init__(self,path,init)
23 | if init:
24 | notImplemented(self,"__init__ (creation of a repository)")
25 |
26 | def getInfo(self,info):
27 | output=self.doInPath(self.executeWithOuput,"svn info")
28 | for l in output.split("\n"):
29 | if l.find(info)==0:
30 | return l[len(info)+2:]
31 |
32 | return "nix"
33 |
34 | def branchName(self):
35 | # svn does not have branch names
36 | return self.getInfo("Repository Root")
37 |
38 | def getRevision(self):
39 | return self.getInfo("Revision")
40 |
41 | def update(self,
42 | timeout=None):
43 | ok=self.doInPath(subprocess.call,["svn","update"])
44 | return ok==0
45 |
46 | # Should work with Python3 and Python2
47 |
--------------------------------------------------------------------------------
/PyFoam/Basics/XkcdMatplotlibTimelines.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """Plots a collection of timelines"""
3 |
4 | from PyFoam.Error import warning,error
5 |
6 | from .MatplotlibTimelines import MatplotlibTimelines
7 |
8 | class XkcdMatplotlibTimelines(MatplotlibTimelines):
9 | """This class opens a matplotlib window, modifies it to XKCD-mode and plots a timelines-collection in it"""
10 |
11 | def __init__(self,
12 | timelines,
13 | custom,
14 | showWindow=True,
15 | registry=None):
16 | """:param timelines: The timelines object
17 | :type timelines: TimeLineCollection
18 | :param custom: A CustomplotInfo-object. Values in this object usually override the
19 | other options
20 | """
21 |
22 | MatplotlibTimelines.__init__(self,
23 | timelines,
24 | custom,
25 | showWindow=showWindow,
26 | registry=registry
27 | )
28 |
29 | from matplotlib import pyplot
30 | try:
31 | pyplot.xkcd()
32 | except AttributeError:
33 | from matplotlib import __version__
34 | warning("Installed version",__version__,
35 | " of Matplotlib does not support XKCD-mode (this is supported starting with version 1.3). Falling back to normal operations")
36 | # Should work with Python3 and Python2
37 |
--------------------------------------------------------------------------------
/PyFoam/Basics/__init__.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ Helper-Classes
3 |
4 | These Classes didn't fit anywhere else
5 | """
6 |
--------------------------------------------------------------------------------
/PyFoam/Execution/AnalyzedWatcher.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """Watches output and analyzes it"""
3 |
4 | from .BasicWatcher import BasicWatcher
5 | from .AnalyzedCommon import AnalyzedCommon
6 |
7 | class AnalyzedWatcher(BasicWatcher,AnalyzedCommon):
8 | def __init__(self,filename,analyzer,silent=False,tailLength=1000,sleep=0.1):
9 | """:param analyzer: analyzer
10 | :param filename: name of the logfile to watch
11 | :param silent: if True no output is sent to stdout
12 | :param tailLength: number of bytes at the end of the fail that should be output.
13 | Because data is output on a per-line-basis
14 | :param sleep: interval to sleep if no line is returned"""
15 |
16 | BasicWatcher.__init__(self,filename,silent=silent,tailLength=tailLength,sleep=sleep)
17 | AnalyzedCommon.__init__(self,self.filename,analyzer)
18 |
19 | # Should work with Python3 and Python2
20 |
--------------------------------------------------------------------------------
/PyFoam/Execution/StepAnalyzedRunner.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """An Analyzed Runner that does something at every time-step"""
3 |
4 | from .BasicRunner import BasicRunner
5 | from .StepAnalyzedCommon import StepAnalyzedCommon
6 |
7 | class StepAnalyzedRunner(StepAnalyzedCommon,BasicRunner):
8 | """The output of a command is analyzed while being run. At every time-step a command is performed"""
9 |
10 | def __init__(self,
11 | analyzer,
12 | argv=None,
13 | silent=False,
14 | logname="PyFoamSolve",
15 | smallestFreq=0.,
16 | server=False,
17 | remark=None,
18 | parameters=None,
19 | jobId=None,
20 | echoCommandLine=None):
21 | """:param smallestFreq: the smallest intervall of real time (in seconds) that the time change is honored"""
22 | BasicRunner.__init__(self,
23 | argv,
24 | silent,
25 | logname,
26 | server=server,
27 | remark=remark,
28 | parameters=parameters,
29 | echoCommandLine=echoCommandLine,
30 | jobId=jobId)
31 | StepAnalyzedCommon.__init__(self,
32 | logname,
33 | analyzer,
34 | smallestFreq=smallestFreq)
35 |
36 | # Should work with Python3 and Python2
37 |
--------------------------------------------------------------------------------
/PyFoam/Execution/StepAnalyzedWatcher.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """An Analyzed Runner that does something at every time-step"""
3 |
4 | from .BasicWatcher import BasicWatcher
5 | from .StepAnalyzedCommon import StepAnalyzedCommon
6 |
7 | class StepAnalyzedWatcher(StepAnalyzedCommon,BasicWatcher):
8 | """The output of a command is analyzed while being run. At every time-step a command is performed"""
9 |
10 | def __init__(self,filename,analyzer,silent=False,smallestFreq=0.,tailLength=1000,sleep=0.1):
11 | """:param smallestFreq: the smallest intervall of real time (in seconds) that the time change is honored"""
12 | BasicWatcher.__init__(self,filename,silent=silent,tailLength=tailLength,sleep=sleep)
13 | StepAnalyzedCommon.__init__(self,filename,analyzer,smallestFreq=smallestFreq)
14 |
15 | # Should work with Python3 and Python2
16 |
--------------------------------------------------------------------------------
/PyFoam/Execution/__init__.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ Program execution
3 |
4 | Classes that execute the OpenFoam applications in a controlled manner
5 | """
6 |
--------------------------------------------------------------------------------
/PyFoam/IPythonHelpers/__init__.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ IPython
3 |
4 | Classes that help interacting with IPython
5 | """
6 |
7 | import base64
8 | from IPython.display import Javascript, display
9 | from IPython.utils.py3compat import str_to_bytes, bytes_to_str
10 |
11 | def create_code_cell(code='', where='below'):
12 | """Create a code cell in the IPython Notebook.
13 |
14 | Found at https://github.com/ipython/ipython/issues/4983
15 |
16 | Parameters
17 | code: unicode
18 | Code to fill the new code cell with.
19 | where: unicode
20 | Where to add the new code cell.
21 | Possible values include:
22 | at_bottom
23 | above
24 | below"""
25 | encoded_code = bytes_to_str(base64.b64encode(str_to_bytes(code)))
26 | display(Javascript("""
27 | var code = IPython.notebook.insert_cell_{0}('code');
28 | code.set_text(atob("{1}"));
29 | """.format(where, encoded_code)))
30 |
31 | def storage():
32 | from .PermanentStorage import PermanentStorage
33 | return PermanentStorage()
34 |
--------------------------------------------------------------------------------
/PyFoam/Infrastructure/RunHook.py:
--------------------------------------------------------------------------------
1 | """Base class for all Run-Hooks"""
2 |
3 | from PyFoam import configuration
4 | from PyFoam.Error import notImplemented
5 |
6 | class RunHook(object):
7 | """The actual class"""
8 |
9 | def __init__(self,runner,name):
10 | self.runner=runner
11 | self.name=name
12 |
13 | def conf(self):
14 | """Quick access to the configuration"""
15 | return configuration().sectionProxy(self.name)
16 |
17 | def execute(self):
18 | notImplemented(self,"execute")
--------------------------------------------------------------------------------
/PyFoam/Infrastructure/RunHooks/PrintMessageHook.py:
--------------------------------------------------------------------------------
1 | """A simple hook that only prints a user-specified message"""
2 |
3 | from PyFoam.Infrastructure.RunHook import RunHook
4 | from PyFoam.ThirdParty.six import print_
5 |
6 | class PrintMessageHook(RunHook):
7 | """Print a small message"""
8 | def __init__(self,runner,name):
9 | RunHook.__init__(self,runner,name)
10 |
11 | self.message=self.conf().get("message")
12 |
13 | def __call__(self):
14 | print_(self.message)
15 |
16 | # Should work with Python3 and Python2
17 |
--------------------------------------------------------------------------------
/PyFoam/Infrastructure/RunHooks/WriteToSqliteDatabase.py:
--------------------------------------------------------------------------------
1 | """Write the data to a sqlite database"""
2 |
3 | from PyFoam.Infrastructure.RunHook import RunHook
4 |
5 | from PyFoam.Error import error
6 |
7 | from PyFoam.Basics.RunDatabase import RunDatabase
8 |
9 | from os import path
10 |
11 | from PyFoam.ThirdParty.six import print_
12 |
13 | class WriteToSqliteDatabase(RunHook):
14 | """Write the run information to a sqlite database"""
15 | def __init__(self,runner,name):
16 | RunHook.__init__(self,runner,name)
17 |
18 | self.create=self.conf().getboolean("createDatabase")
19 | self.database=path.expanduser(self.conf().get("database"))
20 |
21 | if not self.create and not path.exists(self.database):
22 | error("The database",self.database,"does not exists")
23 |
24 | def __call__(self):
25 | print_("Adding run information to database",self.database)
26 | db=RunDatabase(self.database,create=self.create)
27 | db.add(self.runner.getData())
28 |
--------------------------------------------------------------------------------
/PyFoam/Infrastructure/RunHooks/__init__.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ RuntimeHook-Classes
3 |
4 | Classes that can be executed before or after the running of the solver
5 | """
6 |
--------------------------------------------------------------------------------
/PyFoam/Infrastructure/__init__.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ Infrastructure-Classes
3 |
4 | Classes that are needed for setting up configuration directories, servers etc
5 | """
6 |
--------------------------------------------------------------------------------
/PyFoam/LogAnalysis/ContextLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """Line analyzer that finds data n lines after a matching line"""
3 |
4 | import re
5 |
6 | from .LogLineAnalyzer import LogLineAnalyzer
7 |
8 | class ContextLineAnalyzer(LogLineAnalyzer):
9 | """Base class for analyzers that work with a context"""
10 |
11 | def __init__(self,trigger,nr=1):
12 | """
13 | :param trigger: The regular expression that has to match before data is collected
14 | :param nr: The number of lines after the match that data is collected
15 | """
16 | LogLineAnalyzer.__init__(self)
17 |
18 | self.trigger=re.compile(trigger)
19 | self.registerRegexp(self.trigger)
20 | self.nr=nr
21 |
22 | self.cnt=0
23 |
24 | def doAnalysis(self,line):
25 | if self.cnt>0:
26 | self.cnt-=1
27 | if self.cnt==0:
28 | self.doActualAnalysis(line)
29 | else:
30 | m=self.trigger.match(line)
31 | if m!=None:
32 | self.cnt=self.nr
33 | self.callOnMatch(m)
34 |
35 | def doActualAnalysis(self,line):
36 | """
37 | Called nr lines after the match
38 |
39 | :param line: The line that should be analyzed
40 | """
41 | pass
42 |
43 | def callOnMatch(self,m):
44 | """
45 | Called if the line matches
46 |
47 | :param m: The match-object
48 | """
49 | pass
50 |
51 | # Should work with Python3 and Python2
52 |
--------------------------------------------------------------------------------
/PyFoam/LogAnalysis/EchoLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """Echos a line"""
3 |
4 | from .LogLineAnalyzer import LogLineAnalyzer
5 |
6 | from PyFoam.ThirdParty.six import print_
7 |
8 | class EchoLineAnalyzer(LogLineAnalyzer):
9 | """Test implementation. Simply echos every line it gets"""
10 |
11 | def __init__(self):
12 | LogLineAnalyzer.__init__(self)
13 |
14 | def doAnalysis(self,line):
15 | print_("<"+self.parent.getTime()+">"+line+"<")
16 |
17 | # Should work with Python3 and Python2
18 |
--------------------------------------------------------------------------------
/PyFoam/LogAnalysis/EchoLogAnalyzer.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """Echos a log"""
3 |
4 | from .FoamLogAnalyzer import FoamLogAnalyzer
5 |
6 | from .EchoLineAnalyzer import EchoLineAnalyzer
7 |
8 | class EchoLogAnalyzer(FoamLogAnalyzer):
9 | """
10 | Trivial analyzer. It echos the Log-File
11 | """
12 | def __init__(self):
13 | FoamLogAnalyzer.__init__(self,progress=False)
14 |
15 | self.addAnalyzer("Echo",EchoLineAnalyzer())
16 |
17 | # Should work with Python3 and Python2
18 |
--------------------------------------------------------------------------------
/PyFoam/LogAnalysis/ExecNameLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """Look for the name of the executable"""
3 |
4 | from .LogLineAnalyzer import LogLineAnalyzer
5 |
6 | from PyFoam.ThirdParty.six import print_
7 |
8 | class ExecNameLineAnalyzer(LogLineAnalyzer):
9 | """Looks for the name of the executable"""
10 |
11 | def __init__(self):
12 | LogLineAnalyzer.__init__(self)
13 |
14 | self.execName=None
15 | self.caseName=None
16 |
17 | def doAnalysis(self,line):
18 | tmp=line.split()
19 | if len(tmp)>=3:
20 | if self.execName is None and tmp[0]=="Exec" and tmp[1]==":":
21 | self.execName=tmp[2]
22 | self.notify(self.execName)
23 | if self.caseName is None and tmp[0]=="Case" and tmp[1]==":":
24 | self.caseName=tmp[2]
25 | # self.notify(self.caseName)
26 |
27 | # Should work with Python3 and Python2
28 |
--------------------------------------------------------------------------------
/PyFoam/LogAnalysis/FileLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """Line analyzer with output"""
3 |
4 | from .GeneralLineAnalyzer import GeneralLineAnalyzer
5 |
6 | class FileLineAnalyzer(GeneralLineAnalyzer):
7 | """Base class for analyzers that write data to files
8 |
9 | Just a stub to enable legacy code"""
10 |
11 | def __init__(self,titles=[]):
12 | """
13 | :param titles: The titles of the data elements
14 | """
15 | GeneralLineAnalyzer.__init__(self,doFiles=True,titles=titles)
16 |
17 | # Should work with Python3 and Python2
18 |
--------------------------------------------------------------------------------
/PyFoam/LogAnalysis/LogAnalyzerApplication.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """Wraps an Analyzer"""
3 |
4 | import sys
5 |
6 | from os import path,mkdir
7 |
8 | class LogAnalyzerApplication(object):
9 | """
10 | Wrapper for the Analyzer Classes
11 | - Builds a directory for their output
12 | - name is derived from the logfile-name
13 | - anounces the directory to them
14 | - starts the analyzer
15 | """
16 |
17 | def __init__(self,analyze):
18 | """ :param analyze: The analyzer"""
19 | self.analyzer=analyze
20 |
21 | def run(self,pfad=None):
22 | """ runs the analyzer
23 | :param pfad: path to the logfile, if no path is given it is
24 | taken from the command line"""
25 | if pfad==None:
26 | fn=sys.argv[1]
27 | else:
28 | fn=pfad
29 |
30 | pfad=path.abspath(fn)
31 | dn=path.dirname(pfad)
32 | oDir=path.join(dn,path.basename(pfad)+"_analyzed")
33 | if not path.exists(oDir):
34 | mkdir(oDir)
35 |
36 | self.analyzer.setDirectory(oDir)
37 |
38 | fh=open(fn,'r')
39 | self.analyzer.analyze(fh)
40 |
41 |
--------------------------------------------------------------------------------
/PyFoam/LogAnalysis/NameFinderLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """A line analyzer that generates a list of names"""
3 |
4 | import re
5 |
6 | from .ContextLineAnalyzer import ContextLineAnalyzer
7 |
8 | class NameFinderLineAnalyzer(ContextLineAnalyzer):
9 | """Class that finds names depending on a context"""
10 |
11 | def __init__(self,trigger,analyze,idNr=1,nr=1):
12 | """
13 | :param trigger: The regular expression that has to match before data is collected
14 | :param nr: The number of lines after the match that data is collected
15 | :param analyze: The regular expression that is used for analysis
16 | :param idNr: The id of the group that is used for analysis
17 | """
18 | ContextLineAnalyzer.__init__(self,trigger,nr=nr)
19 |
20 | self.analyze=re.compile(analyze)
21 | self.idNr=idNr
22 |
23 | self.names=[]
24 |
25 | def doActualAnalysis(self,line):
26 | m=self.analyze.match(line)
27 | if m!=None:
28 | val=m.group(self.idNr)
29 | if val.find(' ')>=0:
30 | val="\""+val+"\""
31 | self.names.append(val)
32 | self.callOnChange()
33 |
34 | def callOnChange(self):
35 | """
36 | To be called if the name list changes
37 | """
38 | pass
39 |
40 | # Should work with Python3 and Python2
41 |
--------------------------------------------------------------------------------
/PyFoam/LogAnalysis/PhaseChangerLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """Analyzes lines with regular expressions and changes the phase if it fits"""
3 |
4 | import re
5 |
6 | from .GeneralLineAnalyzer import GeneralLineAnalyzer
7 |
8 | class PhaseChangerLineAnalyzer(GeneralLineAnalyzer):
9 | """Parses lines for an arbitrary regular expression
10 | and sets the phase if it fits
11 | """
12 |
13 |
14 | def __init__(self,
15 | exp,
16 | idNr=None):
17 | """
18 | :param name: name of the expression (needed for output
19 | :param exp: that holds the phase name
20 | :param idNr: number of the pattern group that is used as the phase name
21 | """
22 | GeneralLineAnalyzer.__init__(self,
23 | doTimelines=False,
24 | doFiles=False)
25 |
26 | self.idNr=idNr
27 | self.exp=re.compile(exp)
28 | self.registerRegexp(self.exp)
29 |
30 | def doAnalysis(self,line):
31 | """Look for the pattern. If it matches set the phase name"""
32 |
33 | m=self.exp.match(line.strip())
34 | if m!=None:
35 | self.setPhase(m.group(self.idNr))
36 |
37 | # Should work with Python3 and Python2
38 |
--------------------------------------------------------------------------------
/PyFoam/LogAnalysis/SteadyConvergedLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """Analyze Steady Solver"""
3 |
4 | import re
5 |
6 | from .LogLineAnalyzer import LogLineAnalyzer
7 |
8 | class SteadyConvergedLineAnalyzer(LogLineAnalyzer):
9 | """
10 | Checks whether a Steady-solver has converged
11 |
12 | Convergence is assumed if all the linear solvers have their
13 | initial residual below their threshold
14 | """
15 |
16 | linearRegExp="^(.+): Solving for (.+), Initial residual = (.+), Final residual = (.+), No Iterations (.+)$"
17 |
18 | def __init__(self):
19 | LogLineAnalyzer.__init__(self)
20 | self.exp=re.compile(self.linearRegExp)
21 | self.registerRegexp(self.exp)
22 | self.firstTime=True
23 | self.lastTime=""
24 | self.isConverged=False
25 | self.counter=0
26 |
27 | def doAnalysis(self,line):
28 | """Counts the number of linear solvers that have not converged"""
29 | time=self.parent.getTime()
30 | if time!=self.lastTime:
31 | if self.firstTime:
32 | self.firstTime=False
33 | else:
34 | if self.counter==0:
35 | self.isConverged=True
36 | else:
37 | self.isConverged=False
38 | self.counter=0
39 | self.lastTime=time
40 |
41 | m=self.exp.match(line.strip())
42 | if m!=None:
43 | if int(m.group(5))>0:
44 | self.counter+=1
45 |
46 | def goOn(self):
47 | """Converged
48 | :return: False if converged"""
49 | return not self.isConverged
50 |
51 | # Should work with Python3 and Python2
52 |
--------------------------------------------------------------------------------
/PyFoam/LogAnalysis/TimeLineLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """Line analyzer that collects datga in arrays"""
3 |
4 | from .GeneralLineAnalyzer import GeneralLineAnalyzer
5 |
6 | class TimeLineLineAnalyzer(GeneralLineAnalyzer):
7 | """Base class for analyzers that collect data in arrays
8 |
9 | Just a stub to enable legacy code"""
10 | def __init__(self):
11 | GeneralLineAnalyzer.__init__(self,doTimelines=True)
12 |
13 | # Should work with Python3 and Python2
14 |
--------------------------------------------------------------------------------
/PyFoam/LogAnalysis/__init__.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ Log Analysis
3 |
4 | Classes that parse the output of the OpenFOAM applications
5 | """
6 |
--------------------------------------------------------------------------------
/PyFoam/Paraview/SimpleFilters.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ Simple filters
3 |
4 | Builds and displays simple filters. Grants easy access to the actual filter
5 | and the representation objects"""
6 |
7 | from paraview import servermanager
8 |
9 | from PyFoam.Paraview import proxyManager as pm
10 | from PyFoam.Paraview import renderView as rv
11 | from PyFoam.Paraview import characteristicLength as lc
12 | from PyFoam.Paraview import getCenter as gc
13 |
14 | from SimpleSources import SimpleSource
15 |
16 | class SimpleFilter(SimpleSource):
17 | """Base class for the simple filters"""
18 |
19 | def __init__(self,name,src):
20 | """:param name: The name under which the thing should be displayed
21 | :param src: the actual source proxy"""
22 | SimpleSource.__init__(self,name,src)
23 |
24 | class Group(SimpleFilter):
25 | """Class for grouping other objects"""
26 |
27 | def __init__(self,name):
28 | try:
29 | grp=servermanager.filters.GroupDataSets()
30 | except AttributeError:
31 | grp=servermanager.filters.GroupDatasets()
32 |
33 | SimpleFilter.__init__(self,name,grp)
34 |
35 | def add(self,obj):
36 | """Add an object to the group"""
37 | self.src.Input.append(obj.src)
38 | self.src.UpdatePipeline()
39 |
40 |
--------------------------------------------------------------------------------
/PyFoam/Paraview/SourceBase.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ Base class for the wrapping of graphical objects
3 |
4 | The actual object is accessed via the member variable src.
5 | Just adds some simple things like bounding boxes etc"""
6 |
7 | from math import sqrt
8 |
9 | from PyFoam.Basics.DataStructures import Vector
10 |
11 | class SourceBase(object):
12 | """Base class for the sources
13 |
14 | The member src is the actual source object"""
15 |
16 | def __init__(self,src):
17 | """:param src: the actual source proxy"""
18 | self.src = src
19 |
20 | def getBounds(self):
21 | """Get the bounding box of the object"""
22 | bnds=self.src.GetDataInformation().GetBounds()
23 |
24 | return (bnds[0:2],bnds[2:4],bnds[4:6])
25 |
26 | def getMin(self):
27 | """Get the minimum-vector of the bounds"""
28 | bnd=self.getBounds()
29 | return Vector(bnd[0][0],bnd[1][0],bnd[2][0])
30 |
31 | def getMax(self):
32 | """Get the minimum-vector of the bounds"""
33 | bnd=self.getBounds()
34 | return Vector(bnd[0][1],bnd[1][1],bnd[2][1])
35 |
36 | def getCenter(self):
37 | """Return the center of the object"""
38 | return 0.5*(self.getMax()+self.getMin())
39 |
40 | def getExtent(self):
41 | """Return the center of the object"""
42 | return self.getMax()-self.getMin()
43 |
44 | def characteristicLength(self):
45 | """The characteristic length of the object"""
46 |
47 | return abs(self.getExtent())
48 |
49 | def makeVector(self,orig):
50 | """Convert a list or a tuple of length 3 to a vector for easier calculations"""
51 |
52 | return Vector(orig[0],orig[1],orig[2])
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/PyFoam/RunDictionary/ListFile.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """File that contains only a list (for instance points)"""
3 |
4 | from PyFoam.Basics.LineReader import LineReader
5 | from PyFoam.RunDictionary.SolutionFile import SolutionFile
6 |
7 | from PyFoam.ThirdParty.six import PY3
8 |
9 | if PY3:
10 | long=int
11 |
12 | class ListFile(SolutionFile):
13 | """Represents a OpenFOAM file with only a list"""
14 |
15 | def __init__(self,place,name):
16 | """:param place: directory of the file
17 | :param name: The name of the list file"""
18 |
19 | SolutionFile.__init__(self,place,name)
20 |
21 | def getSize(self):
22 | """:return: the size of the list"""
23 |
24 | size=-1 # should be long
25 |
26 | l=LineReader()
27 | self.openFile()
28 |
29 | while l.read(self.fh):
30 | try:
31 | size=long(l.line)
32 | break
33 | except ValueError:
34 | pass
35 |
36 | self.closeFile()
37 |
38 | return size
39 |
40 | # Should work with Python3 and Python2
41 |
--------------------------------------------------------------------------------
/PyFoam/RunDictionary/__init__.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ Manipulating the data files
3 |
4 | Classes that manipulate the parameter and the solution files in the
5 | data dictionary used by the OpenFOAM applications
6 | """
7 |
--------------------------------------------------------------------------------
/PyFoam/Site/__init__.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ Site-specific Packages
3 |
4 | This Package is a stand-in for the actual Package. Imports will be redirected
5 | to $PYFOAM_SITE_DIR/lib if this is present. Othherwise this directory is useless
6 | """
7 |
8 | from PyFoam.Infrastructure.Hardcoded import pyFoamSiteVar
9 | import sys
10 | from os import path,environ
11 | from PyFoam.ThirdParty.six import print_
12 |
13 | if pyFoamSiteVar in environ:
14 | libDir=path.join(environ[pyFoamSiteVar],"lib")
15 | if not path.isdir(libDir):
16 | print_(libDir,"is not a directory")
17 | else:
18 | # this makes sure that Python-files found in PYFOAM_SITE_DIR/lib are used
19 | __path__.insert(0,libDir)
20 | else:
21 | print_("No environment variable",pyFoamSiteVar,"set. Importing PyFoam.Site is pointless")
22 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/Gnuplot/Errors.py:
--------------------------------------------------------------------------------
1 | # $Id: Errors.py 244 2003-04-21 09:44:09Z mhagger $
2 |
3 | # Copyright (C) 2001-2003 Michael Haggerty
4 | #
5 | # This file is licensed under the GNU Lesser General Public License
6 | # (LGPL). See LICENSE.txt for details.
7 |
8 | """Exception types that can be raised by Gnuplot.py."""
9 |
10 |
11 | class Error(Exception):
12 | """All our exceptions are derived from this one."""
13 | pass
14 |
15 |
16 | class OptionError(Error):
17 | """Raised for unrecognized option(s)"""
18 | pass
19 |
20 |
21 | class DataError(Error):
22 | """Raised for data in the wrong format"""
23 | pass
24 |
25 | # Should work with Python3 and Python2
26 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/Gnuplot/setup.cfg:
--------------------------------------------------------------------------------
1 | [bdist_rpm]
2 | release = 1
3 | packager = Michael Haggerty
4 | doc_files = ANNOUNCE.txt
5 | README.txt
6 | NEWS.txt
7 | FAQ.txt
8 | CREDITS.txt
9 | TODO.txt
10 | LICENSE.txt
11 | Gnuplot.html
12 | doc/
13 | #requires = _numpy.so, python >= 1.5
14 | requires = python >= 1.5
15 |
16 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/Gnuplot/setup.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | # Copyright (C) 2001-2003 Michael Haggerty
4 | #
5 | # This file is licensed under the GNU Lesser General Public License
6 | # (LGPL). See LICENSE.txt for details.
7 |
8 | """Setup script for the Gnuplot module distribution.
9 |
10 | """
11 |
12 | from distutils.core import setup
13 |
14 | # Get the version number from the __init__ file:
15 | from .__init__ import __version__
16 |
17 | long_description = """\
18 | Gnuplot.py is a Python package that allows you to create graphs from
19 | within Python using the gnuplot plotting program.
20 | """
21 |
22 | setup (
23 | # Distribution meta-data
24 | name='gnuplot-py',
25 | version=__version__,
26 | description='A Python interface to the gnuplot plotting program.',
27 | long_description=long_description,
28 | author='Michael Haggerty',
29 | author_email='mhagger@alum.mit.edu',
30 | url='http://gnuplot-py.sourceforge.net',
31 | license='LGPL',
32 | # This line is a workaround for a spelling error in earlier
33 | # versions of distutils. The error has been fixed as of
34 | # python2.3, but we leave this line here for compatibility with
35 | # older python versions.
36 | licence='LGPL',
37 |
38 | # Description of the package in the distribution
39 | package_dir={'Gnuplot' : '.'},
40 | packages=['Gnuplot'],
41 | )
42 |
43 | # Should work with Python3 and Python2
44 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/__init__.py:
--------------------------------------------------------------------------------
1 | """ ThirdParty-Packages
2 |
3 | Packages that were included to keep the PyFoam installation self-contained
4 | """
5 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/ply/__init__.py:
--------------------------------------------------------------------------------
1 | # PLY package
2 | # Author: David Beazley (dave@dabeaz.com)
3 |
4 | __version__ = '3.9'
5 | __all__ = ['lex','yacc']
6 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/pyratemp/LICENSE:
--------------------------------------------------------------------------------
1 | pyratemp and yaml2pyratemp were written by Roland Koebler
2 | , and are published under the following
3 | license:
4 |
5 | Copyright (c) Roland Koebler, 2007-2010
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23 | IN THE SOFTWARE.
24 |
25 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/pyratemp/README:
--------------------------------------------------------------------------------
1 | pyratemp
2 | ========
3 |
4 | pyratemp is a template-engine for python.
5 |
6 | For documentation, please read pyratemp.txt or pyratemp.html and the
7 | pyratemp-docstrings.
8 |
9 | For more documentation of the background of pyratemp, some thoughts
10 | about template-engines, benchmarks and comparisons, see
11 | see http://www.simple-is-better.org/template/
12 |
13 | Website: http://www.simple-is-better.org/template/pyratemp.html
14 | Author: Roland Koebler
15 | Requirements: Python (tested with 2.4),
16 | optionally python-simplejson and/or python-yaml
17 |
18 | Files:
19 | - README
20 | - NEWS
21 | - LICENSE
22 | - pyratemp.py: the template-engine
23 | - yaml2pyratemp.py: a small commandline-interface for the template-engine
24 | - pyratemp.txt: the documentation (in reST)
25 | - pyratemp.html: the documentation, converted to html
26 | - example.html: example-template from the documentation
27 | - example.json: example-data from the documentation
28 |
29 | Installation:
30 | - simply copy pyratemp.py to a directory which is found by
31 | Pythons "import", e.g. directly into your project-directory
32 |
33 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/pyratemp/example.html:
--------------------------------------------------------------------------------
1 |
2 | html
3 |
4 |
6 |
7 |
8 | A simple example: @!title!@
9 |
10 |
11 | @!title!@
12 | This is a simple example, demonstrating pyratemp:
13 | #! Comments don't appear in the result !#
14 |
15 |
16 | - @!special_chars!@
17 |
18 | -
19 |
20 | The Answer!
21 |
22 | oh no!
23 |
24 | @!number!@
25 |
26 |
27 |
28 | - a simple for loop: @!i!@
29 |
30 | - listing all enumerated elements of a list:
31 |
32 |
33 | - @!i+1!@. @!element.upper()!@
34 |
35 |
36 |
37 |
38 |
39 | - @!item!@
40 |
41 | @!myitem(item="foo")!@
42 | @!myitem(item="bar")!@
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/pyratemp/example.json:
--------------------------------------------------------------------------------
1 | {
2 | "title" : "filling JSON into pyratemp",
3 | "special_chars" : "µ<߀",
4 | "number" : 13,
5 | "mylist" : [ "JSON", "YAML", "manually-defined variables" ]
6 | }
7 |
8 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/six/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010-2015 Benjamin Peterson
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of
4 | this software and associated documentation files (the "Software"), to deal in
5 | the Software without restriction, including without limitation the rights to
6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7 | the Software, and to permit persons to whom the Software is furnished to do so,
8 | subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/six/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include CHANGES
2 | include LICENSE
3 | include test_six.py
4 |
5 | recursive-include documentation *
6 | prune documentation/_build
7 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/six/PKG-INFO:
--------------------------------------------------------------------------------
1 | Metadata-Version: 1.1
2 | Name: six
3 | Version: 1.10.0
4 | Summary: Python 2 and 3 compatibility utilities
5 | Home-page: http://pypi.python.org/pypi/six/
6 | Author: Benjamin Peterson
7 | Author-email: benjamin@python.org
8 | License: MIT
9 | Description: Six is a Python 2 and 3 compatibility library. It provides utility functions
10 | for smoothing over the differences between the Python versions with the goal of
11 | writing Python code that is compatible on both Python versions. See the
12 | documentation for more information on what is provided.
13 |
14 | Six supports every Python version since 2.6. It is contained in only one Python
15 | file, so it can be easily copied into your project. (The copyright and license
16 | notice must be retained.)
17 |
18 | Online documentation is at https://pythonhosted.org/six/.
19 |
20 | Bugs can be reported to https://bitbucket.org/gutworth/six. The code can also
21 | be found there.
22 |
23 | For questions about six or porting in general, email the python-porting mailing
24 | list: https://mail.python.org/mailman/listinfo/python-porting
25 |
26 | Platform: UNKNOWN
27 | Classifier: Programming Language :: Python :: 2
28 | Classifier: Programming Language :: Python :: 3
29 | Classifier: Intended Audience :: Developers
30 | Classifier: License :: OSI Approved :: MIT License
31 | Classifier: Topic :: Software Development :: Libraries
32 | Classifier: Topic :: Utilities
33 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/six/README:
--------------------------------------------------------------------------------
1 | Six is a Python 2 and 3 compatibility library. It provides utility functions
2 | for smoothing over the differences between the Python versions with the goal of
3 | writing Python code that is compatible on both Python versions. See the
4 | documentation for more information on what is provided.
5 |
6 | Six supports every Python version since 2.6. It is contained in only one Python
7 | file, so it can be easily copied into your project. (The copyright and license
8 | notice must be retained.)
9 |
10 | Online documentation is at https://pythonhosted.org/six/.
11 |
12 | Bugs can be reported to https://bitbucket.org/gutworth/six. The code can also
13 | be found there.
14 |
15 | For questions about six or porting in general, email the python-porting mailing
16 | list: https://mail.python.org/mailman/listinfo/python-porting
17 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/six/setup.py:
--------------------------------------------------------------------------------
1 | from __future__ import with_statement
2 |
3 | try:
4 | from setuptools import setup
5 | except ImportError:
6 | from distutils.core import setup
7 |
8 | import six
9 |
10 | six_classifiers = [
11 | "Programming Language :: Python :: 2",
12 | "Programming Language :: Python :: 3",
13 | "Intended Audience :: Developers",
14 | "License :: OSI Approved :: MIT License",
15 | "Topic :: Software Development :: Libraries",
16 | "Topic :: Utilities",
17 | ]
18 |
19 | with open("README", "r") as fp:
20 | six_long_description = fp.read()
21 |
22 | setup(name="six",
23 | version=six.__version__,
24 | author="Benjamin Peterson",
25 | author_email="benjamin@python.org",
26 | url="http://pypi.python.org/pypi/six/",
27 | py_modules=["six"],
28 | description="Python 2 and 3 compatibility utilities",
29 | long_description=six_long_description,
30 | license="MIT",
31 | classifiers=six_classifiers
32 | )
33 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/.coveragerc:
--------------------------------------------------------------------------------
1 | [run]
2 | branch = True
3 | omit =
4 | tqdm/tests/*
5 | tqdm/_tqdm_gui.py
6 | tqdm/_tqdm_notebook.py
7 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/.gitignore:
--------------------------------------------------------------------------------
1 | *.py[cod]
2 |
3 | # C extensions
4 | *.so
5 |
6 | # Packages
7 | *.egg
8 | *.egg-info
9 | dist
10 | build
11 | eggs
12 | parts
13 | bin
14 | var
15 | sdist
16 | develop-eggs
17 | .installed.cfg
18 | lib
19 | lib64
20 | __pycache__
21 | MANIFEST
22 | cover/
23 |
24 | # Installer logs
25 | pip-log.txt
26 |
27 | # Unit test / coverage reports
28 | .coverage
29 | .tox/
30 | nosetests.xml
31 |
32 | # Translations
33 | *.mo
34 |
35 | # Mr Developer
36 | .mr.developer.cfg
37 | .project
38 | .pydevproject
39 |
40 | # PyCharm
41 | .idea
42 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/.mailmap:
--------------------------------------------------------------------------------
1 | Noam Yorav-Raphael
2 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 | language: python
3 | python: 3.5
4 | # branches: # remove travis double-check on pull requests in main repo
5 | # only:
6 | # - master
7 | # - /^\d\.\d+$/
8 | env:
9 | - TOXENV=py26
10 | - TOXENV=py27
11 | - TOXENV=py33
12 | - TOXENV=py34
13 | - TOXENV=py35
14 | - TOXENV=pypy
15 | - TOXENV=pypy3
16 | - TOXENV=flake8
17 | - TOXENV=perf
18 | before_install:
19 | - pip install codecov
20 | install:
21 | - pip install 'coverage<4'
22 | - pip install tox coveralls
23 | script:
24 | - tox
25 | after_success:
26 | - coveralls
27 | - codecov
28 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/MANIFEST.in:
--------------------------------------------------------------------------------
1 | # Misc
2 | include .coveragerc
3 | include CONTRIBUTE
4 | include LICENCE
5 | include logo.png
6 | include Makefile
7 | include README.rst
8 | include RELEASE
9 | include tox.ini
10 | # include tqdm.gif # too big...
11 |
12 | # Test suite
13 | recursive-include tqdm/tests *.py
14 |
15 | # Examples/Documentation
16 | recursive-include examples *
17 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/__init__.py:
--------------------------------------------------------------------------------
1 | # import everything from the real library
2 |
3 | from .tqdm._tqdm import tqdm
4 | from .tqdm._tqdm import trange
5 | from .tqdm._tqdm_gui import tqdm_gui
6 | from .tqdm._tqdm_gui import tgrange
7 | from .tqdm._tqdm_pandas import tqdm_pandas
8 | # from ._main import main
9 | from .tqdm._version import __version__ # NOQA
10 |
11 | __all__ = ['tqdm', 'tqdm_gui', 'trange', 'tgrange', 'tqdm_pandas',
12 | '__version__']
13 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/examples/include_no_requirements.py:
--------------------------------------------------------------------------------
1 | # How to import tqdm without enforcing it as a dependency
2 | try:
3 | from tqdm import tqdm
4 | except:
5 | def tqdm(*args, **kwargs):
6 | if args:
7 | return args[0]
8 | return kwargs.get('iterable', None)
9 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/examples/pandas_progress_apply.py:
--------------------------------------------------------------------------------
1 | import pandas as pd
2 | import numpy as np
3 | from tqdm import tqdm
4 |
5 | df = pd.DataFrame(np.random.randint(0, 100, (100000, 6)))
6 |
7 | # Register `pandas.progress_apply` and `pandas.Series.map_apply` with `tqdm`
8 | # (can use `tqdm_gui`, `tqdm_notebook`, optional kwargs, etc.)
9 | tqdm.pandas(desc="my bar!")
10 |
11 | # Now you can use `progress_apply` instead of `apply`
12 | # and `progress_map` instead of `map`
13 | df.progress_apply(lambda x: x**2)
14 | # can also groupby:
15 | # df.groupby(0).progress_apply(lambda x: x**2)
16 |
17 |
18 | """ Source code for `tqdm_pandas` (really simple!) """
19 | # def tqdm_pandas(t):
20 | # from pandas.core.frame import DataFrame
21 | # def inner(df, func, *args, **kwargs):
22 | # t.total = groups.size // len(groups)
23 | # def wrapper(*args, **kwargs):
24 | # t.update(1)
25 | # return func(*args, **kwargs)
26 | # result = df.apply(wrapper, *args, **kwargs)
27 | # t.close()
28 | # return result
29 | # DataFrame.progress_apply = inner
30 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/examples/progressbar/compat.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | # -*- coding: utf-8 -*-
3 | #
4 | # progressbar - Text progress bar library for Python.
5 | # Copyright (c) 2005 Nilton Volpato
6 | #
7 | # This library is free software; you can redistribute it and/or
8 | # modify it under the terms of the GNU Lesser General Public
9 | # License as published by the Free Software Foundation; either
10 | # version 2.1 of the License, or (at your option) any later version.
11 | #
12 | # This library is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | # Lesser General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Lesser General Public
18 | # License along with this library; if not, write to the Free Software
19 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 |
21 | """Compatibility methods and classes for the progressbar module."""
22 |
23 |
24 | # Python 3.x (and backports) use a modified iterator syntax
25 | # This will allow 2.x to behave with 3.x iterators
26 | try:
27 | next
28 | except NameError:
29 | def next(iter):
30 | try:
31 | # Try new style iterators
32 | return iter.__next__()
33 | except AttributeError:
34 | # Fallback in case of a "native" iterator
35 | return iter.next()
36 |
37 |
38 | # Python < 2.5 does not have "any"
39 | try:
40 | any
41 | except NameError:
42 | def any(iterator):
43 | for item in iterator:
44 | if item: return True
45 | return False
46 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/examples/simple_examples.py:
--------------------------------------------------------------------------------
1 | """
2 | # Simple tqdm examples and profiling
3 |
4 | # Benchmark
5 | for i in _range(int(1e8)):
6 | pass
7 |
8 | # Basic demo
9 | import tqdm
10 | for i in tqdm.trange(int(1e8)):
11 | pass
12 |
13 | # Some decorations
14 | import tqdm
15 | for i in tqdm.trange(int(1e8), miniters=int(1e6), ascii=True,
16 | desc="cool", dynamic_ncols=True):
17 | pass
18 |
19 | # Nested bars
20 | from tqdm import trange
21 | for i in trange(10):
22 | for j in trange(int(1e7), leave=False, unit_scale=True):
23 | pass
24 |
25 | # Experimental GUI demo
26 | import tqdm
27 | for i in tqdm.tgrange(int(1e8)):
28 | pass
29 |
30 | # Comparison to https://code.google.com/p/python-progressbar/
31 | from progressbar.progressbar import ProgressBar
32 | for i in ProgressBar()(_range(int(1e8))):
33 | pass
34 | """
35 |
36 | from time import sleep
37 | from timeit import timeit
38 | import re
39 |
40 | # Simple demo
41 | from tqdm import trange
42 | for i in trange(16, leave=True):
43 | sleep(0.1)
44 |
45 | # Profiling/overhead tests
46 | stmts = filter(None, re.split(r'\n\s*#.*?\n', __doc__))
47 | for s in stmts:
48 | print(s.replace('import tqdm\n', ''))
49 | print(timeit(stmt='try:\n\t_range = xrange'
50 | '\nexcept:\n\t_range = range\n' + s, number=1),
51 | 'seconds')
52 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam/a2de0d75131a50ed85cc109d629ffffefbe97144/PyFoam/ThirdParty/tqdm/logo.png
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/setup.cfg:
--------------------------------------------------------------------------------
1 | [bdist_wheel]
2 | universal = 1
3 |
4 | [egg_info]
5 | tag_build =
6 | tag_date = 0
7 | tag_svn_revision = 0
8 |
9 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/tox.ini:
--------------------------------------------------------------------------------
1 | # Tox (http://tox.testrun.org/) is a tool for running tests
2 | # in multiple virtualenvs. This configuration file will run the
3 | # test suite on all supported python versions. To use it, "pip install tox"
4 | # and then run "tox" from this directory.
5 |
6 | [tox]
7 | envlist = py26, py27, py32, py33, py34, py35, pypy, pypy3, flake8, setup.py, perf
8 |
9 | [testenv]
10 | passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
11 | deps =
12 | nose
13 | nose-timer
14 | coverage<4
15 | coveralls
16 | commands =
17 | nosetests --with-coverage --with-timer --cover-package=tqdm --ignore-files="tests_perf\.py" -d -v tqdm/
18 | coveralls
19 |
20 | [testenv:flake8]
21 | deps = flake8
22 | commands =
23 | flake8 --max-line-length=80 --count --statistics --exit-zero tqdm/
24 | flake8 --max-line-length=80 --count --statistics --exit-zero examples/
25 | flake8 --max-line-length=80 --count --statistics --exit-zero .
26 | flake8 --max-line-length=80 --count --statistics --exit-zero tqdm/tests/
27 |
28 | [testenv:setup.py]
29 | deps =
30 | docutils
31 | pygments
32 | commands =
33 | python setup.py check --restructuredtext --metadata --strict
34 | python setup.py make none
35 |
36 | [testenv:perf]
37 | deps =
38 | nose
39 | nose-timer
40 | commands =
41 | nosetests --with-timer tqdm/tests/tests_perf.py -d -v
42 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/tqdm.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam/a2de0d75131a50ed85cc109d629ffffefbe97144/PyFoam/ThirdParty/tqdm/tqdm.gif
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/tqdm/__init__.py:
--------------------------------------------------------------------------------
1 | from ._tqdm import tqdm
2 | from ._tqdm import trange
3 | from ._tqdm_gui import tqdm_gui
4 | from ._tqdm_gui import tgrange
5 | from ._tqdm_pandas import tqdm_pandas
6 | from ._main import main
7 | from ._version import __version__ # NOQA
8 | from ._tqdm import TqdmTypeError, TqdmKeyError, TqdmDeprecationWarning
9 |
10 | __all__ = ['tqdm', 'tqdm_gui', 'trange', 'tgrange', 'tqdm_pandas',
11 | 'tqdm_notebook', 'tnrange', 'main',
12 | 'TqdmTypeError', 'TqdmKeyError', 'TqdmDeprecationWarning',
13 | '__version__']
14 |
15 |
16 | def tqdm_notebook(*args, **kwargs): # pragma: no cover
17 | """See tqdm._tqdm_notebook.tqdm_notebook for full documentation"""
18 | from ._tqdm_notebook import tqdm_notebook as _tqdm_notebook
19 | return _tqdm_notebook(*args, **kwargs)
20 |
21 |
22 | def tnrange(*args, **kwargs): # pragma: no cover
23 | """
24 | A shortcut for tqdm_notebook(xrange(*args), **kwargs).
25 | On Python3+ range is used instead of xrange.
26 | """
27 | from ._tqdm_notebook import tnrange as _tnrange
28 | return _tnrange(*args, **kwargs)
29 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/tqdm/__main__.py:
--------------------------------------------------------------------------------
1 | from ._main import main
2 | main()
3 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/tqdm/_tqdm_pandas.py:
--------------------------------------------------------------------------------
1 | import sys
2 |
3 | __author__ = "github.com/casperdcl"
4 | __all__ = ['tqdm_pandas']
5 |
6 |
7 | def tqdm_pandas(tclass, *targs, **tkwargs):
8 | """
9 | Registers the given `tqdm` instance with
10 | `pandas.core.groupby.DataFrameGroupBy.progress_apply`.
11 | It will even close() the `tqdm` instance upon completion.
12 |
13 | Parameters
14 | ----------
15 | tclass : tqdm class you want to use (eg, tqdm, tqdm_notebook, etc)
16 | targs and tkwargs : arguments for the tqdm instance
17 |
18 | Examples
19 | --------
20 | >>> import pandas as pd
21 | >>> import numpy as np
22 | >>> from tqdm import tqdm, tqdm_pandas
23 | >>>
24 | >>> df = pd.DataFrame(np.random.randint(0, 100, (100000, 6)))
25 | >>> tqdm_pandas(tqdm, leave=True) # can use tqdm_gui, optional kwargs, etc
26 | >>> # Now you can use `progress_apply` instead of `apply`
27 | >>> df.groupby(0).progress_apply(lambda x: x**2)
28 |
29 | References
30 | ----------
31 | https://stackoverflow.com/questions/18603270/
32 | progress-indicator-during-pandas-operations-python
33 | """
34 | from tqdm import TqdmDeprecationWarning
35 |
36 | if isinstance(tclass, type) or (getattr(tclass, '__name__', '').startswith(
37 | 'tqdm_')): # delayed adapter case
38 | TqdmDeprecationWarning("""\
39 | Please use `tqdm.pandas(...)` instead of `tqdm_pandas(tqdm, ...)`.
40 | """, fp_write=getattr(tkwargs.get('file', None), 'write', sys.stderr.write))
41 | tclass.pandas(*targs, **tkwargs)
42 | else:
43 | TqdmDeprecationWarning("""\
44 | Please use `tqdm.pandas(...)` instead of `tqdm_pandas(tqdm(...))`.
45 | """, fp_write=getattr(tclass.fp, 'write', sys.stderr.write))
46 | type(tclass).pandas(deprecated_t=tclass)
47 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/tqdm/_version.py:
--------------------------------------------------------------------------------
1 | # Definition of the version number
2 | try:
3 | from ._utils import _sh
4 | except: # pragma: no cover
5 | _sh = None
6 |
7 | from subprocess import STDOUT
8 | __all__ = ["__version__"]
9 |
10 | # major, minor, patch, -extra
11 | version_info = 4, 8, 4
12 |
13 | # Nice string for the version
14 | __version__ = '.'.join(map(str, version_info))
15 |
16 |
17 | # auto -extra based on commit hash (if not tagged as release)
18 | if (_sh is not None) and (len(version_info) < 4): # pragma: no cover
19 | def commit_hash(*args):
20 | try:
21 | res = _sh('git', 'log', '-n', '1', '--oneline', *args,
22 | stderr=STDOUT).lstrip().split()[0]
23 | return None if res.startswith('fatal') else res
24 | except:
25 | return None
26 |
27 | cur_hash = commit_hash()
28 | if cur_hash is not None:
29 | last_release = commit_hash('v' + __version__)
30 |
31 | if (last_release is None) or (cur_hash not in last_release):
32 | __version__ += '-' + cur_hash
33 |
--------------------------------------------------------------------------------
/PyFoam/ThirdParty/tqdm/tqdm/tests/tests_version.py:
--------------------------------------------------------------------------------
1 | import re
2 |
3 |
4 | def test_version():
5 | """ Test version string """
6 | from tqdm import __version__
7 | Mmpe = re.split('[.-]', __version__)
8 | assert 3 <= len(Mmpe) <= 4
9 | try:
10 | map(int, Mmpe[:3])
11 | except:
12 | raise TypeError('Version major, minor, patch must be integers')
13 |
--------------------------------------------------------------------------------
/PyFoam/Wrappers/__init__.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ Wrappers
3 |
4 | Classes that wrap the functionality of other libraries
5 | """
6 |
--------------------------------------------------------------------------------
/PyFoam/__init__.py:
--------------------------------------------------------------------------------
1 | # ICE Revision: $Id$
2 | """ Utility-classes for OpenFOAM
3 |
4 | Module for the Execution of OpenFOAM-commands and processing their output
5 | """
6 |
7 | from PyFoam.Infrastructure.Configuration import Configuration
8 |
9 | def version():
10 | """:return: Version number as a tuple"""
11 | return (0,6,10)
12 | # return (0,6,11,"development") # Change in bin/pyFoamVersion.py as well !!!!
13 |
14 | def versionString():
15 | """:return: Version number of PyFoam"""
16 | v=version()
17 |
18 | vStr="%d" % v[0]
19 | for d in v[1:]:
20 | if type(d)==int:
21 | vStr+=(".%d" % d)
22 | else:
23 | vStr+=("-%s" % str(d))
24 | return vStr
25 |
26 | def foamVersionString():
27 | from PyFoam.FoamInformation import foamVersionString
28 | return foamVersionString()
29 |
30 | _configuration = Configuration()
31 |
32 | def configuration():
33 | """:return: The Configuration information of PyFoam"""
34 | return _configuration
35 |
36 | # Should work with Python3 and Python2
37 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | .. -*- mode: rst -*-
2 |
3 | What it is
4 | ==========
5 |
6 | The purpose of this library is to support working with the OpenSource
7 | CFD-toolbox OpenFOAM_ and its forks
8 |
9 | This Python_ library can be used to
10 |
11 | * analyze the logs produced by OpenFoam-solvers
12 | * execute OpenFoam-solvers and utilities and analyze their output
13 | simultaneously
14 | * manipulate the parameter files and the initial-conditions of a run
15 | in a non-destructive manner
16 | * plots the residuals of OpenFOAM solvers
17 | * lots of other stuff
18 |
19 | Most of this functionality is made available to the user in the form
20 | of command-line utilities.
21 |
22 | PyFoam does all this strictly "from the outside": by writing parameter
23 | files and reading the output of the solvers. Without compiled parts or
24 | being linked to OpenFOAM.
25 |
26 | More information is found on `the OpenFOAM Wiki`_
27 |
28 | .. _Python: http://www.python.org
29 | .. _the OpenFOAM Wiki: http://openfoamwiki.net/index.php/Contrib_PyFoam
30 | .. _OpenFOAM: http://www.openfoam.org
31 |
32 | License
33 | =======
34 |
35 | PyFoam is free software; you can redistribute it and/or modify it
36 | under the terms of the GNU General Public License as published by the
37 | Free Software Foundation; either version 2 of the License, or (at your
38 | option) any later version. See the file COPYING in this directory,
39 | for a description of the GNU General Public License terms under which
40 | you can copy the files.
41 |
42 | Contributors
43 | ============
44 |
45 | If not otherwise noted in a source-files the primary author is Bernhard Gschaider
46 |
47 | The people who contributed to PyFoam (If I forgot someone: tell me):
48 |
49 | * Bernhard Gschaider
50 | * Martin Beaudoin
51 | * Fabian Pollesböck
52 | * Etienne Lorriaux
53 | * Bruno Santos
54 | * Marc Immer
55 | * Oliver Borm
56 |
--------------------------------------------------------------------------------
/bin/pyFoamAPoMaFoXiiQt.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.APoMaFoXiiQt import APoMaFoXiiQt
4 |
5 | APoMaFoXiiQt()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamAddCaseDataToDatabase.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.AddCaseDataToDatabase import AddCaseDataToDatabase
4 |
5 | AddCaseDataToDatabase()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamAddEmptyBoundary.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | description="""
4 | Adds an empty boundary to a case file
5 | """
6 |
7 | from PyFoam.Basics.FoamOptionParser import FoamOptionParser
8 | from os import path
9 | import sys
10 |
11 | from PyFoam.RunDictionary.BoundaryDict import BoundaryDict
12 | from PyFoam.RunDictionary.MeshInformation import MeshInformation
13 |
14 | from PyFoam.ThirdParty.six import print_
15 |
16 | parse=FoamOptionParser(description=description,usage="%prog ")
17 | parse.parse(nr=2)
18 |
19 | fName=parse.getArgs()[0]
20 | bName=parse.getArgs()[1]
21 |
22 | boundary=BoundaryDict(fName)
23 |
24 | lastFace=MeshInformation(fName).nrOfFaces()
25 |
26 | if bName in boundary.patches():
27 | print_("Patch",bName,"already exists in file")
28 | sys.exit(-1)
29 |
30 | val={}
31 | val["type"]="wall"
32 | val["nFaces"]="0"
33 | val["startFace"]=str(lastFace)
34 |
35 | boundary[bName]=val
36 |
37 | boundary.writeFile()
38 |
39 | # Should work with Python3 and Python2
40 |
--------------------------------------------------------------------------------
/bin/pyFoamBench.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.Benchmark import Benchmark
4 |
5 | Benchmark()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamBinarySize.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.BinarySize import BinarySize
4 |
5 | BinarySize()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamBlockMeshConverter.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.BlockMeshConverter import BlockMeshConverter
4 |
5 | BlockMeshConverter()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamBlockMeshRewrite.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.BlockMeshRewrite import BlockMeshRewrite
4 |
5 | BlockMeshRewrite()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamBuildHelper.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.BuildHelper import BuildHelper
4 |
5 | BuildHelper()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamCaseBuilder.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.CaseBuilder import CaseBuilder
4 |
5 | CaseBuilder()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamCaseReport.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.CaseReport import CaseReport
4 |
5 | CaseReport()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamChangeBoundaryName.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ChangeBoundaryName import ChangeBoundaryName
4 |
5 | ChangeBoundaryName()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamChangeBoundaryType.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ChangeBoundaryType import ChangeBoundaryType
4 |
5 | ChangeBoundaryType()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamClearBoundaryValue.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ClearBoundaryValue import ClearBoundaryValue
4 |
5 | ClearBoundaryValue()
6 |
7 |
8 |
--------------------------------------------------------------------------------
/bin/pyFoamClearCase.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ClearCase import ClearCase
4 |
5 | ClearCase()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamClearEmptyBoundaries.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | description="""
4 | Clears all empty boundaries (those with zero faces) from a
5 | polyMesh/boundaries file
6 | """
7 |
8 | from PyFoam.Basics.FoamOptionParser import FoamOptionParser
9 | from os import path
10 | import sys
11 |
12 | from PyFoam.RunDictionary.BoundaryDict import BoundaryDict
13 | from PyFoam.RunDictionary.MeshInformation import MeshInformation
14 |
15 | from PyFoam.ThirdParty.six import print_
16 |
17 | parse=FoamOptionParser(description=description,usage="%prog ")
18 | parse.parse(nr=1)
19 |
20 | fName=parse.getArgs()[0]
21 |
22 | boundary=BoundaryDict(fName)
23 |
24 | cleared=[]
25 |
26 | for b in boundary.patches():
27 | if boundary[b]["nFaces"]==0:
28 | cleared.append(b)
29 | del boundary[b]
30 |
31 | if len(cleared)>0:
32 | print_("Cleared boundaries",", ".join(cleared))
33 | boundary.writeFile()
34 | else:
35 | print_("No empty boundaries")
36 |
37 | # Should work with Python3 and Python2
38 |
--------------------------------------------------------------------------------
/bin/pyFoamClearInternalField.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ClearInternalField import ClearInternalField
4 |
5 | ClearInternalField()
6 |
7 |
8 |
--------------------------------------------------------------------------------
/bin/pyFoamCloneCase.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.CloneCase import CloneCase
4 |
5 | CloneCase()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamClusterTester.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ClusterTester import ClusterTester
4 |
5 | ClusterTester()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamComparator.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.Comparator import Comparator
4 |
5 | Comparator()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamCompareDictionary.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.CompareDictionary import CompareDictionary
4 |
5 | CompareDictionary()
6 |
7 |
8 |
--------------------------------------------------------------------------------
/bin/pyFoamCompressCaseFiles.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.CompressCaseFiles import CompressCaseFiles
4 |
5 | CompressCaseFiles()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamConvertToCSV.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ConvertToCSV import ConvertToCSV
4 |
5 | ConvertToCSV()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamCopyLastToFirst.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.CopyLastToFirst import CopyLastToFirst
4 |
5 | CopyLastToFirst()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamCreateBoundaryPatches.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.CreateBoundaryPatches import CreateBoundaryPatches
4 |
5 | CreateBoundaryPatches()
6 |
7 |
8 |
--------------------------------------------------------------------------------
/bin/pyFoamCreateModuleFile.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | from PyFoam.Applications.CreateModuleFile import CreateModuleFile
4 |
5 | CreateModuleFile()
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/bin/pyFoamDecompose.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.Decomposer import Decomposer
4 |
5 | Decomposer()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamDisplayBlockMesh.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from PyFoam.ThirdParty.six import print_
4 |
5 | try:
6 | import PyQt4
7 | from PyFoam.Applications.DisplayBlockMeshQt import DisplayBlockMesh
8 | except ImportError:
9 | try:
10 | from PyFoam.Error import warning
11 | warning("Falling back to the old Tkinter-implementation because no PyQT4 was found")
12 | from PyFoam.Applications.DisplayBlockMesh import DisplayBlockMesh
13 | except ImportError:
14 | print_("Seems like PyFoam is not in the PYTHONPATH")
15 | import sys
16 | sys.exit(-1)
17 |
18 | DisplayBlockMesh()
19 |
20 | # Should work with Python3 and Python2
21 |
--------------------------------------------------------------------------------
/bin/pyFoamDumpConfiguration.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | description="""
4 | Dump the contents of the configuration files
5 | """
6 |
7 | from PyFoam import configuration as config
8 | from os import path
9 |
10 | from PyFoam.ThirdParty.six import print_
11 |
12 | fName=path.join(path.curdir,"LocalConfigPyFoam")
13 | if path.exists(fName):
14 | config().addFile(fName)
15 |
16 | print_(config().dump())
17 |
18 | # Should work with Python3 and Python2
19 |
--------------------------------------------------------------------------------
/bin/pyFoamDumpRunDatabaseToCSV.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.DumpRunDatabaseToCSV import DumpRunDatabaseToCSV
4 |
5 | DumpRunDatabaseToCSV()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamEchoDictionary.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.EchoDictionary import EchoDictionary
4 |
5 | EchoDictionary()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamEchoPickledApplicationData.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.EchoPickledApplicationData import EchoPickledApplicationData
4 |
5 | EchoPickledApplicationData()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamExecute.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.Execute import Execute
4 |
5 | Execute()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamFromTemplate.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.FromTemplate import FromTemplate
4 |
5 | FromTemplate()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamFunkyDoCalcFiles.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.FunkyDoCalcFiles import FunkyDoCalcFiles
4 |
5 | FunkyDoCalcFiles()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamIPythonNotebook.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.IPythonNotebook import IPythonNotebook
4 |
5 | IPythonNotebook()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamInitVCSCase.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.InitVCSCase import InitVCSCase
4 |
5 | InitVCSCase()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamJoinCSV.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.JoinCSV import JoinCSV
4 |
5 | JoinCSV()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamJoinTimelines.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.JoinTimelines import JoinTimelines
4 |
5 | JoinTimelines()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamListCases.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ListCases import ListCases
4 |
5 | ListCases()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamListProfilingInfo.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ListProfilingInfo import ListProfilingInfo
4 |
5 | ListProfilingInfo()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamMeshUtilityRunner.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.MeshUtilityRunner import MeshUtilityRunner
4 |
5 | MeshUtilityRunner()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamModifyGGIBoundary.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | from PyFoam.Applications.ModifyGGIBoundary import ModifyGGIBoundary
4 |
5 | ModifyGGIBoundary()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamNetList.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 | """Lists the running pyFoam-Processes"""
3 |
4 | from PyFoam.Applications.NetList import NetList
5 |
6 | NetList()
7 |
--------------------------------------------------------------------------------
/bin/pyFoamNetShell.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 | """An interactive Shell that queries a pyFoamServer"""
3 |
4 | from PyFoam.Applications.NetShell import NetShell
5 |
6 | NetShell()
7 |
--------------------------------------------------------------------------------
/bin/pyFoamPVLoadState.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ChangePython import changePython
4 |
5 | changePython("pvpython","PVLoadState")
6 |
--------------------------------------------------------------------------------
/bin/pyFoamPVSnapshot.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ChangePython import changePython
4 |
5 | changePython("pvpython","PVSnapshot")
6 |
--------------------------------------------------------------------------------
/bin/pyFoamPVSnapshotMesa.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ChangePython import changePython
4 |
5 | changePython("pvpython","PVSnapshot",options=["--mesa"])
6 |
--------------------------------------------------------------------------------
/bin/pyFoamPVSnapshotMesaLLVM.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ChangePython import changePython
4 |
5 | changePython("pvpython","PVSnapshot",options=["--mesa-llvm"])
6 |
--------------------------------------------------------------------------------
/bin/pyFoamPVSnapshotMesaSWR.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ChangePython import changePython
4 |
5 | changePython("pvpython","PVSnapshot",options=["--mesa-swr"])
6 |
--------------------------------------------------------------------------------
/bin/pyFoamPVSnapshotNative.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ChangePython import changePython
4 |
5 | changePython("pvpython","PVSnapshot",options=["--native"])
6 |
--------------------------------------------------------------------------------
/bin/pyFoamPackCase.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.PackCase import PackCase
4 |
5 | PackCase()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamPlotRunner.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.PlotRunner import PlotRunner
4 |
5 | PlotRunner()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamPlotWatcher.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.PlotWatcher import PlotWatcher
4 |
5 | PlotWatcher()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamPotentialRunner.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.PotentialRunner import PotentialRunner
4 |
5 | PotentialRunner()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamPrepareCase.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.PrepareCase import PrepareCase
4 |
5 | PrepareCase()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamPrintData2DStatistics.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.PrintData2DStatistics import PrintData2DStatistics
4 |
5 | PrintData2DStatistics()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamReadDictionary.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.ReadDictionary import ReadDictionary
4 |
5 | ReadDictionary()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamRedoPlot.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.RedoPlot import RedoPlot
4 |
5 | RedoPlot()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamRestartRunner.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.RestartRunner import RestartRunner
4 |
5 | RestartRunner()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamRunAtMultipleTimes.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 |
4 | from PyFoam.Applications.RunAtMultipleTimes import RunAtMultipleTimes
5 |
6 | RunAtMultipleTimes()
7 |
--------------------------------------------------------------------------------
/bin/pyFoamRunParameterVariation.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.RunParameterVariation import RunParameterVariation
4 |
5 | RunParameterVariation()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamRunner.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.Runner import Runner
4 |
5 | Runner()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamSTLUtility.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.STLUtility import STLUtility
4 |
5 | STLUtility()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamSamplePlot.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.SamplePlot import SamplePlot
4 |
5 | SamplePlot()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamStandardLogAnalyzer.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | description="""\
4 | Analyzes a Log written by foamJob. Needs the name of the Logfile to
5 | be analyzed the data is being written to a directory that has the same
6 | name with _analyzed appended
7 | """
8 |
9 | from PyFoam.Basics.FoamOptionParser import FoamOptionParser
10 |
11 | parse=FoamOptionParser(description=description,usage="%prog [options] ",interspersed=True)
12 |
13 | parse.parse(nr=1)
14 |
15 | from PyFoam.LogAnalysis.BoundingLogAnalyzer import BoundingLogAnalyzer
16 | from PyFoam.LogAnalysis.LogAnalyzerApplication import LogAnalyzerApplication
17 |
18 | analyze=LogAnalyzerApplication(BoundingLogAnalyzer())
19 |
20 | analyze.run(pfad=parse.getArgs()[0])
21 |
--------------------------------------------------------------------------------
/bin/pyFoamSteadyRunner.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.SteadyRunner import SteadyRunner
4 |
5 | SteadyRunner()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamSurfacePlot.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.SurfacePlot import SurfacePlot
4 |
5 | SurfacePlot()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamSymlinkToFile.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.SymlinkToFile import SymlinkToFile
4 |
5 | SymlinkToFile()
6 |
--------------------------------------------------------------------------------
/bin/pyFoamTestConfiguration.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.TestConfiguration import TestConfiguration
4 |
5 | TestConfiguration()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamTimelinePlot.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.TimelinePlot import TimelinePlot
4 |
5 | TimelinePlot()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamUpdateDictionary.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.UpdateDictionary import UpdateDictionary
4 |
5 | UpdateDictionary()
6 |
7 |
8 |
--------------------------------------------------------------------------------
/bin/pyFoamUpgradeDictionariesTo17.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.UpgradeDictionariesTo17 import UpgradeDictionariesTo17
4 |
5 | UpgradeDictionariesTo17()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamUpgradeDictionariesTo20.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.UpgradeDictionariesTo20 import UpgradeDictionariesTo20
4 |
5 | UpgradeDictionariesTo20()
6 |
7 |
--------------------------------------------------------------------------------
/bin/pyFoamUtilityRunner.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 |
4 | from PyFoam.Applications.UtilityRunnerApp import UtilityRunnerApp
5 |
6 | UtilityRunnerApp()
7 |
--------------------------------------------------------------------------------
/bin/pyFoamWriteDictionary.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.WriteDictionary import WriteDictionary
4 |
5 | WriteDictionary()
6 |
7 |
--------------------------------------------------------------------------------
/breaksUnittest/TimeLineAnalyzer.py:
--------------------------------------------------------------------------------
1 |
2 | import unittest
3 | from .LineFeeder import feedText
4 |
5 | from PyFoam.LogAnalysis.TimeLineAnalyzer import TimeLineAnalyzer
6 |
7 | theSuite=unittest.TestSuite()
8 |
9 | class TimeLineAnalyzerClassTest(unittest.TestCase):
10 |
11 | def setTime(self,time):
12 | self.time=time
13 |
14 | def testNormal(self):
15 | self.time=None
16 | ta=TimeLineAnalyzer()
17 | ta.addListener(self.setTime)
18 |
19 | feedText(ta,
20 | """Nix
21 | Time = 1.23
22 | nix"""
23 | )
24 | self.assertAlmostEqual(self.time,1.23,6)
25 |
26 | feedText(ta,
27 | """Nix
28 | Time = constant
29 | nix"""
30 | )
31 | self.assertNotEqual(self.time,"constant")
32 |
33 | feedText(ta,
34 | """Nix
35 | Time = 1.4 23
36 | nix"""
37 | )
38 | self.assertNotEqual(self.time,1.4)
39 |
40 | theSuite.addTest(unittest.makeSuite(TimeLineAnalyzerClassTest,"test"))
41 |
--------------------------------------------------------------------------------
/contrib/Olesen_centralInstallation/makelinks-pyFoam:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # use "sh ./makelinks-pyFoam" to create links
4 | #
5 |
6 | list=$( cd ../bin && for i in *.py; do echo $i; done )
7 |
8 | for i in $list
9 | do
10 | ln -sv pyFoam $i
11 | done
12 |
13 |
--------------------------------------------------------------------------------
/contrib/Olesen_centralInstallation/profile.pyfoam:
--------------------------------------------------------------------------------
1 | #---------------------------------*-sh-*----------------------------------
2 | # profile.pyfoam
3 | #
4 | # Settings for PyFoam (python utilities for OpenFOAM)
5 | #
6 | # Affected variables: PATH
7 | #
8 | # $Id: profile.pyfoam,v 1.2 2007/01/25 08:21:54 cfdadmin Exp $
9 | #-------------------------------------------------------------------------
10 | dir=/data/app/OpenFOAM/PyFoam/local
11 |
12 | if [ -d "$dir" -a -x "$dir/pyFoam" ]; then
13 | type pyFoam >/dev/null 2>&1 || PATH=$dir:$PATH
14 | fi
15 |
16 | unset dir
17 | #------------------------------------------------------------- end-of-file
18 |
19 |
--------------------------------------------------------------------------------
/contrib/Olesen_centralInstallation/pyFoam:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # PyFoam dynamic symbolic link
4 | #
5 | Script=$(basename $0) # what to call
6 |
7 | # determine the installation directory
8 | installDir=$(dirname $0)
9 |
10 | if [ "$installDir" = "." ]; then
11 | installDir=".." # special case - called from cwd
12 | else
13 | installDir=$(dirname $installDir) # parent directory
14 | fi
15 |
16 | # check for correct installation
17 | for dir in $installDir/PyFoam $installDir/bin
18 | do
19 | if [ ! -d $dir ]; then
20 | echo "***ERROR*** no directory '$dir'" 1>&2
21 | exit 1
22 | fi
23 | done
24 |
25 | export PYTHONPATH=$installDir:$PYTHONPATH
26 | exec $installDir/bin/$Script "$@"
27 |
--------------------------------------------------------------------------------
/contrib/README:
--------------------------------------------------------------------------------
1 | This directory contains useful stuff that was provided by other users.
2 | The reason why it is not fully integrated into the distribution is,
3 | that I don't have the time and/or a similar setup to fully test it.
4 |
5 | Olesen_centralInstallation
6 | --------------------------
7 |
8 | A set of scripts that support using the pyFoam-Scripts on multiple
9 | from a central installation.
10 |
11 | The profile.pyfoam goes into the /etc/profile.d of the machines that
12 | use it. The pyFoam-Script goes into the a directory on the involved
13 | machines and the makelinks-pyFoam-script creates dynamic links to that
14 | script (which will call the corresponding script from the cental
15 | installation). This has to be done once by the root. After that a
16 | non-root user can maintain the central installation (provided he has
17 | write access to that)
18 |
19 | The paths in the files have to be adapted to your site.
20 |
21 | Mercurial_extension
22 | -------------------
23 |
24 | An extension to the Version-control system Mercurial that adds a
25 | command foamdiff to hg. This command shows the difference between
26 | revisions in a file. The differences are shown as differences between
27 | OpenFOAM-dictionaries (the way the utility pyFoamCompareDictionary.py
28 | does) not as the textual differences. The extension is installed the
29 | way extensions are usually installed in mercurial. In the file ~/.hgrc
30 | add the path to the extension in the extension-section:
31 |
32 | [extensions]
33 | foamdiff = /PyFoam/contrib/Mercurial_extension/foamdiff.py
--------------------------------------------------------------------------------
/debian/compat:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/debian/control:
--------------------------------------------------------------------------------
1 | Source: pyfoam
2 | Section: python
3 | Priority: extra
4 | Maintainer: Bernhard F.W. Gschaider
5 | Build-Depends: debhelper (>= 7), dh-python, python-dev, python-epydoc, python-numpy, python-vtk, python-matplotlib, python-qt4, gnuplot-x11
6 | Standards-Version: 3.9.5
7 |
8 | Package: pyfoam
9 | Architecture: all
10 | Depends: python-numpy, mercurial, python-tk, gnuplot-x11, ${python:Depends}, ${misc:Depends}
11 | Recommends: python-vtk, python-matplotlib, python-qt4, python-pandas, python-xlrd, python-xlwt, ipython, python-scipy
12 | Description: Python library to control OpenFOAM
13 | This Python library is used to control the OpenSource-CFD
14 | toolbox OpenFOAM and provides some utilities
15 |
--------------------------------------------------------------------------------
/debian/copyright:
--------------------------------------------------------------------------------
1 | This work was packaged for Debian by:
2 |
3 | Bernhard F.W. Gschaider on Thu, 01 Apr 2010 23:59:58 +0200
4 |
5 | It was downloaded from:
6 |
7 | http://openfoamwiki.net
8 |
9 | Upstream Authors:
10 |
11 | Bernhard Gschaider
12 | Martin Beaudoin
13 | Fabian Pollesböck
14 | Copyright:
15 |
16 | Copyright (C) 2008-2010 Bernhard Gschaider
17 | Copyright (C) 2009 Martin Beaudoin
18 |
19 | License:
20 |
21 | This program is free software: you can redistribute it and/or modify
22 | it under the terms of the GNU General Public License as published by
23 | the Free Software Foundation, either version 3 of the License, or
24 | (at your option) any later version.
25 |
26 | This package is distributed in the hope that it will be useful,
27 | but WITHOUT ANY WARRANTY; without even the implied warranty of
28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 | GNU General Public License for more details.
30 |
31 | You should have received a copy of the GNU General Public License
32 | along with this program. If not, see .
33 |
34 | On Debian systems, the complete text of the GNU General
35 | Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'.
36 |
37 | The Debian packaging is:
38 |
39 | Copyright (C) 2010 Bernhard F.W. Gschaider
40 | and is licensed under the GPL version 3, see above.
41 |
--------------------------------------------------------------------------------
/debian/debianInstallation.cfg:
--------------------------------------------------------------------------------
1 | [OpenFOAM]
2 | installation: /usr/lib
3 | additionalInstallation-openfoam : ~/OpenFOAM,/opt,/usr/lib
4 | additionalInstallation-extend : ~/foam,/opt,/usr/lib,/opt/foam
5 |
6 |
7 |
--------------------------------------------------------------------------------
/debian/docs:
--------------------------------------------------------------------------------
1 | README
2 |
--------------------------------------------------------------------------------
/debian/pyfoam.install:
--------------------------------------------------------------------------------
1 | debianInstallation.cfg etc/pyFoam/pyfoamrc.d
2 |
--------------------------------------------------------------------------------
/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 |
3 | # DEB_PYTHON_SYSTEM = pycentral
4 |
5 | # include /usr/share/cdbs/1/rules/debhelper.mk
6 | # include /usr/share/cdbs/1/class/python-distutils.mk
7 | #
8 | # override_dh_auto_install:
9 | # python setup.py install
10 |
11 | %:
12 | dh $@ --with python2 --buildsystem=pybuild
13 |
--------------------------------------------------------------------------------
/debianInstallation.cfg:
--------------------------------------------------------------------------------
1 | [OpenFOAM]
2 | installation: /usr/lib
3 | additionalInstallation-openfoam : ~/OpenFOAM,/opt,/usr/lib
4 | additionalInstallation-extend : ~/foam,/opt,/usr/lib,/opt/foam
5 |
6 |
7 |
--------------------------------------------------------------------------------
/distScripts/makeManFiles.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | import sys,glob,subprocess
4 | from os import path
5 |
6 | from PyFoam.Basics.RestructuredTextHelper import RestructuredTextHelper as rh
7 |
8 | binDir=sys.argv[1]
9 | manDir=sys.argv[2]
10 |
11 | for f in glob.glob(path.join(binDir,"*.py")):
12 | util=path.basename(f)
13 | print util
14 |
15 | rst=rh().buildHeading(util,level=rh.LevelChapter)+"\n"
16 |
17 | out=open(path.join(manDir,util+".1"),"w")
18 | p1=subprocess.Popen([f,"-h"],stdout=subprocess.PIPE)
19 | rst+=p1.communicate()[0]
20 | p2=subprocess.Popen(["rst2man-2.7.py"],stdin=subprocess.PIPE,stdout=out)
21 | p2.communicate(rst)
22 | print "Ran:",p2.wait()
23 |
--------------------------------------------------------------------------------
/doc/_build/.stubForHgGit:
--------------------------------------------------------------------------------
1 | foo
2 |
--------------------------------------------------------------------------------
/doc/_static/.stubForHgGit:
--------------------------------------------------------------------------------
1 | foo
2 |
--------------------------------------------------------------------------------
/doc/_templates/.stubForHgGit:
--------------------------------------------------------------------------------
1 | foo
2 |
--------------------------------------------------------------------------------
/doc/index.rst:
--------------------------------------------------------------------------------
1 | .. PyFoam documentation master file, created by
2 | sphinx-quickstart on Tue Sep 1 12:53:23 2015.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | Welcome to PyFoam's documentation!
7 | ==================================
8 |
9 | Contents:
10 |
11 | .. toctree::
12 | :maxdepth: 2
13 |
14 | API documentation
15 |
16 | Indices and tables
17 | ==================
18 |
19 | * :ref:`genindex`
20 | * :ref:`modindex`
21 | * :ref:`search`
22 |
--------------------------------------------------------------------------------
/exampleSite/etc/pyfoamrc.d/helloHook.cfg:
--------------------------------------------------------------------------------
1 | [nix_preRunHook_hello]
2 | enabled: True
3 | module: EchoHook
4 | message: Starting up
5 | stopOnError: True
6 |
7 | [nix_postRunHook_hello]
8 | enabled: True
9 | module: EchoHook
10 | message: Did |-stepNr-| steps in |-casefullname-|
11 | minRunTime: 10
12 |
--------------------------------------------------------------------------------
/exampleSite/lib/EchoHook.py:
--------------------------------------------------------------------------------
1 | # Just Print something
2 |
3 | from __future__ import print_function
4 |
5 | from pprint import pformat
6 |
7 | from PyFoam.Infrastructure.RunHook import RunHook
8 | from PyFoam.Basics.TemplateFile import TemplateFile
9 | from PyFoam.ThirdParty.pyratemp import TemplateRenderError
10 |
11 | class EchoHook(RunHook):
12 | def __init__(self,runner,name):
13 | RunHook.__init__(self,runner,name)
14 | print("Created",runner,name)
15 | self.message=self.conf().get("message")
16 | def __call__(self):
17 | print("Data:",pformat(self.runner.getData()))
18 | template=TemplateFile(content=self.message,
19 | expressionDelimiter="|-",
20 | encoding="ascii")
21 | print(template.getString(self.runner.getData()))
22 |
--------------------------------------------------------------------------------
/examples/ClusterScripts/runPitzDaily.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | #
3 | #$ -cwd
4 | #$ -j y
5 | #$ -S /opt/rocks/bin/python
6 | #$ -m be
7 | #
8 |
9 | import sys,os
10 | from os import path
11 |
12 | os.environ["WM_64"]="1"
13 |
14 | from PyFoam.Infrastructure.ClusterJob import SolverJob
15 | from PyFoam.Error import error
16 | from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
17 |
18 | velIn=sys.argv[1]
19 |
20 | name="pitzDaily"
21 |
22 | class Pitz(SolverJob):
23 | def __init__(self):
24 | SolverJob.__init__(self,
25 | name+".run."+velIn,
26 | "simpleFoam",
27 | template=name,
28 | steady=True,
29 | foamVersion="1.5")
30 |
31 | def setup(self,parameters):
32 | self.foamRun("blockMesh")
33 | vel=ParsedParameterFile(path.join(self.casedir(),"0","U"))
34 | vel["boundaryField"]["inlet"]["value"] = "uniform (%s 0 0)" % velIn
35 | vel.writeFile()
36 |
37 | Pitz().doIt()
38 |
39 |
--------------------------------------------------------------------------------
/examples/TestRunner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | project(TestCTestRun)
2 | cmake_minimum_required(VERSION 2.8)
3 |
4 | enable_testing()
5 | # include CTestConfig.cmake if present
6 | INCLUDE(CTest)
7 |
8 | FILE(GLOB pythonTests ./run*.py)
9 | LIST(SORT pythonTests)
10 |
11 | FOREACH(aTest ${pythonTests})
12 |
13 | execute_process(
14 | COMMAND ${aTest} --print-test-name
15 | OUTPUT_VARIABLE testName
16 | RESULT_VARIABLE testResult
17 | OUTPUT_STRIP_TRAILING_WHITESPACE
18 | )
19 |
20 | execute_process(
21 | COMMAND ${aTest} --timeout
22 | OUTPUT_VARIABLE testTimeout
23 | RESULT_VARIABLE testResult2
24 | OUTPUT_STRIP_TRAILING_WHITESPACE
25 | )
26 |
27 | IF(testResult OR testResult2)
28 | MESSAGE("Running ${aTest} failed ... not added")
29 | ELSE()
30 | MESSAGE("Adding ${aTest} as ${testName} with timeout ${testTimeout}")
31 | add_test(${testName} ${aTest})
32 | set_tests_properties (${testName} PROPERTIES TIMEOUT ${testTimeout})
33 | ENDIF()
34 | ENDFOREACH(aTest)
35 |
36 |
--------------------------------------------------------------------------------
/examples/TestRunner/PitzDailyData/additionalFunctionObjects:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // File generated by PyFoam - sorry for the ugliness
3 |
4 | FoamFile
5 | {
6 | version 2.0;
7 | format ascii;
8 | class dictionary;
9 | location "system";
10 | object controlDict;
11 | }
12 |
13 | libs (
14 | "libsimpleSwakFunctionObjects.so"
15 | );
16 |
17 | functions {
18 | pressureDiff {
19 | type patchExpression;
20 | patches (
21 | inlet
22 | );
23 | variables (
24 | "pOut{patch'outlet}=sum(p*area())/sum(area());"
25 | );
26 | accumulations (
27 | average
28 | );
29 | expression "p-pOut";
30 | verbose true;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/examples/TestRunner/PitzDailyData/copyToCase/customRegexp:
--------------------------------------------------------------------------------
1 | deltaP{
2 | expr "Expression pressureDiff on inlet: average=(%f%)";
3 | name deltaP;
4 | titles (avg);
5 | }
6 |
--------------------------------------------------------------------------------
/examples/TestRunner/runCTest.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8)
2 |
3 | EXECUTE_PROCESS(
4 | COMMAND hostname -f
5 | OUTPUT_VARIABLE CTEST_SITE
6 | )
7 |
8 | SET(CTEST_BUILD_NAME "$ENV{WM_PROJECT}-$ENV{WM_PROJECT_VERSION}_$ENV{WM_ARCH}_$ENV{WM_OPTIONS}_$ENV{WM_MPLIB}")
9 | MESSAGE("Hoping for CTest Build Name: ${CTEST_BUILD_NAME}")
10 |
11 | SET(CTEST_SOURCE_DIRECTORY ".")
12 | SET(CTEST_BINARY_DIRECTORY ".")
13 |
14 | SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 1000000)
15 | SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000)
16 |
17 | FILE(GLOB runDirs ./*_runDir)
18 |
19 | FOREACH(rd ${runDirs})
20 | FILE(REMOVE_RECURSE ${rd})
21 | ENDFOREACH(rd)
22 |
23 | ctest_start(Nightly)
24 | ctest_test()
25 | ctest_submit()
26 |
--------------------------------------------------------------------------------
/examples/TestRunner/runIcoFoamCavity.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Infrastructure.CTestRun import CTestRun
4 |
5 | class PlainIcoFoamCavity(CTestRun):
6 | def init(self):
7 | self.setParameters(solver="icoFoam",
8 | originalCase="$FOAM_TUTORIALS/incompressible/icoFoam/cavity",
9 | sizeClass="tiny")
10 |
11 | if __name__=='__main__':
12 | PlainIcoFoamCavity().run()
13 |
--------------------------------------------------------------------------------
/examples/TestRunner/runIcoFoamCavityParallel.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from runIcoFoamCavity import PlainIcoFoamCavity
4 | from PyFoam.Applications.Decomposer import Decomposer
5 |
6 | class ParallelIcoFoamCavity(PlainIcoFoamCavity):
7 | def init(self):
8 | self.setParameters(parallel=True,
9 | autoDecompose=False,
10 | nrCpus=2)
11 | def decompose(self):
12 | Decomposer(args=[self.caseDir,
13 | str(self["nrCpus"]),
14 | "--method=simple",
15 | "--n=(2,1,1)",
16 | "--delta=1e-5"])
17 |
18 | if __name__=='__main__':
19 | ParallelIcoFoamCavity().run()
20 |
--------------------------------------------------------------------------------
/examples/TestRunner/runMultiRegionHeater.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Infrastructure.CTestRun import CTestRun
4 |
5 | class MulitRegionHeater(CTestRun):
6 | def init(self):
7 | self.setParameters(solver="chtMultiRegionFoam",
8 | originalCase="$FOAM_TUTORIALS/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater",
9 | sizeClass="small")
10 |
11 | self.addToClone("makeCellSets.setSet")
12 |
13 | def meshPrepare(self):
14 | self.shell("rm -rf constant/polyMesh/sets")
15 |
16 | self.execute("blockMesh")
17 |
18 | self.shell("setSet -batch makeCellSets.setSet")
19 |
20 | self.shell("rm -f constant/polyMesh/sets/*_old")
21 |
22 | self.execute("setsToZones -noFlipMap")
23 | self.execute("splitMeshRegions -cellZones -overwrite")
24 |
25 | self.shell("""
26 | # remove fluid fields from solid regions (important for post-processing)
27 | for i in heater leftSolid rightSolid
28 | do
29 | rm -f 0*/$i/{mut,alphat,epsilon,k,p_rgh,p,U}
30 | done
31 |
32 | # remove solid fields from fluid regions (important for post-processing)
33 | for i in bottomWater topAir
34 | do
35 | rm -f 0*/$i/{cp,K,rho}
36 | done
37 |
38 | for i in bottomWater topAir heater leftSolid rightSolid
39 | do
40 | changeDictionary -region $i > log.changeDictionary.$i 2>&1
41 | done
42 | """)
43 |
44 | def casePrepare(self):
45 | self.status("Modifying controlDict")
46 | self.controlDict()["endTime"]=10
47 | self.controlDict()["writeInterval"]=5
48 | self.controlDict().writeFile()
49 |
50 | if __name__=='__main__':
51 | MulitRegionHeater().run()
52 |
--------------------------------------------------------------------------------
/examples/TestRunner/runMultiRegionHeaterParallel.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from runMultiRegionHeater import MulitRegionHeater
4 | from PyFoam.Applications.Decomposer import Decomposer
5 |
6 | class ParallelMulitRegionHeater(MulitRegionHeater):
7 | def init(self):
8 | self.setParameters(parallel=True,
9 | nrCpus=2)
10 |
11 | if __name__=='__main__':
12 | ParallelMulitRegionHeater().run()
13 |
--------------------------------------------------------------------------------
/examples/TestRunner/runPitzDailyExptInlet.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from runPitzDailyBasic import BasicPitzDailyRun
4 |
5 | class ExptInletPitzDailyRun(BasicPitzDailyRun):
6 | def init(self):
7 | self.setParameters(originalCase="$FOAM_TUTORIALS/incompressible/simpleFoam/pitzDailyExptInlet",
8 | velocityAbsoluteTolerance=3.5,
9 | velocityRelativeTolerance=0.37)
10 |
11 | if __name__=='__main__':
12 | ExptInletPitzDailyRun().run()
13 |
--------------------------------------------------------------------------------
/examples/TestRunner/runPitzDailyLinear.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from os import path
4 |
5 | from runPitzDailyBasic import BasicPitzDailyRun
6 | from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
7 |
8 | class LinearPitzDailyRun(BasicPitzDailyRun):
9 | def init(self):
10 | self.setParameters(
11 | velocityAbsoluteTolerance=0.5,
12 | velocityRelativeTolerance=0.17
13 | )
14 |
15 | def casePrepare(self):
16 | BasicPitzDailyRun.casePrepare(self)
17 |
18 | schemes=ParsedParameterFile(path.join(self.solution().systemDir(),"fvSchemes"))
19 | schemes["divSchemes"]["div(phi,U)"]="Gauss linear";
20 | schemes.writeFile()
21 |
22 | if __name__=='__main__':
23 | LinearPitzDailyRun().run()
24 |
--------------------------------------------------------------------------------
/examples/TestRunner/runPitzDailyParallel.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from runPitzDailyBasic import BasicPitzDailyRun
4 |
5 | class ParallelPitzDailyRun(BasicPitzDailyRun):
6 | def init(self):
7 | self.setParameters(parallel=True,
8 | nrCpus=3,
9 | velocityAbsoluteTolerance=3e-2,
10 | velocityRelativeTolerance=1e-2)
11 |
12 | if __name__=='__main__':
13 | ParallelPitzDailyRun().run()
14 |
--------------------------------------------------------------------------------
/examples/compactOutput.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/python
2 |
3 | """ Runs an OpenFOAM solver and captures the output. Extracts information
4 | about the linear solvers (initial residual) and outputs it in a "Fluentish"
5 | way (one line per timestep).Called:
6 |
7 | compactOutput.py interFoam . damBreak
8 | """
9 |
10 | import re,sys
11 |
12 | from PyFoam.LogAnalysis.LogLineAnalyzer import LogLineAnalyzer
13 | from PyFoam.LogAnalysis.BoundingLogAnalyzer import BoundingLogAnalyzer
14 | from PyFoam.Execution.AnalyzedRunner import AnalyzedRunner
15 |
16 | class CompactLineAnalyzer(LogLineAnalyzer):
17 | def __init__(self):
18 | LogLineAnalyzer.__init__(self)
19 |
20 | self.told=""
21 | self.exp=re.compile("^(.+): Solving for (.+), Initial residual = (.+), Final residual = (.+), No Iterations (.+)$")
22 |
23 | def doAnalysis(self,line):
24 | m=self.exp.match(line)
25 | if m!=None:
26 | name=m.groups()[1]
27 | resid=m.groups()[2]
28 | time=self.getTime()
29 | if time!=self.told:
30 | self.told=time
31 | print "\n t = %6g : " % ( float(time) ),
32 | print " %5s: %6e " % (name,float(resid)),
33 | sys.stdout.flush()
34 |
35 | class CompactAnalyzer(BoundingLogAnalyzer):
36 | def __init__(self):
37 | BoundingLogAnalyzer.__init__(self)
38 | self.addAnalyzer("Compact",CompactLineAnalyzer())
39 |
40 | run=AnalyzedRunner(CompactAnalyzer(),silent=True)
41 | run.start()
42 |
--------------------------------------------------------------------------------
/examples/data/defaultBench.cfg:
--------------------------------------------------------------------------------
1 | [General]
2 | name: default
3 | parallel: no
4 | nProcs: 2
5 | machines: benchMachines
6 | # casesDirectory: /Temp
7 |
8 | [Incompressible driven cavity]
9 | nr: 1
10 | solver: icoFoam
11 | case: cavity
12 | prepare: [("blockMesh","")]
13 | controlDict: [("endTime",2),("writeInterval",50)]
14 | blockSplit: (2,2,1)
15 | baseline: 10.741
16 | weight: 1
17 |
18 | [Dam-break tutorial case]
19 | solver: interFoam
20 | case: damBreak
21 | prepare: [("blockMesh",""),("setFields","")]
22 | controlDict: [("endTime",0.5),("writeInterval",0.1)]
23 | baseline: 106.38
24 | weight: 1
25 |
--------------------------------------------------------------------------------
/examples/interFoamLogAnalyzer.py:
--------------------------------------------------------------------------------
1 | """ Analyzes the output of a interFoam-Run and writes the results to files
2 | in a directory
3 | """
4 | import sys,re
5 |
6 | if len(sys.argv)<2:
7 | print "To few arguments: name of logfile needed"
8 | sys.exit(-1)
9 |
10 | from PyFoam.LogAnalysis.BoundingLogAnalyzer import BoundingLogAnalyzer
11 | from PyFoam.LogAnalysis.LogAnalyzerApplication import LogAnalyzerApplication
12 | from PyFoam.LogAnalysis.SimpleLineAnalyzer import SimpleLineAnalyzer
13 |
14 |
15 | class InterFoamLogAnalyzer(BoundingLogAnalyzer):
16 | def __init__(self):
17 | BoundingLogAnalyzer.__init__(self)
18 | self.addAnalyzer("deltaT",SimpleLineAnalyzer("deltaT","^deltaT = (.+)$"))
19 | self.addAnalyzer("LiquidPhase",SimpleLineAnalyzer("liquid","^Liquid phase volume fraction = (.+) Min\((.+)\) = (.+) Max\(.+\) = (.+)$",idNr=2))
20 |
21 | analyze=LogAnalyzerApplication(InterFoamLogAnalyzer())
22 |
23 | analyze.run()
24 |
--------------------------------------------------------------------------------
/examples/paraview3/gDirection.py:
--------------------------------------------------------------------------------
1 | # Draws a vector in the direction of gravity
2 |
3 | # To be run using "Tools -> Python Shell -> Run Script" inside of paraFoam
4 | # assumes that one OpenFOAM-case is opened
5 |
6 | from PyFoam.Paraview import readerObject,caseDirectory
7 | from PyFoam.Paraview.SimpleSources import Glyph,Arrow
8 |
9 | from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
10 | from os import path
11 |
12 | ro=readerObject()
13 |
14 | try:
15 | env=ParsedParameterFile(path.join(caseDirectory().constantDir(),"environmentalProperties"))
16 | g=env["g"][2]
17 | except IOError:
18 | env=ParsedParameterFile(path.join(caseDirectory().constantDir(),"g"))
19 | g=env["value"]
20 |
21 | #gly=Glyph("Gravity2D",ro.getCenter(),ro.getCenter()+0.5*g*abs(ro.getExtent())/abs(g))
22 | gly=Arrow("Gravity",ro.getCenter(),ro.getCenter()+0.5*g*abs(ro.getExtent())/abs(g))
23 |
24 | gly.repr.DiffuseColor=(0,0,0)
25 |
--------------------------------------------------------------------------------
/examples/paraview3/gDirection_old.py:
--------------------------------------------------------------------------------
1 | # draws a vector in the direction of the gravity using vtk-primitves
2 |
3 | # to be used as a "Programmable Source"
4 |
5 | from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
6 | from PyFoam.Paraview import caseDirectory
7 | from os import path
8 | import paraview
9 |
10 | env=ParsedParameterFile(path.join(caseDirectory().constantDir(),"environmentalProperties"))
11 | g=env["g"][2]
12 | pdo=self.GetPolyDataOutput()
13 | pdo.Allocate(1,1)
14 | pts=paraview.vtk.vtkPoints()
15 | pts.InsertPoint(0,(0.0,0.0,0.0))
16 | pts.InsertPoint(1,g)
17 | line=paraview.vtk.vtkPolyLine()
18 | line.GetPointIds().SetNumberOfIds(2)
19 | line.GetPointIds().SetId(0,0)
20 | line.GetPointIds().SetId(1,1)
21 | pdo.InsertNextCell(line.GetCellType(), line.GetPointIds())
22 | pdo.SetPoints(pts)
23 |
--------------------------------------------------------------------------------
/examples/paraview3/snappyDisplay.py:
--------------------------------------------------------------------------------
1 | # Displays important features of the snappyHexMeshDict
2 |
3 | # To be run using "Tools -> Python Shell -> Run Script" inside of paraFoam
4 | # assumes that one OpenFOAM-case is opened
5 |
6 |
7 | from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
8 |
9 | from PyFoam.Paraview import caseDirectory
10 | from PyFoam.Paraview.SimpleSources import Sphere,Cube,STL,Point
11 |
12 | from os import path
13 |
14 | sol=caseDirectory()
15 |
16 | snap=ParsedParameterFile(path.join(sol.systemDir(),"snappyHexMeshDict"))
17 |
18 | pointInMesh=tuple(snap["castellatedMeshControls"]["locationInMesh"])
19 | print "PointInMesh:",pointInMesh
20 | pt=Point("PointInMesh",pointInMesh)
21 |
22 | pt.repr.DiffuseColor = (1,0,0)
23 |
24 | geometries=[]
25 |
26 | for name,spec in snap["geometry"].iteritems():
27 | if spec["type"]=="triSurfaceMesh":
28 | fn=path.join(sol.constantDir(),"triSurface",name)
29 | nm=spec["name"]
30 | print "STL:",fn,"Name:",nm
31 | ob=STL(nm,fn)
32 | elif spec["type"]=="searchableBox":
33 | pt1=tuple(spec["min"])
34 | pt2=tuple(spec["max"])
35 | print "Box:",pt1,pt2,"Name:",name
36 | ob=Cube(name,pt1,pt2)
37 | elif spec["type"]=="searchableSphere":
38 | ct=tuple(spec["centre"])
39 | radius=spec["radius"]
40 | print "Sphere:",radius,ct,"Name:",name
41 | ob=Sphere(name,ct,absRadius=radius)
42 | else:
43 | print "Unknown Geometry type ",spec["type"]
44 |
45 | ob.repr.Opacity=0.7
46 | ob.repr.DiffuseColor=(0,1,0)
47 |
48 | geometries.append(ob)
49 |
50 |
--------------------------------------------------------------------------------
/examples/paraview3/testSimpleSources.py:
--------------------------------------------------------------------------------
1 | # Demonstrates the creation of some simple objects
2 |
3 | # To be run using "Tools -> Python Shell -> Run Script" inside of paraFoam
4 | # assumes that one OpenFOAM-case is opened
5 |
6 |
7 |
8 | from PyFoam.Paraview import readerObject
9 | from PyFoam.Paraview.SimpleSources import Point,Sphere,Cube,Text,Line,Plane,Arrow,Glyph
10 | from PyFoam.Paraview.SimpleFilters import Group
11 |
12 | from PyFoam.Basics.DataStructures import Vector
13 |
14 | ro=readerObject()
15 |
16 | bnds=ro.getBounds()
17 |
18 | pl=Plane("Plane",ro.getCenter(),ro.getMax(),ro.getCenter()+Vector(1,1,1)^ro.getExtent())
19 |
20 | ln=Line("Line",ro.getMin(),ro.getMax())
21 |
22 | pt1=Point("Point1",ro.getMin())
23 | pt2=Point("Point2",ro.getMax())
24 |
25 | grp=Group("thePoints")
26 | grp.add(pt1)
27 | grp.add(pt2)
28 |
29 | sp=Sphere("Sphere",ro.getCenter())
30 |
31 | cp=Cube("Cube",ro.getMin()-0.2*ro.getExtent(),ro.getMax()+0.2*ro.getExtent())
32 |
33 | txt=Text("Text","Don't Panic")
34 |
35 | arrow=Arrow("Arrow",ro.getMax(),ro.getMax()+ro.getExtent())
36 |
37 | gly=Glyph("Glyph",ro.getMin(),ro.getMin()-ro.getExtent())
38 |
--------------------------------------------------------------------------------
/examples/printLastResiduals.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | # Example that demonstrates how to read application data
4 | # to be used on a pickledData-file that is written at the end of a run
5 |
6 | import sys
7 | from PyFoam.Applications.EchoPickledApplicationData import EchoPickledApplicationData
8 |
9 | pickle=sys.argv[1]
10 | pd=EchoPickledApplicationData(args=["--pickled-file="+pickle])
11 | linear=pd.getData()["analyzed"]["Linear"]
12 |
13 | data={}
14 | namemax=0
15 |
16 | for k in linear:
17 | if k.find("_iterations")<0 and k.find("_final")<0:
18 | data[k]={}
19 | namemax=max(namemax,len(k))
20 |
21 | for k in linear:
22 | if k.find("_iterations")<0 and k.find("_final")<0:
23 | data[k]["initial"]=linear[k]
24 | else:
25 | n,e=k.split("_")
26 | data[n][e]=linear[k]
27 |
28 | format="%"+str(namemax+1)+"s : %-12g (%10e) - %5d"
29 |
30 | for k,d in data.iteritems():
31 | print format % (k,d["initial"],d["final"],d["iterations"])
--------------------------------------------------------------------------------
/examples/tailReplacement.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/python
2 |
3 | """Attempts to replace 'tail -f'. No real purpose for that except as
4 | a demonstration of the Watcher-class"""
5 |
6 | import sys
7 |
8 | from PyFoam.Execution.BasicWatcher import BasicWatcher
9 |
10 | fName=sys.argv[1]
11 |
12 | watcher=BasicWatcher(fName)
13 |
14 | watcher.start()
15 |
--------------------------------------------------------------------------------
/examples/templates/newSchool.template:
--------------------------------------------------------------------------------
1 | $$ x=2+y
2 | $$ import os
3 | $$ from platform import uname
4 | sinX |-sin(x)-|
5 |
6 | machine: |-uname()[1]-|
7 |
8 |
9 | $$ toPrint=str(vals[v])
10 | Key @!v!@ : @!toPrint!@
11 |
12 |
--------------------------------------------------------------------------------
/examples/templates/newSchool.values:
--------------------------------------------------------------------------------
1 | y 2.5;
2 |
3 | vals {
4 | x 2;
5 | lst (a b c);
6 | y "Don't panic";
7 | }
--------------------------------------------------------------------------------
/examples/templates/oldSchool.template:
--------------------------------------------------------------------------------
1 | // Test the old template syntax
2 |
3 | $$ y=2
4 | $$ x=2+y
5 |
6 | sinX $sin(x)$
7 |
--------------------------------------------------------------------------------
/examples/trivialLogAnalyzer.py:
--------------------------------------------------------------------------------
1 | """ Just a demonstration of a VERY simple log analyzer"""
2 |
3 | from PyFoam.LogAnalysis.EchoLogAnalyzer import EchoLogAnalyzer
4 | from PyFoam.LogAnalysis.LogAnalyzerApplication import LogAnalyzerApplication
5 |
6 | analyze=LogAnalyzerApplication(EchoLogAnalyzer())
7 |
8 | analyze.run()
9 |
--------------------------------------------------------------------------------
/maintainance/makeUnitTestStubFiles.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from os import path,listdir,mkdir
4 | from PyFoam.ThirdParty.six import print_
5 |
6 | libStart="PyFoam"
7 | testStart="unittests"
8 |
9 | dMissing=0
10 | fCreated=0
11 |
12 | def checkForTests(lib,test):
13 | global dMissing,fCreated
14 |
15 | libDir=path.join(*lib)
16 | testDir=path.join(*test)
17 | print_("Comparing",libDir,"to",testDir)
18 | for f in listdir(libDir):
19 | if f[:2]=="__" or f in ["ThirdParty","Paraview"]:
20 | continue
21 | if path.isdir(path.join(libDir,f)):
22 | if not path.exists(path.join(testDir,f)):
23 | print_("Subdirectory",f,"missing in",testDir)
24 | mkdir(path.join(testDir,f))
25 | dMissing+=1
26 | checkForTests(lib+[f],test+[f])
27 | elif f[-3:]==".py":
28 | newFile=path.join(testDir,"test_"+f)
29 | className=f[:-3]
30 | if not path.exists(newFile):
31 | print_("Creating",newFile)
32 | open(newFile,"w").write("""import unittest
33 |
34 | from %s import %s
35 |
36 | theSuite=unittest.TestSuite()
37 | """ % (".".join(lib+[className]),className))
38 | fCreated+=1
39 |
40 | checkForTests([libStart],[testStart])
41 |
42 | print_()
43 | print_(dMissing,"directories missing")
44 | print_(fCreated,"files created")
45 |
--------------------------------------------------------------------------------
/obsolete/bin/pyFoamAPoMaFoX.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | from PyFoam.Applications.APoMaFoX import APoMaFoX
4 |
5 | APoMaFoX()
6 |
7 |
--------------------------------------------------------------------------------
/obsolete/bin/pyFoamPlotResiduals.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | description="""\
4 | Plots the residuals generated by the tools
5 | pyFoamStandardLogAnalyzer.py, pyFoamSteadyRunner.py or
6 | pyFoamRunner.py. The argument should be the directory with the result
7 | files (usually PyFoamSolve.analyzed)
8 | """
9 |
10 | from PyFoam.Basics.FoamOptionParser import FoamOptionParser
11 |
12 | parse=FoamOptionParser(description=description,usage="%prog [options] ",interspersed=True)
13 |
14 | try:
15 | import PyFoam.ThirdParty.Gnuplot as Gnuplot
16 | except ImportError,e:
17 | parse.error("Gnuplot module missing. Can't plot")
18 |
19 | parse.parse(nr=1)
20 |
21 | import sys,os
22 | from os import path
23 |
24 | from PyFoam.Basics.Helpers import getLinearNames
25 |
26 | data=parse.getArgs()[0]
27 | dDir=path.basename(data)
28 |
29 | names=getLinearNames(data)
30 |
31 | if sys.stdout.isatty():
32 | g=Gnuplot.Gnuplot(persist=1)
33 | else:
34 | g=Gnuplot.Gnuplot()
35 |
36 |
37 | plots=[]
38 |
39 | for n in names:
40 | plots.append(Gnuplot.File(path.join(data,"linear_"+n),using="1:2",with='steps',title=n))
41 |
42 | g.set_string("logscale y")
43 | g.title("Residuals")
44 |
45 | apply(g.plot,plots)
46 |
47 | if not sys.stdout.isatty():
48 | tmpfile="/tmp/Gnuplot_temp.ps"
49 | Gnuplot.GnuplotOpts.default_lpr=" "+tmpfile
50 | g.hardcopy()
51 | f=open(tmpfile,"r")
52 | sys.stdout.write(f.read())
53 | f.close()
54 | os.remove(tmpfile)
55 |
--------------------------------------------------------------------------------
/pytest.ini:
--------------------------------------------------------------------------------
1 | [pytest]
2 | testpaths = unittests
3 |
--------------------------------------------------------------------------------
/sbin/pyFoamMetaServer.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | import os,sys,time
4 |
5 | from PyFoam.Infrastructure.FoamMetaServer import FoamMetaServer
6 | from PyFoam.Applications.PyFoamApplication import PyFoamApplication
7 |
8 | class MetaServer(PyFoamApplication):
9 | def __init__(self):
10 | description="""Starts the MetaServer"""
11 | PyFoamApplication.__init__(self,description=description,usage="%prog",interspersed=True,nr=0)
12 |
13 | def run(self):
14 | # Do the Unix double-fork magic; see Stevens's book "Advanced
15 | # Programming in the UNIX Environment" (Addison-Wesley) for details
16 | try:
17 | pid = os.fork( )
18 | if pid > 0:
19 | time.sleep(0.5)
20 | # Exit first parent
21 | sys.exit(0)
22 | except OSError, e:
23 | print >>sys.stderr, "fork #1 failed: %d (%s)" % (
24 | e.errno, e.strerror)
25 | sys.exit(1)
26 | # Decouple from parent environment
27 | os.chdir("/")
28 | os.setsid( )
29 | os.umask(0)
30 | # Do second fork
31 | try:
32 | pid = os.fork( )
33 | if pid > 0:
34 | # Exit from second parent; print eventual PID before exiting
35 | print "Daemon PID %d" % pid
36 | sys.exit(0)
37 | except OSError, e:
38 | print >>sys.stderr, "fork #2 failed: %d (%s)" % (
39 | e.errno, e.strerror)
40 | sys.exit(1)
41 |
42 | server=FoamMetaServer()
43 |
44 | if __name__ == "__main__":
45 | MetaServer()
46 |
--------------------------------------------------------------------------------
/sbin/pyFoamSGECheckpointCommand.sh:
--------------------------------------------------------------------------------
1 | #! /bin/csh -f
2 |
3 | /usr/bin/python `dirname $0`/pyFoamSGECommand.py checkpoint
4 |
--------------------------------------------------------------------------------
/sbin/pyFoamSGECleanCommand.sh:
--------------------------------------------------------------------------------
1 | #! /bin/csh -f
2 |
3 | /usr/bin/python `dirname $0`/pyFoamSGECommand.py clean
4 |
--------------------------------------------------------------------------------
/sbin/pyFoamSGECommand.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/python
2 |
3 | from os import environ as env
4 | from os import path,system
5 |
6 | from time import sleep
7 |
8 | import sys
9 |
10 | trigger=sys.argv[1]
11 |
12 | f=open("/nfs/Temp/migrate","w+")
13 | print >>f,env
14 | f.close()
15 |
16 | theDir=env["SGE_CKPT_DIR"]
17 | if theDir=="NONE":
18 | theDir=env["SGE_O_WORKDIR"]
19 |
20 | jobName=env["JOB_NAME"]
21 | jobId=env["JOB_ID"]
22 |
23 | timeout=36000
24 | waiting=10
25 |
26 | fName=path.join(theDir,"%s.%s" % (jobName,jobId))
27 | if env.has_key("TASK_IS"):
28 | fName+=".%s" % env["TASK_ID"]
29 | fName+=".pyFoam.clusterjob"
30 |
31 | if trigger=="clean":
32 | system("rm -f "+fName+"*")
33 | sys.exit(0)
34 |
35 | if not path.exists(fName):
36 | print "Job does not seem to exist"
37 | sys.exit(-1)
38 |
39 | trigger=fName+"."+trigger
40 | # trigger=fName+".checkpoint"
41 |
42 | f=open(trigger,"w")
43 | f.write("Tu was")
44 | f.close()
45 |
46 | expired=0L
47 |
48 | while expired1:
11 | machines=sys.argv[1]
12 | else:
13 | machines=config().get("Network","searchservers")
14 |
15 | if len(sys.argv)>2:
16 | port=int(sys.argv[2])
17 | else:
18 | port=config().getint("Network","startServerPort")
19 |
20 | if len(sys.argv)>3:
21 | length=int(sys.argv[3])
22 | else:
23 | length=config().getint("Network","nrServerPorts")
24 |
25 |
26 | addreses=machines.split(',')
27 |
28 | for a in addreses:
29 | for host in IP(a):
30 | try:
31 | name,alias,rest =socket.gethostbyaddr(str(host))
32 | except socket.herror,reason:
33 | # no name for the host
34 | name="unknown"
35 |
36 |
37 | print str(host),name,
38 |
39 | result=checkFoamServers(str(host),port,length)
40 | if result!=None:
41 | print result
42 | else:
43 | print
44 |
--------------------------------------------------------------------------------
/test/doLogging.py:
--------------------------------------------------------------------------------
1 |
2 | from PyFoam.Infrastructure.Logging import foamLogger
3 | from time import sleep
4 | import sys
5 |
6 | repeats=0
7 | if len(sys.argv)>1:
8 | name=sys.argv[1]
9 | repeats=10
10 | else:
11 | name="nix"
12 |
13 | if len(sys.argv)>2:
14 | repeats=int(sys.argv[2])
15 |
16 |
17 | foamLogger().warning("Starting Test")
18 |
19 | foamLogger("test").info("info")
20 | foamLogger("test").debug("debug vorher")
21 | foamLogger("test").setLevel(1)
22 | foamLogger("test").debug("debug nachher")
23 |
24 | for i in range(repeats):
25 | foamLogger("test").info("I am %s: count %d" % (name,i))
26 | sleep(1)
27 |
28 | foamLogger("test").info("finishing "+name)
29 |
30 | foamLogger().warning("Ending Test")
31 |
--------------------------------------------------------------------------------
/test/errorTest.py:
--------------------------------------------------------------------------------
1 | from PyFoam.Error import error,warning
2 |
3 | warning("Nur eine Warnung")
4 | error("Hier Fehler")
5 |
--------------------------------------------------------------------------------
/test/findServerports.py:
--------------------------------------------------------------------------------
1 |
2 | from PyFoam.Infrastructure.NetworkHelpers import freeServerPort
3 | import socket
4 |
5 | firstport=1080
6 |
7 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
8 | sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
9 | sock.bind(('',firstport))
10 |
11 | print "First Port between 1080 and 1180:",freeServerPort(firstport,length=100)
12 |
13 | sock.close()
14 |
--------------------------------------------------------------------------------
/test/queryFoamServer.py:
--------------------------------------------------------------------------------
1 | """Test all the known methods of a pyFoam-XMLRPC-Server"""
2 |
3 | from xmlrpclib import ServerProxy
4 | import sys
5 |
6 | name=sys.argv[1]
7 | port=int(sys.argv[2])
8 |
9 | server=ServerProxy("http://%s:%d" % (name,port))
10 | print "Tail:",server.tail()
11 | print "Lastline:",server.lastLine()
12 | print "Elapsed:",server.elapsedTime()
13 | print server.system.listMethods()
14 | print "CPU:",server.cpuTime(),"User:",server.cpuUserTime(),"System:",server.cpuSystemTime()
15 | print "Wall:",server.wallTime(),"Memory:",server.usedMemory()
16 | print "Argv:",server.argv(),server.commandLine(),server.scriptName()
17 | print "Parallel:",server.isParallel()
18 | print "Warnings:",server.nrWarnings()
19 | print "MPI: ",server.mpi()
20 | print "Versions. Foam:",server.foamVersion(),"PyFoam:",server.pyFoamVersion()
21 | print "PATH-variable:",server.getEnviron("PATH")
22 | print "UName:",server.uname()
23 | print "Host:",server.hostname()
24 | print "Config:",server.configuration()
25 | print "IsServer:",server.isFoamServer(),"IsLiving:",server.isLiving()
26 |
27 | # for m in server.system.listMethods():
28 | # print m,":",server.system.methodSignature(m),server.system.methodHelp(m)
29 |
30 | # server.kill()
31 |
32 | # while True:
33 | # print "Lastline:",server.lastLine()
34 |
35 |
--------------------------------------------------------------------------------
/test/queryMetaServer.py:
--------------------------------------------------------------------------------
1 | """Checks the functionality of the meta-Server"""
2 |
3 | from xmlrpclib import ServerProxy
4 | from PyFoam import configuration as config
5 |
6 | host=config().get("Metaserver","ip")
7 | port=config().getint("Metaserver","port")
8 |
9 | server=ServerProxy("http://%s:%d" % (host,port))
10 |
11 | print server.system.listMethods()
12 | #for m in server.system.listMethods():
13 | # print m,":",server.system.methodSignature(m),server.system.methodHelp(m)
14 |
15 | print server.list()
16 | # server.collect()
17 |
18 | server.kill()
19 |
--------------------------------------------------------------------------------
/test/readFoamFile.py:
--------------------------------------------------------------------------------
1 |
2 | from PyFoam.Basics.FoamFileGenerator import FoamFileGenerator
3 | from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
4 |
5 | import sys
6 |
7 | fname=sys.argv[1]
8 |
9 | print "Parsing: "+fname
10 |
11 | f=ParsedParameterFile(fname,listLengthUnparsed=100)
12 | print "\nHeader:"
13 | print f.header
14 | print "\nContent:"
15 | print f.content
16 | print "\nReconstructed: "
17 | print str(f)
18 | print "Writing to file"
19 | tmpFile="/tmp/readFoam.test"
20 | o=open(tmpFile,"w")
21 | o.write(str(f))
22 | o.close()
23 | print "Reparsing"
24 | g=ParsedParameterFile(tmpFile,listLengthUnparsed=100)
25 | print g.content
26 | print
27 | if g.content==f.content:
28 | print "Reparsed content is equal to original"
29 | else:
30 | print "Reparsed content differs"
31 |
32 |
--------------------------------------------------------------------------------
/test/testBlockMeshPArser.py:
--------------------------------------------------------------------------------
1 | import sys
2 |
3 | from PyFoam.RunDictionary.ParsedBlockMeshDict import ParsedBlockMeshDict
4 |
5 | bm=ParsedBlockMeshDict(sys.argv[1])
6 | print "Vertices: "
7 | print bm.vertices()
8 | print "Blocks: "
9 | print bm.blocks()
10 | print "Patches:"
11 | print bm.patches()
12 | print "Arcs:"
13 | print bm.arcs()
14 | print "Min/Max",bm.getBounds()
15 | print "Typical Length: ",bm.typicalLength()
16 | print bm["edges"]
17 |
--------------------------------------------------------------------------------
/test/testParameterFile.py:
--------------------------------------------------------------------------------
1 |
2 | from PyFoam.RunDictionary.ParameterFile import ParameterFile
3 | import sys
4 |
5 | file=sys.argv[1]
6 | name=sys.argv[2]
7 | neu =sys.argv[3]
8 |
9 | para=ParameterFile(file)
10 |
11 | print "Old value", para.readParameter(name)
12 |
13 | para.replaceParameter(name,neu)
14 |
15 | print "new value", para.readParameter(name)
16 |
17 | para.purgeFile()
18 |
19 | print "reset value", para.readParameter(name)
20 |
--------------------------------------------------------------------------------
/test/testSolutionDir.py:
--------------------------------------------------------------------------------
1 |
2 | import sys
3 |
4 | from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
5 |
6 | dName=sys.argv[1]
7 |
8 | sd=SolutionDirectory(dName)
9 |
10 | sd.lastToArchive("test")
11 | sd.clearResults()
12 |
13 |
--------------------------------------------------------------------------------
/test/testSolutionFile.py:
--------------------------------------------------------------------------------
1 |
2 | from PyFoam.RunDictionary.SolutionFile import SolutionFile
3 | from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
4 |
5 | import sys
6 |
7 | file=sys.argv[1]
8 | name=sys.argv[2]
9 | bc =sys.argv[3]
10 | neu=sys.argv[4]
11 |
12 | dire=SolutionDirectory(file,archive="TestArchive")
13 | sol=SolutionFile(dire.initialDir(),name)
14 |
15 | print "Old internal",sol.readInternal()
16 |
17 | sol.replaceInternal(neu)
18 |
19 | print "New internal",sol.readInternal()
20 |
21 | sol.purgeFile()
22 |
23 | print "Reset internal",sol.readInternal()
24 |
25 | print "Old boundary",sol.readBoundary(bc)
26 |
27 | sol.replaceBoundary(bc,neu)
28 |
29 | print "New boundary",sol.readBoundary(bc)
30 |
31 | sol.purgeFile()
32 |
33 | print "Reset boundary",sol.readBoundary(bc)
34 |
--------------------------------------------------------------------------------
/unittests/Applications/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | import unittest
3 |
4 | theSuite=unittest.TestSuite()
5 |
--------------------------------------------------------------------------------
/unittests/Applications/test_APoMaFoXiiQt.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | try:
4 | import PyQt4
5 | from PyFoam.Applications.APoMaFoXiiQt import APoMaFoXiiQt
6 | except:
7 | pass
8 |
9 | theSuite=unittest.TestSuite()
10 |
--------------------------------------------------------------------------------
/unittests/Applications/test_AddCaseDataToDatabase.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | import sys
4 | if sys.version_info[0]>2 or sys.version_info[1]>5:
5 | from PyFoam.Applications.AddCaseDataToDatabase import AddCaseDataToDatabase
6 |
7 | theSuite=unittest.TestSuite()
8 |
--------------------------------------------------------------------------------
/unittests/Applications/test_Benchmark.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.Benchmark import Benchmark
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_BinarySize.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.BinarySize import BinarySize
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_BlockMeshConverter.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.BlockMeshConverter import BlockMeshConverter
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_BlockMeshRewrite.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.BlockMeshRewrite import BlockMeshRewrite
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_BuildHelper.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.BuildHelper import BuildHelper
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CaseBuilder.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CaseBuilder import CaseBuilder
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CaseBuilderBackend.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications import CaseBuilderBackend
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CaseReport.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CaseReport import CaseReport
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_ChangeBoundaryName.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.ChangeBoundaryName import ChangeBoundaryName
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_ChangeBoundaryType.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.ChangeBoundaryType import ChangeBoundaryType
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_ChangePython.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.ChangePython import changePython
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_ClearBoundaryValue.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.ClearBoundaryValue import ClearBoundaryValue
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_ClearCase.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.ClearCase import ClearCase
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_ClearInternalField.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.ClearInternalField import ClearInternalField
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CloneCase.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CloneCase import CloneCase
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_ClusterTester.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.ClusterTester import ClusterTester
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonBlink1.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonBlink1 import CommonBlink1
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonCaseBuilder.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonCaseBuilder import CommonCaseBuilder
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonChangeBoundary.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonChangeBoundary import CommonChangeBoundary
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonClearCase.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonClearCase import CommonClearCase
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonLibFunctionTrigger.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonLibFunctionTrigger import CommonLibFunctionTrigger
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonMultiRegion.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonMultiRegion import CommonMultiRegion
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonParallel.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonParallel import CommonParallel
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonParserOptions.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonParserOptions import CommonParserOptions
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonPickledDataInput.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonPickledDataInput import CommonPickledDataInput
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonPlotLines.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonPlotLines import CommonPlotLines
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonPlotOptions.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonPlotOptions import CommonPlotOptions
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonPrePostHooks.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonPrePostHooks import CommonPrePostHooks
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonReadWriteCSV.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonReadWriteCSV import CommonReadWriteCSV
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonReportRunnerData.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonReportRunnerData import CommonReportRunnerData
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonReportUsage.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonReportUsage import CommonReportUsage
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonRestart.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonRestart import CommonRestart
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonSafeTrigger.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonSafeTrigger import CommonSafeTrigger
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonSelectTimesteps.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonSelectTimesteps import CommonSelectTimesteps
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonServer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonServer import CommonServer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonStandardOutput.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonStandardOutput import CommonStandardOutput
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonTemplateBehaviour.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonTemplateBehaviour import CommonTemplateBehaviour
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonTemplateFormat.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonTemplateFormat import CommonTemplateFormat
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonVCSCommit.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonVCSCommit import CommonVCSCommit
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CommonWriteAllTrigger.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CommonWriteAllTrigger import CommonWriteAllTrigger
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_Comparator.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.Comparator import Comparator
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CompareDictionary.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CompareDictionary import CompareDictionary
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CompressCaseFiles.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CompressCaseFiles import CompressCaseFiles
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_ConvertToCSV.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.ConvertToCSV import ConvertToCSV
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CopyLastToFirst.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CopyLastToFirst import CopyLastToFirst
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CreateBoundaryPatches.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.CreateBoundaryPatches import CreateBoundaryPatches
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_CreateModuleFile.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.ThirdParty.six import PY3
4 |
5 | if not PY3:
6 | from PyFoam.Applications.CreateModuleFile import CreateModuleFile
7 |
8 | theSuite=unittest.TestSuite()
9 |
--------------------------------------------------------------------------------
/unittests/Applications/test_Decomposer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.Decomposer import Decomposer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_DisplayBlockMesh.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.DisplayBlockMesh import DisplayBlockMesh
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_DisplayBlockMeshQt.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.ThirdParty.six import PY3
4 |
5 | try:
6 | import PyQt4
7 | if not PY3:
8 | from PyFoam.Applications.DisplayBlockMeshQt import DisplayBlockMeshDialog
9 | except:
10 | pass
11 |
12 | theSuite=unittest.TestSuite()
13 |
--------------------------------------------------------------------------------
/unittests/Applications/test_DumpRunDatabaseToCSV.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | import sys
4 | if sys.version_info[0]>2 or sys.version_info[1]>5:
5 | from PyFoam.Applications.DumpRunDatabaseToCSV import DumpRunDatabaseToCSV
6 |
7 | theSuite=unittest.TestSuite()
8 |
--------------------------------------------------------------------------------
/unittests/Applications/test_EchoDictionary.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.EchoDictionary import EchoDictionary
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_EchoPickledApplicationData.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.EchoPickledApplicationData import EchoPickledApplicationData
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_Execute.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.Execute import Execute
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_FromTemplate.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.FromTemplate import FromTemplate
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_IPythonNotebook.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.IPythonNotebook import IPythonNotebook
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_InitVCSCase.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.InitVCSCase import InitVCSCase
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_JoinCSV.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.JoinCSV import JoinCSV
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_ListCases.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.ListCases import ListCases
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_ListProfilingInfo.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.ListProfilingInfo import ListProfilingInfo
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_MeshUtilityRunner.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.MeshUtilityRunner import MeshUtilityRunner
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_ModifyGGIBoundary.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.ModifyGGIBoundary import ModifyGGIBoundary
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_PVLoadState.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | # from PyFoam.Applications.PVLoadState import PVLoadState
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_PVSnapshot.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | # from PyFoam.Applications.PVSnapshot import PVSnapshot
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_PackCase.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.PackCase import PackCase
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_PlotHelpers.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications import PlotHelpers
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_PlotRunner.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.PlotRunner import PlotRunner
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_PlotWatcher.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.PlotWatcher import PlotWatcher
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_PotentialRunner.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.PotentialRunner import PotentialRunner
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_PrepareCase.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.PrepareCase import PrepareCase
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_PrintData2DStatistics.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.PrintData2DStatistics import PrintData2DStatistics
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_PyFoamApplication.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.PyFoamApplication import PyFoamApplication
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_PyFoamApplicationQt4.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | try:
4 | import PyQt4
5 | from PyFoam.Applications.PyFoamApplicationQt4 import PyFoamApplicationQt4
6 | except:
7 | pass
8 |
9 | theSuite=unittest.TestSuite()
10 |
--------------------------------------------------------------------------------
/unittests/Applications/test_ReadDictionary.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.ReadDictionary import ReadDictionary
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_RedoPlot.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.RedoPlot import RedoPlot
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_RunAtMultipleTimes.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.RunAtMultipleTimes import RunAtMultipleTimes
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_RunParameterVariation.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.RunParameterVariation import RunParameterVariation
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_Runner.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.Runner import Runner
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_STLUtility.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.STLUtility import STLUtility
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_SamplePlot.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.SamplePlot import SamplePlot
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_SteadyRunner.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.SteadyRunner import SteadyRunner
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_SurfacePlot.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.SurfacePlot import SurfacePlot
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_SymlinkToFile.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.SymlinkToFile import SymlinkToFile
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_TestConfiguration.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.TestConfiguration import TestConfiguration
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_TimelinePlot.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.TimelinePlot import TimelinePlot
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_UpdateDictionary.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.UpdateDictionary import UpdateDictionary
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_UpgradeDictionariesTo17.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.UpgradeDictionariesTo17 import UpgradeDictionariesTo17
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_UpgradeDictionariesTo20.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.UpgradeDictionariesTo20 import UpgradeDictionariesTo20
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_UtilityRunnerApp.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.UtilityRunnerApp import UtilityRunnerApp
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Applications/test_WriteDictionary.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Applications.WriteDictionary import WriteDictionary
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam/a2de0d75131a50ed85cc109d629ffffefbe97144/unittests/Basics/__init__.py
--------------------------------------------------------------------------------
/unittests/Basics/test_BasicFile.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.BasicFile import BasicFile
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_BlockMeshComponents.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.BlockMeshComponents import BlockMeshComponent
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_CSVCollection.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.CSVCollection import CSVCollection
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_Data2DStatistics.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.Data2DStatistics import Data2DStatistics
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_DummyPlotTimelines.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.DummyPlotTimelines import DummyPlotTimelines
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_FoamOptionParser.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.FoamOptionParser import FoamOptionParser
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_GeneralPlotTimelines.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.GeneralPlotTimelines import GeneralPlotTimelines
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_GeneralVCSInterface.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.GeneralVCSInterface import GeneralVCSInterface
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_GitInterface.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.GitInterface import GitInterface
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_GnuplotCompare.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.GnuplotCompare import GnuplotCompare
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_GnuplotFile.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.GnuplotFile import GnuplotFile
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_GnuplotTimelines.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.GnuplotTimelines import GnuplotTimelines
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_Helpers.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics import Helpers
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_HgInterface.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | try:
4 | from PyFoam.Basics.HgInterface import HgInterface
5 | except ImportError:
6 | pass
7 |
8 | theSuite=unittest.TestSuite()
9 |
--------------------------------------------------------------------------------
/unittests/Basics/test_LineReader.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.LineReader import LineReader
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_MatplotlibTimelines.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.MatplotlibTimelines import MatplotlibTimelines
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_OutFileCollection.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.OutFileCollection import OutFileCollection
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_OutputFile.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.OutputFile import OutputFile
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_PlotTimelinesFactory.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics import PlotTimelinesFactory
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_PlyParser.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.PlyParser import PlyParser
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_ProgressOutput.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.ProgressOutput import ProgressOutput
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_QwtPlotTimelines.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.QwtPlotTimelines import QwtPlotTimelines
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_RestructuredTextHelper.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.RestructuredTextHelper import RestructuredTextHelper
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_RingBuffer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.RingBuffer import RingBuffer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_RunDatabase.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | import sys
4 | if sys.version_info[0]>2 or sys.version_info[1]>5:
5 | from PyFoam.Basics.RunDatabase import RunDatabase
6 |
7 | theSuite=unittest.TestSuite()
8 |
--------------------------------------------------------------------------------
/unittests/Basics/test_STLFile.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.STLFile import STLFile
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_SvkInterface.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.SvkInterface import SvkInterface
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_SvnInterface.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.SvnInterface import SvnInterface
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_TableData.py:
--------------------------------------------------------------------------------
1 |
2 | import unittest
3 |
4 | from PyFoam.Basics.TableData import TableData
5 |
6 | theSuite=unittest.TestSuite()
7 |
8 | class CustomPlotInfoTest(unittest.TestCase):
9 | def testCreateTable(self):
10 | tb=TableData(["a","b","c"],["d","e","f"])
11 | self.assertEqual(tb[("a","d")],None)
12 | tb[("a","d")]=42
13 | self.assertEqual(tb[("a","d")],42)
14 | self.assertEqual(tb[("b","d")],None)
15 | self.assertRaises(IndexError,
16 | (lambda:tb[("d","a")]))
17 |
18 | theSuite.addTest(unittest.makeSuite(CustomPlotInfoTest,"test"))
19 |
20 |
--------------------------------------------------------------------------------
/unittests/Basics/test_TerminalFormatter.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.TerminalFormatter import TerminalFormatter
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_TimeLineCollection.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.TimeLineCollection import TimeLineCollection
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_Utilities.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.Utilities import Utilities
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Basics/test_XkcdMatplotlibTimelines.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Basics.XkcdMatplotlibTimelines import XkcdMatplotlibTimelines
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | import unittest
3 |
4 | theSuite=unittest.TestSuite()
5 |
--------------------------------------------------------------------------------
/unittests/Execution/test_AnalyzedCommon.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution.AnalyzedCommon import AnalyzedCommon
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/test_AnalyzedRunner.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution.AnalyzedRunner import AnalyzedRunner
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/test_AnalyzedWatcher.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution.AnalyzedWatcher import AnalyzedWatcher
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/test_BasicRunner.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution.BasicRunner import BasicRunner
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/test_BasicWatcher.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution.BasicWatcher import BasicWatcher
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/test_ConvergenceRunner.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution.ConvergenceRunner import ConvergenceRunner
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/test_FoamThread.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution.FoamThread import FoamThread
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/test_GnuplotRunner.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution.GnuplotRunner import GnuplotRunner
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/test_ParallelExecution.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution import ParallelExecution
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/test_StepAnalyzedCommon.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution.StepAnalyzedCommon import StepAnalyzedCommon
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/test_StepAnalyzedRunner.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution.StepAnalyzedRunner import StepAnalyzedRunner
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/test_StepAnalyzedWatcher.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution.StepAnalyzedWatcher import StepAnalyzedWatcher
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Execution/test_UtilityRunner.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Execution.UtilityRunner import UtilityRunner
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/IPythonHelpers/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | import unittest
3 |
4 | theSuite=unittest.TestSuite()
5 |
--------------------------------------------------------------------------------
/unittests/IPythonHelpers/test_Case.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.IPythonHelpers.Case import Case
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/IPythonHelpers/test_Notebook.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.IPythonHelpers.Notebook import Notebook
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/IPythonHelpers/test_PermanentStorage.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.IPythonHelpers.PermanentStorage import PermanentStorage
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/RunHooks/test_MailToAddress.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure.RunHooks.MailToAddress import MailToAddress
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/RunHooks/test_PrintMessageHook.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure.RunHooks.PrintMessageHook import PrintMessageHook
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/RunHooks/test_SendToWebservice.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure.RunHooks.SendToWebservice import SendToWebservice
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/RunHooks/test_WriteToSqliteDatabase.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure.RunHooks.WriteToSqliteDatabase import WriteToSqliteDatabase
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | import unittest
3 |
4 | theSuite=unittest.TestSuite()
5 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/test_Blink1.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure.Blink1 import Blink1
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/test_CTestRun.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure.CTestRun import CTestRun
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/test_ClusterJob.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure.ClusterJob import ClusterJob
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/test_Configuration.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure.Configuration import Configuration
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/test_FoamMetaServer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.ThirdParty.six import PY3
4 |
5 | if not PY3:
6 | from PyFoam.Infrastructure.FoamMetaServer import FoamMetaServer
7 |
8 | theSuite=unittest.TestSuite()
9 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/test_FoamServer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure.FoamServer import FoamServer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/test_Hardcoded.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure import Hardcoded
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/test_Logging.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure import Logging
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/test_NetworkHelpers.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure import NetworkHelpers
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/test_RunHook.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure.RunHook import RunHook
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Infrastructure/test_ServerBase.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Infrastructure.ServerBase import ServerBase
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | # import unittest
3 |
4 | # theSuite=unittest.TestSuite()
5 |
6 | # from .TimeLineAnalyzer import theSuite as TimeLineAnalyzer
7 |
8 | # theSuite.addTest(TimeLineAnalyzer)
9 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_BoundingLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.BoundingLineAnalyzer import BoundingLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_BoundingLogAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.BoundingLogAnalyzer import BoundingLogAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_ContextLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.ContextLineAnalyzer import ContextLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_ContinuityLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.ContinuityLineAnalyzer import ContinuityLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_DeltaTLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.DeltaTLineAnalyzer import DeltaTLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_EchoLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.EchoLineAnalyzer import EchoLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_EchoLogAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.EchoLogAnalyzer import EchoLogAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_ExecNameLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.ExecNameLineAnalyzer import ExecNameLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_ExecutionTimeLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.ExecutionTimeLineAnalyzer import ExecutionTimeLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_FileLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.FileLineAnalyzer import FileLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_FoamLogAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.FoamLogAnalyzer import FoamLogAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_GeneralLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.GeneralLineAnalyzer import GeneralLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_LineFeeder.py:
--------------------------------------------------------------------------------
1 | """Helper function for the debugging of LineAnalyzers"""
2 |
3 | def feedText(analyzer,text):
4 | lines=text.split("\n")
5 |
6 | for l in lines:
7 | analyzer.doAnalysis(l)
8 |
9 |
10 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_LinearSolverLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.LinearSolverLineAnalyzer import LinearSolverLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_LogAnalyzerApplication.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.LogAnalyzerApplication import LogAnalyzerApplication
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_LogLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.LogLineAnalyzer import LogLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_NameFinderLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.NameFinderLineAnalyzer import NameFinderLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_PhaseChangerLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.PhaseChangerLineAnalyzer import PhaseChangerLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_RegExpLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.RegExpLineAnalyzer import RegExpLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_SimpleLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.SimpleLineAnalyzer import SimpleLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_StandardLogAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.StandardLogAnalyzer import StandardLogAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_SteadyConvergedLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.SteadyConvergedLineAnalyzer import SteadyConvergedLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_TimeLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.TimeLineAnalyzer import TimeLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_TimeLineLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.TimeLineLineAnalyzer import TimeLineLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_UtilityAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.UtilityAnalyzer import UtilityAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/LogAnalysis/test_ValueLineAnalyzer.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.LogAnalysis.ValueLineAnalyzer import ValueLineAnalyzer
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/RunDictionary/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam/a2de0d75131a50ed85cc109d629ffffefbe97144/unittests/RunDictionary/__init__.py
--------------------------------------------------------------------------------
/unittests/RunDictionary/test_BlockMesh.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.RunDictionary.BlockMesh import BlockMesh
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/RunDictionary/test_BlockMesh2D.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.RunDictionary.BlockMesh2D import BlockMesh2D
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/RunDictionary/test_BoundaryDict.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.RunDictionary.BoundaryDict import BoundaryDict
4 | from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
5 |
6 | from PyFoam.Error import PyFoamException
7 | from PyFoam.FoamInformation import foamTutorials
8 |
9 | from shutil import rmtree
10 | from os import path
11 | from tempfile import mktemp
12 |
13 | theSuite=unittest.TestSuite()
14 |
15 | class BoundaryDictTest(unittest.TestCase):
16 | def setUp(self):
17 | self.dest=mktemp()
18 | wholePath=path.join(foamTutorials(),"incompressible","simpleFoam","airFoil2D")
19 | SolutionDirectory(wholePath,archive=None,paraviewLink=False).cloneCase(self.dest)
20 |
21 | def tearDown(self):
22 | rmtree(self.dest)
23 |
24 | def testBoundaryRead(self):
25 | bnd=BoundaryDict(self.dest)
26 | self.assertEqual(bnd["walls"]["type"],"wall")
27 | self.assertEqual(bnd["walls"]["nFaces"],78)
28 | self.assertEqual(len(bnd.patches()),4)
29 | self.assertEqual(len(bnd.patches(patchType="patch")),2)
30 |
31 | def testBoundaryWrite(self):
32 | bnd=BoundaryDict(self.dest)
33 | test1={"type":"wall" , "nFaces":0,"startFace":666}
34 | bnd["testIt"]=test1
35 | self.assertEqual(len(bnd.patches()),5)
36 | bnd["walls"]=test1
37 | self.assertEqual(len(bnd.patches()),5)
38 | test2={"type":"wall" , "Faces":0,"startFace":666}
39 | try:
40 | bnd["nix"]=test2
41 | self.fail()
42 | except PyFoamException:
43 | pass
44 |
45 | theSuite.addTest(unittest.makeSuite(BoundaryDictTest,"test"))
46 |
--------------------------------------------------------------------------------
/unittests/RunDictionary/test_FileBasis.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.RunDictionary.FileBasis import FileBasis
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/RunDictionary/test_LagrangianCloudData.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.RunDictionary.LagrangianCloudData import LagrangianCloudData
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/RunDictionary/test_LagrangianPatchData.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.RunDictionary.LagrangianPatchData import LagrangianPatchData
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/RunDictionary/test_ListFile.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.RunDictionary.ListFile import ListFile
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/RunDictionary/test_MeshInformation.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.RunDictionary.MeshInformation import MeshInformation
4 | from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
5 | from PyFoam.Execution.UtilityRunner import UtilityRunner
6 |
7 | from PyFoam.Error import PyFoamException
8 |
9 | from PyFoam.FoamInformation import oldAppConvention as oldApp
10 |
11 | from os import path,environ
12 | from shutil import rmtree
13 | from tempfile import mktemp
14 |
15 | from .test_TimeDirectory import damBreakTutorial
16 |
17 | theSuite=unittest.TestSuite()
18 |
19 | class MeshInformationTest(unittest.TestCase):
20 | def setUp(self):
21 | self.dest=mktemp()
22 | SolutionDirectory(damBreakTutorial(),archive=None,paraviewLink=False).cloneCase(self.dest)
23 |
24 | if oldApp():
25 | pathSpec=[path.dirname(self.dest),path.basename(self.dest)]
26 | else:
27 | pathSpec=["-case",self.dest]
28 |
29 | run=UtilityRunner(argv=["blockMesh"]+pathSpec,silent=False,server=False)
30 | run.start()
31 |
32 | def tearDown(self):
33 | rmtree(self.dest)
34 |
35 | def testBoundaryRead(self):
36 | mesh=MeshInformation(self.dest)
37 | self.assertEqual(mesh.nrOfFaces(),9176)
38 | self.assertEqual(mesh.nrOfPoints(),4746)
39 | self.assertEqual(mesh.nrOfCells(),2268)
40 | try:
41 | self.assertEqual(mesh.nrOfCells(),2268)
42 | except:
43 | if not oldApp():
44 | self.fail()
45 |
46 | theSuite.addTest(unittest.makeSuite(MeshInformationTest,"test"))
47 |
48 | # Should work with Python3 and Python2
49 |
--------------------------------------------------------------------------------
/unittests/RunDictionary/test_ParameterFile.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.RunDictionary.ParameterFile import ParameterFile
4 | from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
5 |
6 | from os import path
7 | from shutil import rmtree
8 | from tempfile import mktemp
9 |
10 | from .test_TimeDirectory import damBreakTutorial
11 |
12 | theSuite=unittest.TestSuite()
13 |
14 | class ParameterFileTest(unittest.TestCase):
15 | def setUp(self):
16 | self.dest=mktemp()
17 | SolutionDirectory(damBreakTutorial(),archive=None,paraviewLink=False).cloneCase(self.dest)
18 |
19 | def tearDown(self):
20 | rmtree(self.dest)
21 |
22 | def testParameterFileRead(self):
23 | par=ParameterFile(path.join(self.dest,"system","controlDict"))
24 | self.assertEqual(par.readParameter("notHere"),"")
25 | self.assertEqual(par.readParameter("startTime"),"0")
26 |
27 | def testParameterFileWrite(self):
28 | par=ParameterFile(path.join(self.dest,"system","controlDict"),backup=True)
29 | self.assertEqual(par.readParameter("startTime"),"0")
30 | par.replaceParameter("startTime","42")
31 | self.assertEqual(par.readParameter("startTime"),"42")
32 | par.restore()
33 | self.assertEqual(par.readParameter("startTime"),"0")
34 |
35 | def testParameterReadWithTab(self):
36 | par=ParameterFile(path.join(self.dest,"system","controlDict"))
37 | par.replaceParameter("startTime"," 42")
38 | self.assertEqual(par.readParameter("startTime"),"42")
39 | par.replaceParameter("startTime","\t 42")
40 | self.assertEqual(par.readParameter("startTime"),"42")
41 |
42 | theSuite.addTest(unittest.makeSuite(ParameterFileTest,"test"))
43 |
--------------------------------------------------------------------------------
/unittests/RunDictionary/test_ParsedBlockMeshDict.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.RunDictionary.ParsedBlockMeshDict import ParsedBlockMeshDict
4 | from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
5 |
6 | from PyFoam.FoamInformation import oldTutorialStructure,foamTutorials,foamVersionNumber
7 | from os import path,environ
8 | from tempfile import mktemp
9 | from shutil import rmtree
10 |
11 | theSuite=unittest.TestSuite()
12 |
13 | def plateHoleTutorial():
14 | prefix=foamTutorials()
15 | if not oldTutorialStructure():
16 | prefix=path.join(prefix,"stressAnalysis")
17 | return path.join(prefix,"solidDisplacementFoam","plateHole")
18 |
19 | class ParsedBlockMeshDictTest(unittest.TestCase):
20 | def setUp(self):
21 | self.dest=mktemp()
22 | SolutionDirectory(plateHoleTutorial(),archive=None,paraviewLink=False).cloneCase(self.dest)
23 |
24 | def tearDown(self):
25 | rmtree(self.dest)
26 |
27 | def testBoundaryRead(self):
28 | blk=ParsedBlockMeshDict(SolutionDirectory(self.dest).blockMesh())
29 | self.assertEqual(blk.convertToMeters(),1.)
30 | self.assertEqual(len(blk.vertices()),22)
31 | self.assertEqual(len(blk.blocks()),5)
32 | self.assertEqual(len(blk.patches()),6)
33 | self.assertEqual(len(blk.arcs()),8)
34 | self.assertEqual(blk.typicalLength(),1.25)
35 | self.assertEqual(str(blk.getBounds()),"([0.0, 0.0, 0.0], [2.0, 2.0, 0.5])")
36 |
37 | def testRoundtripBlockMesh(self):
38 | blk=ParsedBlockMeshDict(SolutionDirectory(self.dest).blockMesh())
39 | txt=str(blk)
40 | try:
41 | i=int(txt.split("blocks")[1].split("(")[0])
42 | self.assert_(False)
43 | except ValueError:
44 | pass
45 |
46 | theSuite.addTest(unittest.makeSuite(ParsedBlockMeshDictTest,"test"))
47 |
--------------------------------------------------------------------------------
/unittests/RunDictionary/test_RegionCases.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.RunDictionary.RegionCases import RegionCases
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/RunDictionary/test_SurfaceDirectory.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.RunDictionary.SurfaceDirectory import SurfaceDirectory
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/Wrappers/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | import unittest
3 |
4 | theSuite=unittest.TestSuite()
5 |
--------------------------------------------------------------------------------
/unittests/test_Error.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.Error import error
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------
/unittests/test_FoamInformation.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from PyFoam.FoamInformation import foamEtc
4 |
5 | theSuite=unittest.TestSuite()
6 |
--------------------------------------------------------------------------------