2.3.10. swReader

Defined in swCore/swCore.h

class swReader : public QObject

swReader contains common methods for reading parameter files for several classes

The swReader class read the mesh file and generate the grid using a vtkUnstructuredGrid class.

Public Functions

swReader(swParam *Param)


QStringList readClassParametersFile(swParam::file_type fileType, QList<xt::xarray<double> *> swfl, std::size_t nvalues, const QString &msg)

Construct an empty grid.

virtual ~swReader(void)
void setMeshFilename(const QString &filename)

Set the mesh file name.

void addScalarFilename(const QString &filename)

Add scalar file name into QStringList scalar_fields.

void addVectorFilename(const QString &filename)

Add vector file name into QStringList vector_fields.

bool read(void)

Read the mesh file

used setting



  • 2dm file name

  • slf file name -> converts to 2d then reads 2dm.

template<typename T_FLOAT>
void parseSlf(QDataStream&, QString)
vtkUnstructuredGrid *grid(void)

Return the grid.

Public Static Functions

void errorReadingLine(QFile &file, const QString &filename, const QString &line_txt, int line_input_file, int line_code, const QString &function_name)

Private Functions

bool readParametersLine(const QString &line_txt, xt::xarray<double> &vals_line, size_t nb_vars)

Private Members

swParam *m_param = nullptr
swReaderPrivate *d