MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <Python.h>
#include <structmember.h>
#include <iostream>
#include <typeinfo>
#include <cstring>
#include <map>
#include <ctime>
#include "../basecode/header.h"
#include "../basecode/Id.h"
#include "../basecode/ObjId.h"
#include "../utility/utility.h"
#include "../shell/Shell.h"
#include "moosemodule.h"
Go to the source code of this file.
Functions | |
PyObject * | moose_DestField_call (PyObject *self, PyObject *args, PyObject *kw) |
PyObject * | moose_ElementField_getattro (_Field *self, PyObject *attr) |
PyObject * | moose_ElementField_getDataId (_Field *self, void *closure) |
PyObject * | moose_ElementField_getId (_Field *self, void *closure) |
PyObject * | moose_ElementField_getItem (_Field *self, Py_ssize_t index) |
Py_ssize_t | moose_ElementField_getLen (_Field *self, void *closure) |
PyObject * | moose_ElementField_getName (_Field *self, void *closure) |
PyObject * | moose_ElementField_getNum (_Field *self, void *closure) |
PyObject * | moose_ElementField_getOwner (_Field *self, void *closure) |
PyObject * | moose_ElementField_getPath (_Field *self, void *closure) |
PyObject * | moose_ElementField_getSlice (_Field *self, Py_ssize_t start, Py_ssize_t end) |
int | moose_ElementField_init (_Field *self, PyObject *args, PyObject *kwargs) |
int | moose_ElementField_setattro (_Field *self, PyObject *attr, PyObject *value) |
int | moose_ElementField_setNum (_Field *self, PyObject *args, void *closure) |
void | moose_Field_dealloc (_Field *self) |
long | moose_Field_hash (_Field *self) |
Return the hash of the string {objectpath}.{fieldName} More... | |
int | moose_Field_init (_Field *self, PyObject *args, PyObject *kwargs) |
PyObject * | moose_Field_repr (_Field *self) |
String representation of fields is {objectpath}.{fieldName} More... | |
PyObject * | moose_LookupField_getItem (_Field *self, PyObject *key) |
int | moose_LookupField_setItem (_Field *self, PyObject *key, PyObject *value) |
PyDoc_STRVAR (moose_Field_documentation,"Base class for MOOSE fields.\n""\n""Instances contain the field name and a pointer to the owner\n""object. Note on hash: the Field class is hashable but the hash is\n""constructed from the path of the container element and the field\n""name. Hence changing the name of the container element will cause the\n""hash to change. This is rather unusual in a moose script, but if you\n""are putting fields as dictionary keys, you should do that after names\n""of all elements have been finalized.\n""\n") | |
PyDoc_STRVAR (moose_LookupField_documentation,"LookupField is dictionary-like fields that map keys to values.\n""The keys need not be fixed, as in case of interpolation tables,\n""keys can be any number and the corresponding value is dynamically\n""computed by the method of interpolation.\n""Use moose.doc('classname.fieldname') to display builtin\n""documentation for `field` in class `classname`.\n""\n") | |
PyDoc_STRVAR (moose_DestField_documentation,"DestField is a method field, i.e. it can be called like a function.\n""Use moose.doc('classname.fieldname') to display builtin\n""documentation for `field` in class `classname`.\n") | |
PyDoc_STRVAR (moose_ElementField_documentation,"ElementField represents fields that are themselves elements. For\n""example, synapse in an IntFire neuron. Element fields can be traversed\n""like a sequence. Additionally, you can set the number of entries by\n""setting the `num` attribute to a desired value.\n") | |
PyDoc_STRVAR (moose_ElementField_num_documentation,"Number of entries in the field.") | |
PyDoc_STRVAR (moose_ElementField_path_documentation,"Path of the field element.") | |
PyDoc_STRVAR (moose_ElementField_name_documentation,"Name of the field element.") | |
PyDoc_STRVAR (moose_ElementField_owner_documentation,"Reference to owner element of the field element.") | |
PyDoc_STRVAR (moose_ElementField_id_documentation,"Id of the field element.") | |
PyDoc_STRVAR (moose_ElementField_dataId_documentation,"dataIndex of the field element") | |
Variables | |
static char | dataIndex [] = "dataIndex" |
static PyGetSetDef | ElementFieldGetSetters [] |
static PySequenceMethods | ElementFieldSequenceMethods |
char | emptyString [] = "" |
static char | id [] = "vec" |
PyTypeObject | IdType |
static PyMappingMethods | LookupFieldMappingMethods |
PyTypeObject | moose_DestField |
PyTypeObject | moose_ElementField |
static PyTypeObject | moose_Field |
PyTypeObject | moose_LookupField |
static char | name [] = "name" |
static char | numfield [] = "num" |
PyTypeObject | ObjIdType |
static char | owner [] = "owner" |
static char | path [] = "path" |
PyObject* moose_DestField_call | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) |
Definition at line 296 of file mfield.cpp.
References moose_ObjId_setDestField(), name, and owner.
PyObject* moose_ElementField_getattro | ( | _Field * | self, |
PyObject * | attr | ||
) |
Definition at line 685 of file mfield.cpp.
References Field< A >::get(), get_field_alias(), getFieldType(), Field< A >::getVec(), RAISE_INVALID_ID, shortType(), and to_pytuple().
PyObject* moose_ElementField_getDataId | ( | _Field * | self, |
void * | closure | ||
) |
PyObject* moose_ElementField_getId | ( | _Field * | self, |
void * | closure | ||
) |
Definition at line 581 of file mfield.cpp.
References IdType, and RAISE_INVALID_ID.
Referenced by moose_element().
PyObject* moose_ElementField_getItem | ( | _Field * | self, |
Py_ssize_t | index | ||
) |
Definition at line 611 of file mfield.cpp.
References Field< A >::get(), oid_to_element(), and RAISE_INVALID_ID.
Py_ssize_t moose_ElementField_getLen | ( | _Field * | self, |
void * | closure | ||
) |
Definition at line 561 of file mfield.cpp.
References Field< A >::get(), and RAISE_INVALID_ID.
Referenced by moose_ElementField_setattro().
PyObject* moose_ElementField_getName | ( | _Field * | self, |
void * | closure | ||
) |
Definition at line 593 of file mfield.cpp.
PyObject* moose_ElementField_getNum | ( | _Field * | self, |
void * | closure | ||
) |
Definition at line 528 of file mfield.cpp.
References Field< A >::get(), and RAISE_INVALID_ID.
PyObject* moose_ElementField_getOwner | ( | _Field * | self, |
void * | closure | ||
) |
Definition at line 597 of file mfield.cpp.
PyObject* moose_ElementField_getPath | ( | _Field * | self, |
void * | closure | ||
) |
Definition at line 571 of file mfield.cpp.
References Id::isValid(), path, and RAISE_INVALID_ID.
PyObject* moose_ElementField_getSlice | ( | _Field * | self, |
Py_ssize_t | start, | ||
Py_ssize_t | end | ||
) |
Definition at line 644 of file mfield.cpp.
References Field< A >::get(), oid_to_element(), RAISE_INVALID_ID, and value.
int moose_ElementField_init | ( | _Field * | self, |
PyObject * | args, | ||
PyObject * | kwargs | ||
) |
Initialize field with ObjId and fieldName.
Definition at line 519 of file mfield.cpp.
References moose_Field_init().
int moose_ElementField_setattro | ( | _Field * | self, |
PyObject * | attr, | ||
PyObject * | value | ||
) |
Definition at line 826 of file mfield.cpp.
References Field< A >::get(), getFieldType(), Id::isValid(), moose_ElementField_getLen(), RAISE_INVALID_ID, Field< A >::setVec(), shortType(), and value.
int moose_ElementField_setNum | ( | _Field * | self, |
PyObject * | args, | ||
void * | closure | ||
) |
void moose_Field_dealloc | ( | _Field * | self | ) |
Definition at line 134 of file mfield.cpp.
long moose_Field_hash | ( | _Field * | self | ) |
Return the hash of the string {objectpath}.{fieldName}
Definition at line 142 of file mfield.cpp.
References Id::isValid(), path, and RAISE_INVALID_ID.
int moose_Field_init | ( | _Field * | self, |
PyObject * | args, | ||
PyObject * | kwargs | ||
) |
Initialize field with ObjId and fieldName.
Definition at line 89 of file mfield.cpp.
References Id::isValid(), ObjIdType, owner, and RAISE_INVALID_ID.
Referenced by moose_ElementField_init().
PyObject* moose_Field_repr | ( | _Field * | self | ) |
String representation of fields is {objectpath}.{fieldName}
Definition at line 156 of file mfield.cpp.
References Id::isValid(), and RAISE_INVALID_ID.
PyObject* moose_LookupField_getItem | ( | _Field * | self, |
PyObject * | key | ||
) |
Definition at line 221 of file mfield.cpp.
References getLookupField().
int moose_LookupField_setItem | ( | _Field * | self, |
PyObject * | key, | ||
PyObject * | value | ||
) |
Definition at line 226 of file mfield.cpp.
References setLookupField().
PyDoc_STRVAR | ( | moose_Field_documentation | , |
"Base class for MOOSE fields.\n""\n""Instances contain the field name and a pointer to the owner\n""object. Note on hash: the Field class is hashable but the hash is\n""constructed from the path of the container element and the field\n""name. Hence changing the name of the container element will cause the\n""hash to change. This is rather unusual in a moose | script, | ||
but if you\n""are putting fields as dictionary | keys, | ||
you should do that after names\n""of all elements have been finalized.\n""\n" | |||
) |
PyDoc_STRVAR | ( | moose_LookupField_documentation | , |
"LookupField is dictionary-like fields that map keys to values.\n""The keys need not be | fixed, | ||
as in case of interpolation | tables, | ||
\n""keys can be any number and the corresponding value is dynamically\n""computed by the method of interpolation.\n""Use moose.doc('classname.fieldname') to display builtin\n""documentation for`field`in class`classname`.\n""\n" | |||
) |
PyDoc_STRVAR | ( | moose_DestField_documentation | , |
"DestField is a method | field, | ||
i.e.it can be called like a function.\n""Use moose.doc('classname.fieldname') to display builtin\n""documentation for`field`in class`classname`.\n" | |||
) |
PyDoc_STRVAR | ( | moose_ElementField_documentation | , |
"ElementField represents fields that are themselves elements. For\n"" | example, | ||
synapse in an IntFire neuron.Element fields can be traversed\n""like a sequence. | Additionally, | ||
you can set the number of entries by\n""setting the`num`attribute to a desired value.\n" | |||
) |
PyDoc_STRVAR | ( | moose_ElementField_num_documentation | , |
"Number of entries in the field." | |||
) |
PyDoc_STRVAR | ( | moose_ElementField_path_documentation | , |
"Path of the field element." | |||
) |
PyDoc_STRVAR | ( | moose_ElementField_name_documentation | , |
"Name of the field element." | |||
) |
PyDoc_STRVAR | ( | moose_ElementField_owner_documentation | , |
"Reference to owner element of the field element." | |||
) |
PyDoc_STRVAR | ( | moose_ElementField_id_documentation | , |
"Id of the field element." | |||
) |
PyDoc_STRVAR | ( | moose_ElementField_dataId_documentation | , |
"dataIndex of the field element" | |||
) |
|
static |
Definition at line 406 of file mfield.cpp.
Referenced by matchInsideBrace(), moose_ObjId_hash(), HopFunc2< A1, A2 >::opVec(), MsgElement::rawIndex(), and testSendMsg().
|
static |
Definition at line 408 of file mfield.cpp.
|
static |
Definition at line 455 of file mfield.cpp.
char emptyString[] = "" |
Definition at line 407 of file mfield.cpp.
|
static |
Definition at line 404 of file mfield.cpp.
Referenced by Neutral::initCinfo(), TestId::initCinfo(), Id::isValid(), moose_element(), ReadCell::ReadCell(), TgtInfo::set(), Dsolve::setCompartment(), DiffPoolVec::setId(), TestId::setId(), Dsolve::setStoich(), testSparseMsg(), and to_py().
PyTypeObject IdType |
Definition at line 262 of file vec.cpp.
Referenced by moose_ElementField_getId().
|
static |
The mapping methods make it act like a Python dictionary.
Definition at line 236 of file mfield.cpp.
PyTypeObject moose_DestField |
Definition at line 333 of file mfield.cpp.
Referenced by MODINIT(), and moose_ObjId_get_destField_attr().
PyTypeObject moose_ElementField |
Definition at line 473 of file mfield.cpp.
Referenced by MODINIT(), and moose_ObjId_get_elementField_attr().
|
static |
Definition at line 178 of file mfield.cpp.
PyTypeObject moose_LookupField |
Definition at line 252 of file mfield.cpp.
Referenced by MODINIT(), and moose_ObjId_get_lookupField_attr().
|
static |
Definition at line 401 of file mfield.cpp.
Referenced by ReadCell::addChannelMessage(), Cell::addMethod(), ReadKkit::assignPoolCompartments(), checkForSpine(), Neutral::child(), create_Id_from_path(), defineDestFinfos(), defineElementFinfos(), defineLookupFinfos(), Shell::doCreate(), Shell::doMove(), ReadCspace::expandEnzyme(), NeuroNode::filterSpines(), NeuroNode::findStartNode(), get_Id_attr(), Msg::getDestFieldsOnE1(), Msg::getDestFieldsOnE2(), Element::getMsgTargetAndFunctions(), Msg::getSrcFieldsOnE1(), Msg::getSrcFieldsOnE2(), Neutral::initCinfo(), isNamedPlot(), isPartOfDend(), makeCompt(), moose_copy(), moose_DestField_call(), moose_ObjId_get_destField_attr(), moose_ObjId_get_elementField_attr(), moose_ObjId_get_lookupField_attr(), ReadCspace::printFooter(), NeuroMesh::putSomaAtStart(), ReadCell::ReadCell(), ReadCell::readData(), Conv< T >::rttiType(), PyRun::setInputVar(), Neutral::setName(), Function::setNumVar(), PyRun::setOutputVar(), Element::showFields(), testCellDiffn(), testFinfoFields(), testMsgSrcDestFields(), testSmallCellDiffn(), and testWildcard().
|
static |
Definition at line 402 of file mfield.cpp.
PyTypeObject ObjIdType |
Referenced by moose_Field_init().
|
static |
Definition at line 405 of file mfield.cpp.
Referenced by moose_DestField_call(), and moose_Field_init().
|
static |
Definition at line 403 of file mfield.cpp.
Referenced by Neuron::buildElist(), Shell::chopString(), moose::createMOOSEPath(), moose::createParentDirs(), doClassSpecificMessaging(), findModelParent(), moose::fixPath(), Neuron::getExprElist(), Neuron::getExprVal(), Neuron::getSpinesFromExpression(), Dsolve::initCinfo(), Stoich::initCinfo(), moose_element(), moose_ElementField_getPath(), moose_exists(), moose_Field_hash(), moose_Id_getPath(), moose_Id_init(), moose_ObjId_init_from_path(), moose_setCwe(), moose_useClock(), Streamer::reinit(), HSolve::setPath(), NeuroMesh::setSubTreePath(), testCopy(), testFindModelParent(), testMove(), testMsgElementListing(), testObjIdToAndFromPath(), ReadCspace::testReadModel(), testTreeTraversal(), moose::toFilename(), writeEnz(), writeGroup(), writeKkit(), and writePlot().