45 int i, argc = py::len(py_argv), bufSize = 0;
46 char **argv =
new char *[argc + 1], *
p;
48 for (i = 0; i < argc; ++i)
50 std::string tmp = py::extract<std::string>(py_argv[i]);
51 bufSize += tmp.size() + 1;
54 std::vector<char> buf(bufSize);
55 for (i = 0,
p = &buf[0]; i < argc; ++i)
57 std::string tmp = py::extract<std::string>(py_argv[i]);
75 std::cout << std::endl <<
"Processing partition: " << part << std::endl;
77 int argc = py::len(py_argv);
79 f->m_partComm = std::shared_ptr<FieldConvertComm>(
89 int output_points = 0,
int output_points_hom_z = 0,
90 bool error =
false,
bool forceoutput =
false,
91 std::string domain =
"",
bool noequispaced =
false,
92 int npz = 0, std::string onlyshape =
"",
93 int part_only = 0,
int part_only_overlapping = 0,
94 bool useSessionVariables =
false,
95 bool useSessionExpansion =
false,
102 int argc = py::len(py_argv);
112 std::make_pair(
"nparts", po::variable_value(nparts,
false)));
115 f->m_nParts = nparts;
116 f->m_defComm = f->m_comm;
123 f->m_vm.insert(std::make_pair(
124 "output-points", po::variable_value(output_points,
false)));
127 if (output_points_hom_z)
130 std::make_pair(
"output-points-hom-z",
131 po::variable_value(output_points_hom_z,
false)));
136 f->m_vm.insert(std::make_pair(
"error", po::variable_value()));
141 f->m_vm.insert(std::make_pair(
"forceoutput", po::variable_value()));
147 std::make_pair(
"range", po::variable_value(domain,
false)));
152 f->m_vm.insert(std::make_pair(
"noequispaced", po::variable_value()));
157 f->m_vm.insert(std::make_pair(
"npz", po::variable_value(npz,
false)));
160 if (onlyshape.size())
163 std::make_pair(
"onlyshape", po::variable_value(onlyshape,
false)));
169 std::make_pair(
"part-only", po::variable_value(part_only,
false)));
172 if (part_only_overlapping)
175 std::make_pair(
"part-only-overlapping",
176 po::variable_value(part_only_overlapping,
false)));
179 if (useSessionVariables)
182 std::make_pair(
"useSessionVariables", po::variable_value()));
185 if (useSessionExpansion)
188 std::make_pair(
"useSessionExpansion", po::variable_value()));
193 f->m_vm.insert(std::make_pair(
"verbose", po::variable_value()));
202 return f->m_fieldPts->GetPts(i);
213 f->m_fieldPts->SetPts(i, inarray);
218 py::class_<Field, std::shared_ptr<Field>>(
"Field", py::no_init)
221 .def(
"ClearField", &Field::ClearField)
224 py::make_constructor(
226 (py::arg(
"py_argv"), py::arg(
"nparts") = 0,
227 py::arg(
"output_points") = 0,
228 py::arg(
"output_points_hom_z") = 0, py::arg(
"error") =
false,
229 py::arg(
"forceoutput") =
false, py::arg(
"domain") =
"",
230 py::arg(
"noequispaced") =
false, py::arg(
"npz") = 0,
231 py::arg(
"onlyshape") =
"", py::arg(
"part_only") = 0,
232 py::arg(
"part_only_overlapping") = 0,
233 py::arg(
"useSessionVariables") =
false,
234 py::arg(
"useSessionExpansion") =
false,
235 py::arg(
"verbose") =
false)));
FieldSharedPtr Field_Init(py::list &py_argv, int nparts=0, int output_points=0, int output_points_hom_z=0, bool error=false, bool forceoutput=false, std::string domain="", bool noequispaced=false, int npz=0, std::string onlyshape="", int part_only=0, int part_only_overlapping=0, bool useSessionVariables=false, bool useSessionExpansion=false, bool verbose=false)
void NewPartition(FieldSharedPtr f, py::list &py_argv, int part)
void Field_SetPts(FieldSharedPtr f, const int i, const Array< OneD, const NekDouble > &inarray)
char ** ConvertCommandLine(py::list &py_argv)
const Array< OneD, const NekDouble > Field_GetPts(FieldSharedPtr f, const int i)
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::shared_ptr< Field > FieldSharedPtr
CommFactory & GetCommFactory()
The above copyright notice and this permission notice shall be included.