File: Operation_Debug.cpp

package info (click to toggle)
getdp 3.0.4%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,856 kB
  • sloc: cpp: 63,020; fortran: 13,955; yacc: 9,350; f90: 1,640; lex: 799; makefile: 55; ansic: 34; awk: 33; sh: 23
file content (46 lines) | stat: -rw-r--r-- 1,894 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// GetDP - Copyright (C) 1997-2018 P. Dular and C. Geuzaine, University of Liege
//
// See the LICENSE.txt file for license information. Please report all
// issues on https://gitlab.onelab.info/getdp/getdp/issues

#include <stdio.h>
#include <stdlib.h>
#include "GetDPConfig.h"
#include "ProData.h"
#include "DofData.h"
#include "Cal_Quantity.h"
#include "SolvingOperations.h"
#include "Message.h"

extern struct CurrentData Current ;

void Operation_Debug(struct Operation *Operation_P,
                     struct DofData *DofData_P)
{
  Message::Info(3, "Current step %g, time %g", Current.TimeStep, Current.Time);

  // print summary of all solutions currently in DofData
  Message::Info(3, "DofData %d", DofData_P->Num);
  Message::Info(3, "   %d harmonics", DofData_P->NbrHar);
  Message::Info(3, "   %d Dofs (all %d)", DofData_P->NbrDof, DofData_P->NbrAnyDof);
  Message::Info(3, "   Init: %d %d %d %d %d %d %d", DofData_P->Flag_Init[0],
                DofData_P->Flag_Init[1], DofData_P->Flag_Init[2], DofData_P->Flag_Init[3],
                DofData_P->Flag_Init[4], DofData_P->Flag_Init[5], DofData_P->Flag_Init[6]);
  Message::Info(3, "   %d solutions", List_Nbr(DofData_P->Solutions));
  for(int i = 0; i < List_Nbr(DofData_P->Solutions); i++){
    struct Solution *s = (struct Solution*)List_Pointer(DofData_P->Solutions, i);
    Message::Info(3, "   %d: step %d time %g", i, s->TimeStep, s->Time);
  }
  if(DofData_P->CurrentSolution){
    struct Solution *s = DofData_P->CurrentSolution;
    Message::Info(3, "Current solution: step %d time %g", s->TimeStep, s->Time);
  }

  // print current run-time variables
  std::map<std::string, Value> &var = Get_AllValueSaved();
  Message::Info(3, "%d runtime variables", (int)var.size());
  for(std::map<std::string, Value>::iterator it = var.begin(); it != var.end(); it++){
    Message::Info(3, "   $%s", it->first.c_str());
  }

}