Skip to content
This repository was archived by the owner on Nov 3, 2022. It is now read-only.

Commit 5c25dad

Browse files
author
Dilawar Singh
committed
One more tests seem to pass.
1 parent 40a4559 commit 5c25dad

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

pybind11/helper.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,11 @@ void mooseStart(double runtime, bool notify = false)
330330
// return ObjId(id);
331331
//}
332332

333-
ObjId mooseCopy(const Id& orig, ObjId newParent, string newName,
333+
ObjId mooseCopy(const ObjId& orig, ObjId newParent, string newName,
334334
unsigned int n = 1, bool toGlobal = false,
335335
bool copyExtMsgs = false)
336336
{
337-
return ObjId(getShellPtr()->doCopy(orig, newParent, newName, n, toGlobal,
337+
return ObjId(getShellPtr()->doCopy(orig.id, newParent, newName, n, toGlobal,
338338
copyExtMsgs));
339339
}
340340

@@ -398,9 +398,6 @@ py::cpp_function getFieldPropertyDestFinfo(const ObjId& oid, const string& fname
398398
{
399399
const auto rttType = finfo->rttiType();
400400

401-
// Return function.
402-
cout << "ObjId " << oid << " -- " << fname << ": " << rttType << endl;
403-
404401
if (rttType == "void") {
405402
std::function<bool()> func = [oid, fname]() {
406403
return SetGet0::set(oid, fname);

pybind11/helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ bool mooseDelete(const string& path);
4949

5050
ObjId mooseCreate(const string type, const string& path, unsigned int numdata = 1);
5151

52-
ObjId mooseCopy(const Id& orig, ObjId newParent, string newName,
52+
ObjId mooseCopy(const ObjId& orig, ObjId newParent, string newName,
5353
unsigned int n, bool toGlobal, bool copyExtMsgs);
5454

5555
py::object mooseGetCwe();

pybind11/pymoose.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ bool setFieldGeneric(const ObjId& oid, const string& fieldName,
6868

6969
if (fieldType == "double")
7070
return Field<double>::set(oid, fieldName, val.cast<double>());
71+
if (fieldType == "vector<double>")
72+
return Field<vector<double>>::set(oid, fieldName, val.cast<vector<double>>());
7173
if (fieldType == "float")
7274
return Field<float>::set(oid, fieldName, val.cast<float>());
7375
if (fieldType == "unsigned int")
@@ -82,12 +84,16 @@ bool setFieldGeneric(const ObjId& oid, const string& fieldName,
8284
return Field<bool>::set(oid, fieldName, val.cast<bool>());
8385
if (fieldType == "string")
8486
return Field<string>::set(oid, fieldName, val.cast<string>());
87+
if (fieldType == "vector<string>")
88+
return Field<vector<string>>::set(oid, fieldName, val.cast<vector<string>>());
8589
if (fieldType == "char")
8690
return Field<char>::set(oid, fieldName, val.cast<char>());
8791
if (fieldType == "ObjId")
8892
return Field<ObjId>::set(oid, fieldName, val.cast<ObjId>());
89-
if (fieldType == "Id")
90-
return Field<Id>::set(oid, fieldName, val.cast<Id>());
93+
if (fieldType == "Id") {
94+
// NB: Note that we cast to ObjId here and not to Id.
95+
return Field<Id>::set(oid.id, fieldName, val.cast<ObjId>());
96+
}
9197
if (fieldType == "Variable")
9298
return Field<Variable>::set(oid, fieldName, val.cast<Variable>());
9399

0 commit comments

Comments
 (0)