diff --git a/Documentation/ProjectFile/prj/process_variables/process_variable/source_terms/source_term/Python/c_Python.md b/Documentation/ProjectFile/prj/process_variables/process_variable/source_terms/source_term/Python/c_Python.md new file mode 100644 index 0000000000000000000000000000000000000000..dfd8a940617d636680e3ce482ecb203ca50d9c41 --- /dev/null +++ b/Documentation/ProjectFile/prj/process_variables/process_variable/source_terms/source_term/Python/c_Python.md @@ -0,0 +1,4 @@ +Source term using a Python script to compute its values. + +See ProcessLib::SourceTerms::Python::PythonSourceTermPythonSideInterface for +the Python-side source term interface. diff --git a/Documentation/ProjectFile/prj/process_variables/process_variable/source_terms/source_term/Python/t_flush_stdout.md b/Documentation/ProjectFile/prj/process_variables/process_variable/source_terms/source_term/Python/t_flush_stdout.md new file mode 100644 index 0000000000000000000000000000000000000000..9ea47703dd005980f7a336584429e48635465a9d --- /dev/null +++ b/Documentation/ProjectFile/prj/process_variables/process_variable/source_terms/source_term/Python/t_flush_stdout.md @@ -0,0 +1,3 @@ +Determines if stdout should be flushed each time before and after passing +control to the Python script. This might slow down operation, but ensures the +right order of messages printed to stdout from Python and C++. diff --git a/Documentation/ProjectFile/prj/process_variables/process_variable/source_terms/source_term/Python/t_source_term_object.md b/Documentation/ProjectFile/prj/process_variables/process_variable/source_terms/source_term/Python/t_source_term_object.md new file mode 100644 index 0000000000000000000000000000000000000000..f36c8cd36ac7097d0fe9961ca75350142b0405dc --- /dev/null +++ b/Documentation/ProjectFile/prj/process_variables/process_variable/source_terms/source_term/Python/t_source_term_object.md @@ -0,0 +1,2 @@ +The object (variable name) in the provided Python script that will be used for +this source term. diff --git a/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.cpp b/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.cpp index 896270d789ab832b7ce5b5d7345039f3b73417ed..3707a3801e30d63d68c7193e29df0cbfbbd77cb4 100644 --- a/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.cpp +++ b/ProcessLib/SourceTerms/Python/CreatePythonSourceTerm.cpp @@ -27,13 +27,13 @@ std::unique_ptr<SourceTerm> createPythonSourceTerm( unsigned const shapefunction_order, unsigned const global_dim) { DBUG("Constructing PythonSourceTerm from config."); - //! \ogs_file_param{prj__process_variables__process_variable__source_term__source_term__type} + //! \ogs_file_param{prj__process_variables__process_variable__source_terms__source_term__type} config.checkConfigParameter("type", "Python"); auto const source_term_object = - //! \ogs_file_param{prj__process_variables__process_variable__source_term__source_term__Python__source_term_object} + //! \ogs_file_param{prj__process_variables__process_variable__source_terms__source_term__Python__source_term_object} config.getConfigParameter<std::string>("source_term_object"); - //! \ogs_file_param{prj__process_variables__process_variable__source_term__source_term__Python__flush_stdout} + //! \ogs_file_param{prj__process_variables__process_variable__source_terms__source_term__Python__flush_stdout} auto const flush_stdout = config.getConfigParameter("flush_stdout", false); // Evaluate Python code in scope of main module @@ -60,8 +60,8 @@ std::unique_ptr<SourceTerm> createPythonSourceTerm( dof_table.getNumberOfVariableComponents(variable_id)); } - // In case of partitioned mesh the source_term could be empty, i.e. there is no - // source_term condition. + // In case of partitioned mesh the source_term could be empty, i.e. there is + // no source_term condition. #ifdef USE_PETSC // This can be extracted to createSourceTerm() but then the config // parameters are not read and will cause an error.