LOCA::Utils Class Reference

Provides static parallel communication and printing utilities. More...

#include <LOCA_Utils.H>

List of all members.

Public Types

enum  MsgType {
  Error = 0, Warning = 0x1, StepperIteration = 0x2, StepperDetails = 0x4,
  Solver = 0x8, SolverDetails = 0x10, Direction = 0x20, Parameters = 0x40
}
 Message types for printing. More...

Static Public Member Functions

ostream & repeat (ostream &stream, int n, char c= '*')
 Repeat the given character n times to the given stream.
void setUtils (NOX::Parameter::List &p)
 Set the parameters in the utilities class.
bool isPrintProc ()
 Returns true if the current processor is designated as the processor send output to screen and/or file.
bool doPrint (MsgType type)
 Indicate whether or not the message should be printed.
bool doAllPrint (MsgType type)
 Indicate whether or not the message should be printed.
int getMyPID ()
 Returns the process ID number.
NOX::Parameter::ListgetSublist (const string &name)
 Returns a sublist of the paramter list given by name.
Fill fill (int filln, char fillc= '*')
 Creates a Fill object which can be used in an output stream to insert an arbitrary number of a given character. The default character is an asterick.
Sci sci (double dval, int prec=-1)
 Creates a Sci object which can be used in an output stream for printing a double precision number in scientific format with an arbitrary precision. The default precision is that specificed by the Utils static object.

Static Public Attributes

int precision = 3
 Output precision for floats and doubles.
int myPID = 0
 Processor ID.
int printTest = 0xf
 Output test.
int printProc = 0
 Processor responsible for output.

Static Protected Member Functions

void initializeSublistMap (NOX::Parameter::List &p)
 Intializes sublist map with given parameter list.

Static Protected Attributes

SublistMap sublistMap
 Map containing sublist pointers.


Detailed Description

Provides static parallel communication and printing utilities.

The following parameters are used by this class and should be defined in the "Utilities" sublist of the main loca parameter list.

The public variables should never be modified directly.


Member Enumeration Documentation

enum LOCA::Utils::MsgType
 

Message types for printing.

Note that each message type if a power of two - this is very important. They can be added together to specify which messages you wish to receive.


Member Function Documentation

bool LOCA::Utils::doAllPrint MsgType  type  )  [static]
 

Indicate whether or not the message should be printed.

Returns true if the specifed message type should be printed.

bool LOCA::Utils::doPrint MsgType  type  )  [static]
 

Indicate whether or not the message should be printed.

Returns true if the specifed message type should be printed and this is the print process.

Note:
Be careful about putting any computations inside a doPrint if statement since only the print process will execute that code.

LOCA::Utils::Fill LOCA::Utils::fill int  filln,
char  fillc = '*'
[static]
 

Creates a Fill object which can be used in an output stream to insert an arbitrary number of a given character. The default character is an asterick.

For example,

 cout << Utils::fill(10) << "or" << Utils::fill(10,'-'); 

This is modeled after the Form and Bound_form objects in Stroustrup, C++ Programming Langauge, 3rd ed., Chapter 21.4.

NOX::Parameter::List & LOCA::Utils::getSublist const string &  name  )  [static]
 

Returns a sublist of the paramter list given by name.

Note that this hard-codes the parameter list structure and does not do a search to find the sublist

bool LOCA::Utils::isPrintProc  )  [static]
 

Returns true if the current processor is designated as the processor send output to screen and/or file.

This is used to prevent each processor from printing the same information.

LOCA::Utils::Sci LOCA::Utils::sci double  dval,
int  prec = -1
[static]
 

Creates a Sci object which can be used in an output stream for printing a double precision number in scientific format with an arbitrary precision. The default precision is that specificed by the Utils static object.

For example,

 cout << Utils::sci(d) << "or" << Utils::sci(d,2); 

This is modeled after the Form and Bound_form objects in Stroustrup, C++ Programming Langauge, 3rd ed., Chapter 21.4.

void LOCA::Utils::setUtils NOX::Parameter::List p  )  [static]
 

Set the parameters in the utilities class.

Valid parameters are:

  • "Output Information" - Sum of MsgType flags to set what information to output.
  • "MyPID" - Processor ID.
  • "Output Processor" - Ranges from 0 to MyPID-1.
  • "Output Precision" - Precision of values to be printed by output.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:42:22 2008 for NOX by doxygen 1.3.9.1