Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
CG_Iterations Namespace Reference

Functions

def Parse_Nektar_Output
 

Variables

string Mesh = 'cyl-small.xml'
 
string Max_N_Z = 'output_72.txt'
 
string Conditions_File = 'conditions_80.xml'
 
string Scheme = 'IterativeStaticCond'
 
list Consider_Modes = [80]
 
int Num_Constants = 2
 
 Compare_Serial = False
 
 Parallel = True
 
string Parallelisation = 'Hybrid_Socket'
 
 Compare_Parallel = True
 
int Num_Node = 1
 
string output_path = 'Output/Figures/Max_Min_CG/'
 
string cmd_string_clear = 'rm -r Output/Figures/Max_Min_CG/ \n'
 
tuple process = Popen([cmd_string_clear],shell=True, stdout=PIPE, stdin=PIPE)
 
list Pressure = []
 
list Velocity_1 = []
 
list Velocity_2 = []
 
list Velocity_3 = []
 
list Pressure_Key = []
 
list Velocity_1_Key = []
 
list Velocity_2_Key = []
 
list Velocity_3_Key = []
 
list Max_Pressure_CG = []
 
list Max_Velocity_1_CG = []
 
list Max_Velocity_2_CG = []
 
list Max_Velocity_3_CG = []
 
list Min_Pressure_CG = []
 
list Min_Velocity_1_CG = []
 
list Min_Velocity_2_CG = []
 
list Min_Velocity_3_CG = []
 
int Skip_Steps = 20
 
tuple key_P = map(int, Pressure[i].keys())
 
tuple key_V_1 = map(int, Velocity_1[i].keys())
 
tuple key_V_2 = map(int, Velocity_2[i].keys())
 
tuple key_V_3 = map(int, Velocity_3[i].keys())
 
list CG_Min_Pressure = []
 
list CG_Max_Pressure = []
 
list CG_Min_Velocity_1 = []
 
list CG_Max_Velocity_1 = []
 
list CG_Min_Velocity_2 = []
 
list CG_Max_Velocity_2 = []
 
list CG_Min_Velocity_3 = []
 
list CG_Max_Velocity_3 = []
 
string savefile = 'Output/Figures/Max_Min_CG/Min_CG'
 
string title = 'Minimum CG Iterations: '
 
tuple max_modes = len(Pressure[len(Timing_Files) - 1])
 
list modes = []
 
list data_mean = [[], [], [], []]
 
list data_std_dev = [[], [], [], []]
 
list data_var = [[], [], [], []]
 
list Data_P = []
 
list Data_V_1 = []
 
list Data_V_2 = []
 
list Data_V_3 = []
 
list Settling_Deviation_P = []
 
list Settling_Deviation_V_1 = []
 
list Settling_Deviation_V_2 = []
 
list Settling_Deviation_V_3 = []
 
list Settling_Time = []
 
 Error = True
 
list Data_2_P = []
 
list Data_2_V_1 = []
 
list Data_2_V_2 = []
 
list Data_2_V_3 = []
 

Function Documentation

def CG_Iterations.Parse_Nektar_Output (   Input_Filename,
  Skip_Steps 
)

Definition at line 31 of file CG_Iterations.py.

Referenced by parallel.Run_Parallel_Comparison().

31 
32 def Parse_Nektar_Output(Input_Filename, Skip_Steps):
33 
34  # Open file to be pharsed
35  f = open(Input_Filename, "r")
36 
37  # List for outputs
38  Times = []
39 
40  # We use dictionaries to generate look up tables of the CG information
41  Pressure = {}
42  Velocity_1 = {}
43  Velocity_2 = {}
44  Velocity_3 = {}
45 
46  # Count timestep we're on
47  count = 0
48 
49  # Pharse desired data
50  for line in f:
51  a = line.split()
52  for i in range(0, len(a)):
53 
54  # Iterate the timestep counter every time the file hits 'Pressure'
55  if (a[i] == 'Pressure'):
56  Velocity = False
57 
58  # Var is iterated depending on pressure or velocity being read in
59  var = 1
60  count += 1
61  continue
62 
63  # Skip these time steps as they contain all the start up computations
64  if (count <= Skip_Steps):
65  continue
66 
67  if (a[i] == 'Velocity'):
68  Velocity = True
69  var = 1
70  continue
71 
72  # Record the plane number
73  if (a[i] == 'Plane'):
74  plane = a[i + 1]
75 
76  if Velocity is True and plane == '0':
77  var += 1
78 
79  continue
80 
81  # Append each value of CG to the dictionaries
82  if (a[i] == 'CG'):
83  if (var == 1):
84  if plane in Pressure.keys():
85  Pressure[plane].append(int(a[i + 4]))
86  continue
87  else:
88  Pressure[plane] = [int(a[i + 4])]
89 
90  if (var == 2):
91  if plane in Velocity_1.keys():
92  Velocity_1[plane].append(int(a[i + 4]))
93  continue
94  else:
95  Velocity_1[plane] = [int(a[i + 4])]
96 
97  if (var == 3):
98  if plane in Velocity_2.keys():
99  Velocity_2[plane].append(int(a[i + 4]))
100  continue
101  else:
102  Velocity_2[plane] = [int(a[i + 4])]
103 
104  if (var == 4):
105  if plane in Velocity_3.keys():
106  Velocity_3[plane].append(int(a[i + 4]))
107  continue
108  else:
109  Velocity_3[plane] = [int(a[i + 4])]
110 
111 
112 
113  # Return the dictionaries of CG iteration
114  return(Pressure, Velocity_1, Velocity_2, Velocity_3)
115 
116 #------------------------------------
117 # Functions end here
118 #------------------------------------
119 
120 #------------------------------------
121 # Program begins here
122 #------------------------------------
123 
# Input the mesh file name, stored in Input/Mesh/
def Parse_Nektar_Output

Variable Documentation

list CG_Iterations.CG_Max_Pressure = []

Definition at line 261 of file CG_Iterations.py.

list CG_Iterations.CG_Max_Velocity_1 = []

Definition at line 264 of file CG_Iterations.py.

list CG_Iterations.CG_Max_Velocity_2 = []

Definition at line 267 of file CG_Iterations.py.

list CG_Iterations.CG_Max_Velocity_3 = []

Definition at line 270 of file CG_Iterations.py.

list CG_Iterations.CG_Min_Pressure = []

Definition at line 260 of file CG_Iterations.py.

list CG_Iterations.CG_Min_Velocity_1 = []

Definition at line 263 of file CG_Iterations.py.

list CG_Iterations.CG_Min_Velocity_2 = []

Definition at line 266 of file CG_Iterations.py.

list CG_Iterations.CG_Min_Velocity_3 = []

Definition at line 269 of file CG_Iterations.py.

string CG_Iterations.cmd_string_clear = 'rm -r Output/Figures/Max_Min_CG/ \n'

Definition at line 169 of file CG_Iterations.py.

CG_Iterations.Compare_Parallel = True

Definition at line 152 of file CG_Iterations.py.

CG_Iterations.Compare_Serial = False

Definition at line 143 of file CG_Iterations.py.

string CG_Iterations.Conditions_File = 'conditions_80.xml'

Definition at line 130 of file CG_Iterations.py.

list CG_Iterations.Consider_Modes = [80]

Definition at line 136 of file CG_Iterations.py.

list CG_Iterations.Data_2_P = []

Definition at line 703 of file CG_Iterations.py.

list CG_Iterations.Data_2_V_1 = []

Definition at line 704 of file CG_Iterations.py.

list CG_Iterations.Data_2_V_2 = []

Definition at line 705 of file CG_Iterations.py.

list CG_Iterations.Data_2_V_3 = []

Definition at line 706 of file CG_Iterations.py.

list CG_Iterations.data_mean = [[], [], [], []]

Definition at line 396 of file CG_Iterations.py.

list CG_Iterations.Data_P = []

Definition at line 404 of file CG_Iterations.py.

list CG_Iterations.data_std_dev = [[], [], [], []]

Definition at line 397 of file CG_Iterations.py.

list CG_Iterations.Data_V_1 = []

Definition at line 405 of file CG_Iterations.py.

list CG_Iterations.Data_V_2 = []

Definition at line 406 of file CG_Iterations.py.

list CG_Iterations.Data_V_3 = []

Definition at line 407 of file CG_Iterations.py.

list CG_Iterations.data_var = [[], [], [], []]

Definition at line 398 of file CG_Iterations.py.

CG_Iterations.Error = True

Definition at line 683 of file CG_Iterations.py.

list CG_Iterations.key_P = map(int, Pressure[i].keys())

Definition at line 248 of file CG_Iterations.py.

list CG_Iterations.key_V_1 = map(int, Velocity_1[i].keys())

Definition at line 249 of file CG_Iterations.py.

list CG_Iterations.key_V_2 = map(int, Velocity_2[i].keys())

Definition at line 250 of file CG_Iterations.py.

list CG_Iterations.key_V_3 = map(int, Velocity_3[i].keys())

Definition at line 251 of file CG_Iterations.py.

tuple CG_Iterations.max_modes = len(Pressure[len(Timing_Files) - 1])

Definition at line 377 of file CG_Iterations.py.

string CG_Iterations.Max_N_Z = 'output_72.txt'

Definition at line 127 of file CG_Iterations.py.

list CG_Iterations.Max_Pressure_CG = []

Definition at line 214 of file CG_Iterations.py.

list CG_Iterations.Max_Velocity_1_CG = []

Definition at line 215 of file CG_Iterations.py.

list CG_Iterations.Max_Velocity_2_CG = []

Definition at line 216 of file CG_Iterations.py.

list CG_Iterations.Max_Velocity_3_CG = []

Definition at line 217 of file CG_Iterations.py.

string CG_Iterations.Mesh = 'cyl-small.xml'

Definition at line 124 of file CG_Iterations.py.

Referenced by main(), Nektar::Utilities::ProcessOptiExtract.Process(), Nektar::Utilities::ProcessSpherigon.Process(), Nektar::Utilities::ProcessLinear.Process(), Nektar::Utilities::ProcessInsertSurface.Process(), and Nektar::NekMeshUtils::Octree.WriteOctree().

list CG_Iterations.Min_Pressure_CG = []

Definition at line 219 of file CG_Iterations.py.

list CG_Iterations.Min_Velocity_1_CG = []

Definition at line 220 of file CG_Iterations.py.

list CG_Iterations.Min_Velocity_2_CG = []

Definition at line 221 of file CG_Iterations.py.

list CG_Iterations.Min_Velocity_3_CG = []

Definition at line 222 of file CG_Iterations.py.

list CG_Iterations.modes = []

Definition at line 380 of file CG_Iterations.py.

Referenced by Nektar::LibUtilities::NodalUtilTriangle.v_OrthoBasis(), Nektar::LibUtilities::NodalUtilTetrahedron.v_OrthoBasis(), Nektar::LibUtilities::NodalUtilPrism.v_OrthoBasis(), Nektar::LibUtilities::NodalUtilQuad.v_OrthoBasis(), Nektar::LibUtilities::NodalUtilHex.v_OrthoBasis(), Nektar::Utilities::NodalUtilTriMonomial.v_OrthoBasis(), Nektar::LibUtilities::NodalUtilTriangle.v_OrthoBasisDeriv(), Nektar::LibUtilities::NodalUtilTetrahedron.v_OrthoBasisDeriv(), Nektar::LibUtilities::NodalUtilPrism.v_OrthoBasisDeriv(), Nektar::LibUtilities::NodalUtilQuad.v_OrthoBasisDeriv(), and Nektar::LibUtilities::NodalUtilHex.v_OrthoBasisDeriv().

int CG_Iterations.Num_Constants = 2

Definition at line 139 of file CG_Iterations.py.

int CG_Iterations.Num_Node = 1

Definition at line 155 of file CG_Iterations.py.

string CG_Iterations.output_path = 'Output/Figures/Max_Min_CG/'

Definition at line 167 of file CG_Iterations.py.

CG_Iterations.Parallel = True

Definition at line 146 of file CG_Iterations.py.

string CG_Iterations.Parallelisation = 'Hybrid_Socket'

Definition at line 149 of file CG_Iterations.py.

list CG_Iterations.Pressure = []

Definition at line 204 of file CG_Iterations.py.

list CG_Iterations.Pressure_Key = []

Definition at line 209 of file CG_Iterations.py.

tuple CG_Iterations.process = Popen([cmd_string_clear],shell=True, stdout=PIPE, stdin=PIPE)

Definition at line 170 of file CG_Iterations.py.

string CG_Iterations.savefile = 'Output/Figures/Max_Min_CG/Min_CG'

Definition at line 312 of file CG_Iterations.py.

Referenced by Nektar::VortexWaveInteraction.MoveFile(), and Nektar::VortexWaveInteraction.SaveFile().

string CG_Iterations.Scheme = 'IterativeStaticCond'

Definition at line 133 of file CG_Iterations.py.

list CG_Iterations.Settling_Deviation_P = []

Definition at line 675 of file CG_Iterations.py.

list CG_Iterations.Settling_Deviation_V_1 = []

Definition at line 676 of file CG_Iterations.py.

list CG_Iterations.Settling_Deviation_V_2 = []

Definition at line 677 of file CG_Iterations.py.

list CG_Iterations.Settling_Deviation_V_3 = []

Definition at line 678 of file CG_Iterations.py.

list CG_Iterations.Settling_Time = []

Definition at line 680 of file CG_Iterations.py.

int CG_Iterations.Skip_Steps = 20

Definition at line 225 of file CG_Iterations.py.

string CG_Iterations.title = 'Minimum CG Iterations: '

Definition at line 313 of file CG_Iterations.py.

Referenced by Nektar::FieldUtils::OutputTecplotBinary.WriteTecplotHeader().

list CG_Iterations.Velocity_1 = []

Definition at line 205 of file CG_Iterations.py.

list CG_Iterations.Velocity_1_Key = []

Definition at line 210 of file CG_Iterations.py.

list CG_Iterations.Velocity_2 = []

Definition at line 206 of file CG_Iterations.py.

list CG_Iterations.Velocity_2_Key = []

Definition at line 211 of file CG_Iterations.py.

list CG_Iterations.Velocity_3 = []

Definition at line 207 of file CG_Iterations.py.

list CG_Iterations.Velocity_3_Key = []

Definition at line 212 of file CG_Iterations.py.