|
PSCF v1.3.3
|
Read and write fields to file. More...
#include <FieldIo.h>
Public Member Functions | |
| FieldIo () | |
| Constructor. | |
| ~FieldIo () | |
| Destructor. | |
| void | associate (Domain const &domain, FileMaster const &fileMaster) |
| Get and store addresses of associated objects. | |
| void | readFields (DArray< Field > &fields, std::istream &in) |
| Read a set of fields, one per monomer type. | |
| void | readFields (DArray< Field > &fields, std::string const &filename) |
| Read a set of fields, one per monomer type. | |
| void | writeField (Field const &field, std::ostream &out, bool writeHeader=true) const |
| Write a single field to an output stream. | |
| void | writeField (Field const &field, std::string const &filename, bool writeHeader=true) const |
| Write a single field to a file. | |
| void | writeFields (DArray< Field > const &fields, std::ostream &out, bool writeHeader=true) const |
| Write a set of fields, one per monomer type, to an output stream. | |
| void | writeFields (DArray< Field > const &fields, std::string const &filename, bool writeHeader=true) const |
| Write a set of fields, one per monomer type, to a named file. | |
| void | writeBlockCFields (Mixture const &mixture, std::ostream &out) const |
| Write block concentration fields for all blocks to an output stream. | |
| void | writeBlockCFields (Mixture const &mixture, std::string const &filename) const |
| Write block concentration fields for all blocks to a named file. | |
| void | writeVertexQ (Mixture const &mixture, int polymerId, int vertexId, std::ostream &out) const |
| Write product of incoming q fields for one vertex to stream. | |
| void | writeVertexQ (Mixture const &mixture, int polymerId, int vertexId, std::string const &filename) const |
| Write incoming q fields for a specified vertex. | |
| void | remesh (DArray< Field > const &fields, int nx, std::ostream &out) |
| Interpolate an array of fields onto a new mesh and write to stream. | |
| void | remesh (DArray< Field > const &fields, int nx, std::string const &filename) |
| Interpolate an array of fields onto a new mesh and write to file. | |
| void | extend (DArray< Field > const &fields, int m, std::ostream &out) |
| Add points to the end of a field mesh and write to stream. | |
| void | extend (DArray< Field > const &fields, int m, std::string const &filename) |
| Add points to the end of a field mesh and write to a file. | |
Read and write fields to file.
Definition at line 27 of file r1d/misc/FieldIo.h.
| Pscf::R1d::FieldIo::FieldIo | ( | ) |
Constructor.
Definition at line 35 of file r1d/misc/FieldIo.cpp.
| Pscf::R1d::FieldIo::~FieldIo | ( | ) |
Destructor.
Definition at line 41 of file r1d/misc/FieldIo.cpp.
| void Pscf::R1d::FieldIo::associate | ( | Domain const & | domain, |
| FileMaster const & | fileMaster ) |
Get and store addresses of associated objects.
| domain | associated spatial domain |
| fileMaster | associated FileMaster (for file paths) |
Definition at line 45 of file r1d/misc/FieldIo.cpp.
Read a set of fields, one per monomer type.
| fields | array of fields to read, indexed by monomer id |
| in | input stream, open for reading. |
Definition at line 61 of file r1d/misc/FieldIo.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by readFields().
Read a set of fields, one per monomer type.
This function uses the associated FileMaster to open an input file named filename before reading, and closes the file after reading.
| fields | array of fields to read, indexed by monomer id. |
| filename | name of input file |
Definition at line 52 of file r1d/misc/FieldIo.cpp.
References readFields().
| void Pscf::R1d::FieldIo::writeField | ( | Field const & | field, |
| std::ostream & | out, | ||
| bool | writeHeader = true ) const |
Write a single field to an output stream.
| field | field defined on r-space grid (input) |
| out | output stream |
| writeHeader | write file header iff this bool is true |
Definition at line 103 of file r1d/misc/FieldIo.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by writeField().
| void Pscf::R1d::FieldIo::writeField | ( | Field const & | field, |
| std::string const & | filename, | ||
| bool | writeHeader = true ) const |
Write a single field to a file.
This function uses the associated FileMaster to open an output file named filename before writing, and closes the file after writing.
| field | field defined on r-space grid (input) |
| filename | output filename |
| writeHeader | write file header iff this bool is true |
Definition at line 94 of file r1d/misc/FieldIo.cpp.
References writeField().
| void Pscf::R1d::FieldIo::writeFields | ( | DArray< Field > const & | fields, |
| std::ostream & | out, | ||
| bool | writeHeader = true ) const |
Write a set of fields, one per monomer type, to an output stream.
| fields | set of fields to written. |
| out | output stream |
| writeHeader | write file header iff this bool is true |
Definition at line 129 of file r1d/misc/FieldIo.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by writeFields().
| void Pscf::R1d::FieldIo::writeFields | ( | DArray< Field > const & | fields, |
| std::string const & | filename, | ||
| bool | writeHeader = true ) const |
Write a set of fields, one per monomer type, to a named file.
This function uses the associated FileMaster to open an output file named filename before writing, and closes the file after writing.
| fields | array of fields to read, indexed by monomer id |
| filename | output filename |
| writeHeader | write header iff this bool is true |
Definition at line 119 of file r1d/misc/FieldIo.cpp.
References writeFields().
| void Pscf::R1d::FieldIo::writeBlockCFields | ( | Mixture const & | mixture, |
| std::ostream & | out ) const |
Write block concentration fields for all blocks to an output stream.
| mixture | associated Mixture MDE solver object |
| out | output stream |
Definition at line 169 of file r1d/misc/FieldIo.cpp.
References Pscf::MixtureBase::nBlock(), Pscf::MixtureBase::nPolymer(), Pscf::MixtureBase::nSolvent(), Pscf::MixtureTmpl< PT, ST >::polymer(), and Pscf::MixtureTmpl< PT, ST >::solvent().
Referenced by writeBlockCFields().
| void Pscf::R1d::FieldIo::writeBlockCFields | ( | Mixture const & | mixture, |
| std::string const & | filename ) const |
Write block concentration fields for all blocks to a named file.
This function uses the associated FileMaster to open an output file named filename before writing, and closes the file after writing.
| mixture | associated Mixture MDE solver object |
| filename | name of output file |
Definition at line 157 of file r1d/misc/FieldIo.cpp.
References writeBlockCFields().
| void Pscf::R1d::FieldIo::writeVertexQ | ( | Mixture const & | mixture, |
| int | polymerId, | ||
| int | vertexId, | ||
| std::ostream & | out ) const |
Write product of incoming q fields for one vertex to stream.
| mixture | associated Mixture MDE solver object |
| polymerId | integer id of polymer species |
| vertexId | integer id of vertex (end or junction) |
| out | output stream |
Definition at line 217 of file r1d/misc/FieldIo.cpp.
References Pscf::Vertex::inPropagatorId(), Pscf::PolymerTmpl< BT, PT >::nBlock(), Pscf::MixtureBase::nPolymer(), Pscf::MixtureTmpl< PT, ST >::polymer(), Util::product(), Pscf::PolymerTmpl< BT, PT >::propagator(), Pscf::Vertex::size(), UTIL_CHECK, and Pscf::PolymerTmpl< BT, PT >::vertex().
Referenced by writeVertexQ().
| void Pscf::R1d::FieldIo::writeVertexQ | ( | Mixture const & | mixture, |
| int | polymerId, | ||
| int | vertexId, | ||
| std::string const & | filename ) const |
Write incoming q fields for a specified vertex.
| mixture | associated Mixture MDE solver object |
| polymerId | integer id of polymer species |
| vertexId | integer id of vertex (end or junction) |
| filename | name of output file |
Definition at line 204 of file r1d/misc/FieldIo.cpp.
References writeVertexQ().
Interpolate an array of fields onto a new mesh and write to stream.
| fields | field to be remeshed |
| nx | number of grid points in new mesh |
| out | output stream for remeshed field |
Definition at line 270 of file r1d/misc/FieldIo.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by remesh().
| void Pscf::R1d::FieldIo::remesh | ( | DArray< Field > const & | fields, |
| int | nx, | ||
| std::string const & | filename ) |
Interpolate an array of fields onto a new mesh and write to file.
| fields | field to be remeshed |
| nx | number of grid points in new mesh |
| filename | name of output file for remeshed field |
Definition at line 257 of file r1d/misc/FieldIo.cpp.
References remesh().
Add points to the end of a field mesh and write to stream.
Values at the added mesh points are taken to be the same as those at the last mesh point of the original mesh.
| fields | array of fields to be extended |
| m | number of added grid points |
| out | output stream for extended field |
Definition at line 343 of file r1d/misc/FieldIo.cpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
Referenced by extend().
| void Pscf::R1d::FieldIo::extend | ( | DArray< Field > const & | fields, |
| int | m, | ||
| std::string const & | filename ) |
Add points to the end of a field mesh and write to a file.
Values at the added mesh points are taken to be the same as those at the last mesh point of the original mesh.
| fields | field to be remeshed |
| m | number of added grid points |
| filename | name of output file for remeshed field |
Definition at line 330 of file r1d/misc/FieldIo.cpp.
References extend().