Skip to content

Commit

Permalink
fix OpenFOAM debug mode error (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
z-g-h authored May 23, 2024
1 parent 2904ab0 commit 2269975
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@

._*
.DS_Store
.vscode
build
pyofm.egg-info
__pycache__
*.so
pyOFMesh.cpp
3 changes: 2 additions & 1 deletion src/OFMesh.C
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ namespace Foam
OFMesh::OFMesh(
char* argsAll)
: meshPtr_(nullptr),
runTimePtr_(nullptr)
runTimePtr_(nullptr),
argsPtr_(nullptr)
{
argsAll_ = argsAll;
}
Expand Down
2 changes: 2 additions & 0 deletions src/OFMesh.H
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ private:
/// all the arguments
char* argsAll_;

autoPtr<argList> argsPtr_;

autoPtr<fvMesh> meshPtr_;

autoPtr<Time> runTimePtr_;
Expand Down
4 changes: 3 additions & 1 deletion src/setRootCasePython.H
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
Foam::argList::addBoolOption("python", "Use Python/Cython wrapping such that the UPstream function \
in OpenFOAM will not initialize or finalize MPI, instead, mpi4py will do that.");

Foam::argList args(argc, argv, true, true, false);
argsPtr_.reset(new Foam::argList(argc, argv, true, true, false));

Foam::argList &args = argsPtr_();
if (!args.checkRootCase())
{
Foam::FatalError.exit();
Expand Down

0 comments on commit 2269975

Please sign in to comment.