Skip to content

Commit 778208a

Browse files
author
Dilawar Singh
committed
Merge branch 'pybind11_shell' of gitlab.com:dilawar/moose-core into pybind11_shell
2 parents dab5af4 + dd65791 commit 778208a

File tree

7 files changed

+163
-119
lines changed

7 files changed

+163
-119
lines changed

basecode/Cinfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Cinfo {
3131
Finfo** finfoArray, // Field information array
3232
unsigned int nFinfos, DinfoBase* d, // A handle to lots of utility
3333
// functions for the Data class.
34-
const string* doc = 0, unsigned int numDoc = 0,
34+
const std::string* doc = 0, unsigned int numDoc = 0,
3535
bool banCreation = false);
3636

3737
/**

pybind11/helper.cpp

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,12 @@ bool doesExist(const string& path)
148148

149149
ObjId mooseElement(const string& path)
150150
{
151-
ObjId oid;
152-
unsigned nid = 0, did = 0, fidx = 0;
153-
Id id;
154-
unsigned int numData = 0;
155-
156-
oid = ObjId(path);
151+
ObjId oid(path);
157152
if (oid.bad()) {
158153
throw runtime_error(std::string("moose_element: '") +
159154
std::string(path) +
160155
std::string("' does not exist!"));
161-
return Id();
156+
return ObjId(Id());
162157
}
163158
return oid;
164159
}
@@ -312,3 +307,18 @@ void mooseStart(double runtime, bool notify=false)
312307
{
313308
getShellPtr()->doStart(runtime, notify);
314309
}
310+
311+
//ObjId mooseCopy(const ObjId& orig, ObjId newParent, string newName, unsigned int n=1
312+
// , bool toGlobal=false, bool copyExtMsgs=false)
313+
//{
314+
// auto id = getShellPtr()->doCopy(orig.id, newParent, newName, n, toGlobal, copyExtMsgs);
315+
// return ObjId(id);
316+
//}
317+
318+
319+
ObjId mooseCopy(const Id& orig, ObjId newParent, string newName, unsigned int n=1
320+
, bool toGlobal=false, bool copyExtMsgs=false)
321+
{
322+
auto id = getShellPtr()->doCopy(orig, newParent, newName, n, toGlobal, copyExtMsgs);
323+
return ObjId(id);
324+
}

pybind11/helper.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ void mooseDelete(const ObjId& oid);
4747

4848
ObjId mooseCreate(const string type, const string& path, size_t numdata = 1);
4949

50+
// ObjId mooseCopy(const ObjId& orig, ObjId newParent, string newName, unsigned int n,
51+
// bool toGlobal, bool copyExtMsgs);
52+
53+
ObjId mooseCopy(const Id& orig, ObjId newParent, string newName, unsigned int n
54+
, bool toGlobal, bool copyExtMsgs);
55+
5056
py::object mooseGetCwe();
5157

5258
void mooseSetClock(const size_t clockId, double dt);
@@ -57,5 +63,4 @@ map<string, string> mooseGetFieldDict(const string& className,
5763
void mooseReinit();
5864
void mooseStart(double runtime, bool notify);
5965

60-
6166
#endif /* end of include guard: HELPER_H */

0 commit comments

Comments
 (0)