PSCF v1.1
|
Container for data of an array in a param file. More...
Public Member Functions | |
def | __init__ (self, label, file, val=None) |
Constructor. More... | |
def | read (self, file) |
Read the elements of this Array from a file. More... | |
def | __str__ (self) |
String representation of this Array object. More... | |
def | getString (self, depth='') |
Indented string representation of this Array object. More... | |
def | returnData (self) |
Return the value of this Array, as a list of element values. More... | |
def | setValue (self, val) |
Set the new value to the Array object. More... | |
Container for data of an array in a param file.
An Array object represents a one-dimensional array of values. An array appears in a parameter file in a multi-line format with one element value per line, delimited by square brackets. The first lines contains the array label followed immediately by an opening bracket, and the last line contains a closing bracket. Elements of the array appear between these lines in order of increasing array index, starting from 0.
def pscfpp.param.Array.__init__ | ( | self, | |
label, | |||
file, | |||
val = None |
|||
) |
Constructor.
label | label string for the Array |
file | a file object, open for reading |
val | stored value for the Array, default to None |
Definition at line 554 of file param.py.
References pscfpp.command.Command.label, pscfpp.param.Composite.label, pscfpp.param.Parameter.label, pscfpp.param.Array.label, pscfpp.param.Matrix.label, Util::XmlAttribute.label(), Util::XmlEndTag.label(), Util::XmlStartTag.label(), Util::ArrayParam< Type >.label(), Util::MatrixParam< Type >.label(), Util::Parameter.label(), Pscf::Pspc::BasisFieldState< D >.read(), Pscf::Pspg::BasisFieldState< D >.read(), pscfpp.output.Thermo.read(), pscfpp.param.Composite.read(), pscfpp.param.Array.read(), pscfpp.param.Matrix.read(), pscfpp.command.Script.read(), pscfpp.field.Field.read(), Util::Label.read(), Pscf::Fd1d::Mixture.read(), Pscf::AmIteratorTmpl< Iterator< D >, FieldCUDA >.read(), Pscf::AmIteratorTmpl< Iterator, T >.read(), Pscf::AmIteratorTmpl< Iterator< D >, DArray< double > >.read(), Pscf::AmIteratorTmpl< Iterator, DArray< double > >.read(), Pscf::Pspc::Domain< D >.read(), Pscf::Pspc::FilmIteratorBase< 3, IteratorType >.read(), Pscf::Pspc::FilmIteratorBase< 1, IteratorType >.read(), Pscf::Pspc::FilmIteratorBase< 2, IteratorType >.read(), Pscf::Pspc::FilmIteratorBase< D, IteratorType >.read(), Pscf::Pspc::Mixture< D >.read(), Pscf::Pspg::Mixture< D >.read(), Util::ParamComposite.read(), pscfpp.param.Parameter.val, pscfpp.param.Array.val, and pscfpp.param.Matrix.val.
def pscfpp.param.Array.read | ( | self, | |
file | |||
) |
Read the elements of this Array from a file.
This function reads the elements of a multi-line array from the file object that is passed as a parameter. On entry, the opening line containing the opening bracket must already have been processed, and the first unread line of the file should contain the value of the first element. Reading stops stops when the closing "]" is read.
file | a file object, open for reading |
Definition at line 575 of file param.py.
References pscfpp.param.getValue(), pscfpp.param.Parameter.val, pscfpp.param.Array.val, and pscfpp.param.Matrix.val.
Referenced by pscfpp.param.Composite.__init__(), pscfpp.field.Field.__init__(), pscfpp.command.Script.__init__(), pscfpp.output.Thermo.__init__(), pscfpp.param.Matrix.__init__(), and pscfpp.param.Array.__init__().
def pscfpp.param.Array.__str__ | ( | self | ) |
String representation of this Array object.
This function return the string representation of this Array object in the multi-line indented param file format, with no indentation of the opening line.
Definition at line 600 of file param.py.
References pscfpp.param.Composite.getString(), pscfpp.param.Parameter.getString(), pscfpp.param.Array.getString(), and pscfpp.param.Matrix.getString().
Referenced by pscfpp.field.Field.write(), pscfpp.output.Thermo.write(), and pscfpp.output.State.write().
def pscfpp.param.Array.getString | ( | self, | |
depth = '' |
|||
) |
Indented string representation of this Array object.
This function returns the string representation for this Array object in a multi-line indented parameter file format with control over indentation of the first line. The parameter 'depth' is a string of spaces that is the indentation of the first line, is prepended to every succeding line.
depth | string of spaces prefixed to all lines |
Definition at line 614 of file param.py.
References pscfpp.command.Command.label, pscfpp.param.Composite.label, pscfpp.param.Parameter.label, pscfpp.param.Array.label, pscfpp.param.Matrix.label, Util::XmlAttribute.label(), Util::XmlEndTag.label(), Util::XmlStartTag.label(), Util::ArrayParam< Type >.label(), Util::MatrixParam< Type >.label(), Util::Parameter.label(), pscfpp.param.Parameter.val, pscfpp.param.Array.val, and pscfpp.param.Matrix.val.
Referenced by pscfpp.param.Composite.__str__(), pscfpp.param.Parameter.__str__(), pscfpp.param.Array.__str__(), pscfpp.param.Matrix.__str__(), and pscfpp.param.Composite.write().
def pscfpp.param.Array.returnData | ( | self | ) |
Return the value of this Array, as a list of element values.
Definition at line 648 of file param.py.
References pscfpp.param.Parameter.val, pscfpp.param.Array.val, and pscfpp.param.Matrix.val.
def pscfpp.param.Array.setValue | ( | self, | |
val | |||
) |
Set the new value to the Array object.
This function sets the new value, parameter val, to the Array object.
val | the expected new value. |
Definition at line 659 of file param.py.
References pscfpp.param.getValue(), pscfpp.param.Parameter.val, pscfpp.param.Array.val, and pscfpp.param.Matrix.val.