NeoPZ
TPZTimeTemp.cpp
Go to the documentation of this file.
1 
6 #include "TPZTimeTemp.h"
7 #include "pzlog.h"
8 #include "pzstack.h"
9 #include "pzvec.h"
10 
12 
14 {
15  fNumEq = 0;
16  fNumthreads = 0;
17  fPolyOrder = 0;
18  fNumSub = 0;
19  fNumEqCoarse = 0;
20  fniter = 0;
21  fnMultiply = 0;
22  fnPreCond = 0;
23  ft0sub = 0;
24  ft1comput = 0;
25  ft2congraph = 0;
26  ft3analysegraph = 0;
27  ft4identcorner = 0;
28  ft5dohrassembly = 0;
30  ft6iter = 0;
31 
32 }
33 
34 
35 void TPZTimeTemp::PrintHeader(std::ostream &out)
36 {
37  out << "Time_to_SubMesh\tTime_to_ComputeSystemofEq\tTime_to_ConvertGraph\tTime_to_AnalyseGraph\tTotal_time_to_IdentConerNodes\tTime_threadDohrmanAssembly" <<
38  "\tTime_to_Decompose_InnerNodesMatrix\tTime_for_Iterations\tNumEq\tNum_Eq_Coarse\tNumber_of_Elements\tNum_threads\tPoly_Order\tNumSub\tNum_of_Iterations\tElemnts_fnMultiply\tElements_fnPreCond\n";
39 }
40 
41 void TPZTimeTemp::PrintLine(std::ostream &out)
42 {
43 
44  out.precision(5);
45 
46  if (!out)
47  {
48  std::cout << __PRETTY_FUNCTION__ << "Arquivo nao valido" << std::endl;
49  return;
50  }
53  fniter = fnPreCond;
54 
55  out << ft0sub << "\t" << ft1comput << "\t" << ft2congraph << "\t" << ft3analysegraph << "\t" << ft4identcorner << "\t" << ft5dohrassembly << "\t" << ft55decompmatriznosinternos << "\t" << ft6iter
56  << "\t" << fNumEq << "\t" << fNumEqCoarse << "\t" << fNumberofElements << "\t" << fNumthreads << "\t" << fPolyOrder << "\t" << fNumSub << "\t" << fniter << "\t" << fnMultiply << "\t"
57  << fnPreCond << "\t" << fMultiply << "\t" << fPreCond << std::endl;
58 }
59 
60 bool TPZTimeTemp::NeedsHeader(std::string &FileName)
61 {
62  std::ifstream Toto (FileName.c_str());
63  bool shouldprintheader = false;
64  if (!Toto)
65  {
66  char buf[1024];
67  Toto >> buf;
68  if(!Toto) shouldprintheader = true;
69  }
70  return shouldprintheader;
71 }
72 
73 void TPZTimeTemp::ReadLine(std::istream &ReadFile)
74 {
75 
78 
79  REAL temp;
80  for (int j = 0; j < fnMultiply; j++)
81  {
82  ReadFile >> temp;
83  fMultiply.Push(temp);
84  }
85 
86  for (int k = 0; k < fnPreCond; k++)
87  {
88  ReadFile >> temp;
89  fPreCond.Push(temp);
90  }
91 }
REAL ft4identcorner
Total Time for Identifying Corner Nodes = Convert Graph + AnalyseGraph.
Definition: TPZTimeTemp.h:50
Contains the TPZTimeTemp class which takes times.
REAL ft3analysegraph
Time for AnalyseGraph.
Definition: TPZTimeTemp.h:48
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
void ReadLine(std::istream &in)
Read one line of the file.
Definition: TPZTimeTemp.cpp:73
int fNumSub
Number of Substructures.
Definition: TPZTimeTemp.h:30
static void PrintHeader(std::ostream &out)
Print the header.
Definition: TPZTimeTemp.cpp:35
TPZTimeTemp tempo
External variable to TPZTimeTemp (to take time)
Definition: TPZTimeTemp.cpp:11
Templated vector implementation.
TPZStack< REAL > fPreCond
Time to PreCond for each iteration.
Definition: TPZTimeTemp.h:61
REAL ft2congraph
Time for Convert Graph.
Definition: TPZTimeTemp.h:46
int fNumberofElements
Number of elements in the mesh.
Definition: TPZTimeTemp.h:40
int fniter
Number of iterations.
Definition: TPZTimeTemp.h:34
int fnMultiply
Number of elements in fMultiply.
Definition: TPZTimeTemp.h:36
static bool NeedsHeader(std::string &FileName)
If the file does not exists, returns "true".
Definition: TPZTimeTemp.cpp:60
REAL ft6iter
Total Time for Iterations.
Definition: TPZTimeTemp.h:56
TPZTimeTemp()
Initialize the attributes.
Definition: TPZTimeTemp.cpp:13
Takes times. (Tomada de tempos). Utility.
Definition: TPZTimeTemp.h:19
void Push(const T object)
Pushes a copy of the object on the stack.
Definition: pzstack.h:80
int fPolyOrder
Polynomial order.
Definition: TPZTimeTemp.h:28
TPZStack< REAL > fMultiply
Time to Multiply for each iteration.
Definition: TPZTimeTemp.h:59
REAL ft5dohrassembly
Time for ThreadDohrmanAssembly.
Definition: TPZTimeTemp.h:52
A simple stack.
int fNumEq
Number of equations.
Definition: TPZTimeTemp.h:24
REAL ft0sub
Time for Substructuring Mesh.
Definition: TPZTimeTemp.h:42
int fnPreCond
Number of elements in fPreCond.
Definition: TPZTimeTemp.h:38
int fNumEqCoarse
Number of coarse equations.
Definition: TPZTimeTemp.h:32
REAL ft1comput
Time for Computing the system of equations for each substructure.
Definition: TPZTimeTemp.h:44
REAL ft55decompmatriznosinternos
Time to decompose the inner nodes matrix.
Definition: TPZTimeTemp.h:54
int fNumthreads
Number of Threads.
Definition: TPZTimeTemp.h:26
int64_t NElements() const
Returns the number of elements of the vector.
Definition: pzvec.h:190
void PrintLine(std::ostream &out)
Append to the file a line with the informations.
Definition: TPZTimeTemp.cpp:41