HermesCommon  3.0
Hermes::Algebra::EpetraVector< Scalar > Class Template Reference
+ Inheritance diagram for Hermes::Algebra::EpetraVector< Scalar >:

Public Member Functions

 EpetraVector (const Epetra_Vector &v)
 
virtual void alloc (unsigned int ndofs)
 
virtual void free ()
 free the memory
 
virtual Scalar get (unsigned int idx) const
 
virtual void extract (Scalar *v) const
 
virtual void zero ()
 Zero the vector.
 
Vector< Scalar > * duplicate () const
 Duplicates a matrix (including allocation).
 
virtual Vector< Scalar > * change_sign ()
 Multiply by minus one.
 
virtual void set (unsigned int idx, Scalar y)
 
virtual void add (unsigned int idx, Scalar y)
 
virtual void add (unsigned int n, unsigned int *idx, Scalar *y)
 
virtual void export_to_file (const char *filename, const char *var_name, MatrixExportFormat fmt, char *number_format="%lf")
 
template<>
void set (unsigned int idx, double y)
 
template<>
void set (unsigned int idx, std::complex< double > y)
 
template<>
void add (unsigned int idx, double y)
 
template<>
void add (unsigned int idx, std::complex< double > y)
 
- Public Member Functions inherited from Hermes::Algebra::Vector< Scalar >
 Vector ()
 Default constructor.
 
 Vector (unsigned int size)
 
virtual void finish ()
 finish the assembly of the vector
 
virtual Vector< Scalar > * set_vector (Vector< Scalar > *vec)
 Set values from a user-provided vector.
 
virtual Vector< Scalar > * set_vector (Scalar *vec)
 Set values from a user-provided array.
 
virtual Vector< Scalar > * add_vector (Vector< Scalar > *vec)
 Add a vector.
 
virtual Vector< Scalar > * add_vector (Scalar *vec)
 Add a vector.
 
virtual Vector< Scalar > * subtract_vector (Vector< Scalar > *vec)
 Subtract a vector.
 
virtual Vector< Scalar > * subtract_vector (Scalar *vec)
 Subtract a vector.
 
unsigned int get_size () const
 Get vector length.
 
- Public Member Functions inherited from Hermes::Mixins::Loggable
 Loggable (bool verbose_output=false, callbackFn verbose_callback=NULL, bool add_newline=true)
 
void set_file_output_only (bool onOff)
 
void set_timestamps (bool onOff)
 Sets the addition of a time stamp on each line in the log file. By default it is on.
 
void set_erase_on_beginning (bool onOff)
 Sets the logFile being always erased before logging.
 
void set_logFile_name (const char *filename)
 
void set_logFile_name (std::string filename)
 
void info (const char *msg,...) const
 
void info_if (bool cond, const char *msg,...) const
 
void warn (const char *msg,...) const
 
void warn_if (bool cond, const char *msg,...) const
 
void error (const char *msg,...) const
 
void error_if (bool cond, const char *msg,...) const
 
virtual void set_verbose_output (bool to_set)
 
bool get_verbose_output () const
 Returns the current value of verbose_output;.
 
virtual void set_verbose_callback (callbackFn callback)
 
callbackFn get_verbose_callback () const
 Returns the current value of verbose_callback;.
 
- Public Member Functions inherited from Hermes::Algebra::Mixins::MatrixRhsImportExport< Scalar >
void export_to_file (std::string filename, const char *var_name, Algebra::MatrixExportFormat fmt, char *number_format="%lf")
 
void export_to_file (std::string filename, std::string var_name, Algebra::MatrixExportFormat fmt, char *number_format="%lf")
 
virtual void import_from_file (const char *filename, const char *var_name, Algebra::MatrixExportFormat fmt)
 
void import_from_file (std::string filename, const char *var_name, Algebra::MatrixExportFormat fmt)
 
void import_from_file (std::string filename, std::string var_name, Algebra::MatrixExportFormat fmt)
 

Public Attributes

Epetra_Vector * vec
 
- Public Attributes inherited from Hermes::Mixins::Loggable
char * logFileName
 Logfile name.
 

Protected Attributes

Epetra_BlockMap * std_map
 
Epetra_Vector * vec_im
 Imaginary part of the vector, vec holds the real part.
 
bool owner
 
- Protected Attributes inherited from Hermes::Algebra::Vector< Scalar >
unsigned int size
 size of vector
 

Friends

class Hermes::Solvers::AmesosSolver< Scalar >
 
class Hermes::Solvers::AztecOOSolver< Scalar >
 

Additional Inherited Members

- Static Public Member Functions inherited from Hermes::Mixins::Loggable
static void set_static_logFile_name (const char *filename)
 
static void set_static_logFile_name (std::string filename)
 
- Static Public Attributes inherited from Hermes::Mixins::Loggable
static char * staticLogFileName = nullptr
 
- Protected Member Functions inherited from Hermes::Mixins::Loggable
void hermes_fwrite (const void *ptr, size_t size, size_t nitems, FILE *stream) const
 
void hermes_fread (void *ptr, size_t size, size_t nitems, FILE *stream) const
 

Detailed Description

template<typename Scalar>
class Hermes::Algebra::EpetraVector< Scalar >

Definition at line 109 of file epetra.h.

Member Function Documentation

template<typename Scalar>
virtual void Hermes::Algebra::EpetraVector< Scalar >::add ( unsigned int  idx,
Scalar  y 
)
virtual

update element on the specified position

Parameters
[in]idx- indices where to update
[in]y- value

Implements Hermes::Algebra::Vector< Scalar >.

template<typename Scalar >
void Hermes::Algebra::EpetraVector< Scalar >::add ( unsigned int  n,
unsigned int *  idx,
Scalar *  y 
)
virtual

update subset of the elements

Parameters
[in]n- number of positions to update
[in]idx- indices where to update
[in]y- values

Implements Hermes::Algebra::Vector< Scalar >.

Definition at line 422 of file epetra.cpp.

template<typename Scalar >
void Hermes::Algebra::EpetraVector< Scalar >::alloc ( unsigned int  ndofs)
virtual

allocate memory for storing ndofs elements

Parameters
[in]ndofs- number of elements of the vector

Implements Hermes::Algebra::Vector< Scalar >.

Definition at line 337 of file epetra.cpp.

template<typename Scalar >
void Hermes::Algebra::EpetraVector< Scalar >::export_to_file ( const char *  filename,
const char *  var_name,
MatrixExportFormat  fmt,
char *  number_format = "%lf" 
)
virtual

writing matrix.

Parameters
[in]filenameobvious
[in]var_namename of variable (will be written to output file)
[in]fmtoutput file format
[in]number_formatspecifies the number format where possible

Implements Hermes::Algebra::Mixins::MatrixRhsImportExport< Scalar >.

Definition at line 442 of file epetra.cpp.

template<typename Scalar >
void Hermes::Algebra::EpetraVector< Scalar >::extract ( Scalar *  v) const
virtual

Extract vector values into user-provided array.

Parameters
[out]v- array which will contain extracted values
Todo:
this can't be used with complex numbers

Implements Hermes::Algebra::Vector< Scalar >.

Definition at line 435 of file epetra.cpp.

template<typename Scalar >
Scalar Hermes::Algebra::EpetraVector< Scalar >::get ( unsigned int  idx) const
virtual

Get the value from a position

Returns
the value form the specified index
Parameters
[in]idx- index which to obtain the value from

Implements Hermes::Algebra::Vector< Scalar >.

Definition at line 429 of file epetra.cpp.

template<typename Scalar>
virtual void Hermes::Algebra::EpetraVector< Scalar >::set ( unsigned int  idx,
Scalar  y 
)
virtual

set the entry on a specified position

Parameters
[in]idx- indices where to update
[in]y- value

Implements Hermes::Algebra::Vector< Scalar >.


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