49 std::cout << std::endl <<
"Processing partition: " << part << std::endl;
54 f->m_partComm = std::shared_ptr<FieldConvertComm>(
64 int output_points_hom_z = 0,
bool error =
false,
65 bool force_output =
false,
bool no_equispaced =
false,
66 int npz = 0, std::string onlyshape =
"",
67 int part_only = 0,
int part_only_overlapping = 0,
68 bool useSessionVariables =
false,
69 bool useSessionExpansion =
false,
70 bool verbose =
false, std::string domain =
"")
75 if (py::len(argv) > 0)
87 std::make_pair(
"nparts", po::variable_value(nparts,
false)));
91 f->m_defComm = f->m_comm;
99 f->m_vm.insert(std::make_pair(
100 "output-points", po::variable_value(output_points,
false)));
103 if (output_points_hom_z)
106 std::make_pair(
"output-points-hom-z",
107 po::variable_value(output_points_hom_z,
false)));
112 f->m_vm.insert(std::make_pair(
"error", po::variable_value()));
117 f->m_vm.insert(std::make_pair(
"force-output", po::variable_value()));
123 "The doamin option in field is deprecated. Please use "
124 "the xml option range=\"xmax,xmin,ymax,ymin\", \n\t i.e."
125 "InputModule.Create(\"xml\", field, \"myfile.xml\", "
126 "range=\"-1,1,-1,1\").Run()");
131 f->m_vm.insert(std::make_pair(
"no-equispaced", po::variable_value()));
136 f->m_vm.insert(std::make_pair(
"npz", po::variable_value(npz,
false)));
139 if (onlyshape.size())
142 std::make_pair(
"onlyshape", po::variable_value(onlyshape,
false)));
148 std::make_pair(
"part-only", po::variable_value(part_only,
false)));
151 if (part_only_overlapping)
154 std::make_pair(
"part-only-overlapping",
155 po::variable_value(part_only_overlapping,
false)));
158 if (useSessionVariables)
161 std::make_pair(
"use_session_variables", po::variable_value()));
164 if (useSessionExpansion)
167 std::make_pair(
"use_session_expansion", po::variable_value()));
172 f->m_vm.insert(std::make_pair(
"verbose", po::variable_value()));
181 return f->m_fieldPts->GetPts(i);
192 f->m_fieldPts->SetPts(i, inarray);
201 for (
int i = 0; i < expLists.size(); ++i)
203 if (!py::extract<MultiRegions::ExpListSharedPtr>(pyExpList[i]).check())
205 throw NekError(
"List should contain only ExpList objects.");
208 expLists[i] = py::extract<MultiRegions::ExpListSharedPtr>(pyExpList[i]);
218 f->SetupFromExpList(exp);
223 py::class_<Field, std::shared_ptr<Field>>(
"Field", py::no_init)
225 py::make_constructor(
227 (py::arg(
"argv") = py::list(), py::arg(
"nparts") = 0,
228 py::arg(
"output_points") = 0,
229 py::arg(
"output_points_hom_z") = 0, py::arg(
"error") =
false,
230 py::arg(
"force_output") =
false,
231 py::arg(
"no_equispaced") =
false, py::arg(
"npz") = 0,
232 py::arg(
"onlyshape") =
"", py::arg(
"part_only") = 0,
233 py::arg(
"part_only_overlapping") = 0,
234 py::arg(
"use_session_variables") =
false,
235 py::arg(
"use_session_expansion") =
false,
236 py::arg(
"verbose") =
false, py::arg(
"domain") =
"")))
240 .def(
"ClearField", &Field::ClearField)
242 .def(
"ReadFieldDefs", &Field::ReadFieldDefs)
246 .def_readwrite(
"graph", &Field::m_graph)
247 .def_readwrite(
"session", &Field::m_session)
248 .def_readwrite(
"verbose", &Field::m_verbose)
249 .def_readwrite(
"comm", &Field::m_comm);
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
void Field_SetupFromExpList(FieldSharedPtr f, py::list &explists)
void NewPartition(FieldSharedPtr f, py::list &py_argv, int part)
void Field_SetPts(FieldSharedPtr f, const int i, const Array< OneD, const NekDouble > &inarray)
const Array< OneD, const NekDouble > Field_GetPts(FieldSharedPtr f, const int i)
Array< OneD, MultiRegions::ExpListSharedPtr > PyListToOneDArray(py::list &pyExpList)
FieldSharedPtr Field_Init(py::list &argv, int nparts=0, int output_points=0, int output_points_hom_z=0, bool error=false, bool force_output=false, bool no_equispaced=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, std::string domain="")
Nektar::ErrorUtil::NekError NekError
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()
Helper structure to construct C++ command line argc and argv variables from a Python list.
int GetArgc()
Returns the constructed argc.
char ** GetArgv()
Returns the constructed argv.