Memosa-FVM  0.2
ArrayWriter Class Reference

#include <ArrayWriter.h>

Inheritance diagram for ArrayWriter:

Public Member Functions

 ArrayWriter (const bool binary, const int vectorComponent, const int atypeComponent)
 
virtual ~ArrayWriter ()
 
template<class T >
void writeFloats (FILE *fp, const T *data, const int count, const int stride, const Array< bool > *mask=0)
 

Protected Attributes

const bool _binary
 
const int _vectorComponent
 
const int _atypeComponent
 

Detailed Description

Definition at line 12 of file ArrayWriter.h.

Constructor & Destructor Documentation

ArrayWriter::ArrayWriter ( const bool  binary,
const int  vectorComponent,
const int  atypeComponent 
)
inline

Definition at line 15 of file ArrayWriter.h.

16  :
17  _binary(binary),
18  _vectorComponent(vectorComponent),
19  _atypeComponent(atypeComponent)
20  {}
const int _atypeComponent
Definition: ArrayWriter.h:44
const int _vectorComponent
Definition: ArrayWriter.h:43
const bool _binary
Definition: ArrayWriter.h:42
virtual ArrayWriter::~ArrayWriter ( )
inlinevirtual

Definition at line 22 of file ArrayWriter.h.

22 {};

Member Function Documentation

template<class T >
void ArrayWriter::writeFloats ( FILE *  fp,
const T *  data,
const int  count,
const int  stride,
const Array< bool > *  mask = 0 
)
inline

Definition at line 25 of file ArrayWriter.h.

Referenced by ScalarArrayWriter< T >::write(), and VectorArrayWriter< T, N >::write().

27  {
28  if (mask)
29  {
30  for(int n=0,i=0; n<count; i+=stride,n++)
31  if ((*mask)[n])
32  fprintf(fp,"%12.5e\n",data[i]);
33  }
34  else
35  {
36  for(int n=0,i=0; n<count; i+=stride,n++)
37  fprintf(fp,"%12.5e\n",data[i]);
38  }
39  }

Member Data Documentation

const int ArrayWriter::_atypeComponent
protected
const bool ArrayWriter::_binary
protected

Definition at line 42 of file ArrayWriter.h.

const int ArrayWriter::_vectorComponent
protected

Definition at line 43 of file ArrayWriter.h.

Referenced by VectorArrayWriter< T, N >::write().


The documentation for this class was generated from the following file: