Skip to content

Commit 2269975

Browse files
authored
fix OpenFOAM debug mode error (#12)
1 parent 2904ab0 commit 2269975

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11

22
._*
33
.DS_Store
4+
.vscode
5+
build
6+
pyofm.egg-info
7+
__pycache__
8+
*.so
9+
pyOFMesh.cpp

src/OFMesh.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace Foam
1515
OFMesh::OFMesh(
1616
char* argsAll)
1717
: meshPtr_(nullptr),
18-
runTimePtr_(nullptr)
18+
runTimePtr_(nullptr),
19+
argsPtr_(nullptr)
1920
{
2021
argsAll_ = argsAll;
2122
}

src/OFMesh.H

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ private:
3535
/// all the arguments
3636
char* argsAll_;
3737

38+
autoPtr<argList> argsPtr_;
39+
3840
autoPtr<fvMesh> meshPtr_;
3941

4042
autoPtr<Time> runTimePtr_;

src/setRootCasePython.H

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
Foam::argList::addBoolOption("python", "Use Python/Cython wrapping such that the UPstream function \
1616
in OpenFOAM will not initialize or finalize MPI, instead, mpi4py will do that.");
1717

18-
Foam::argList args(argc, argv, true, true, false);
18+
argsPtr_.reset(new Foam::argList(argc, argv, true, true, false));
19+
20+
Foam::argList &args = argsPtr_();
1921
if (!args.checkRootCase())
2022
{
2123
Foam::FatalError.exit();

0 commit comments

Comments
 (0)