Nektar++
Functions | Variables
CG_Iterations Namespace Reference

Functions

def Parse_Nektar_Output (Input_Filename, Skip_Steps)
 

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
 
bool Compare_Serial = False
 
bool Parallel = True
 
string Parallelisation = 'Hybrid_Socket'
 
bool Compare_Parallel = True
 
int Num_Node = 1
 
 Mesh_File
 
 Input_Nektar_Max
 
 Conditions
 
 Loc_Serial_Timing_Files
 
 Loc_Parallel_Timing_Files
 
 Benchmark_PBS
 
 MPI_Benchmark
 
 Node_Map
 
string output_path = 'Output/Figures/Max_Min_CG/'
 
string cmd_string_clear = 'rm -r Output/Figures/Max_Min_CG/ \n'
 
 process = Popen([cmd_string_clear],shell=True, stdout=PIPE, stdin=PIPE)
 
 Nektar_Modes
 
 Timing_Files
 
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
 
 pressure
 
 velocity_1
 
 velocity_2
 
 velocity_3
 
 key_P = map(int, Pressure[i].keys())
 
 key_V_1 = map(int, Velocity_1[i].keys())
 
 key_V_2 = map(int, Velocity_2[i].keys())
 
 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' + '_' + str(Nektar_Modes[i]) + '.png'
 
string title = 'Minimum CG Iterations: ' + 'Planes = ' + str(Nektar_Modes[i])
 
 fig
 
 ax
 
 label
 
 loc
 
int max_modes = len(Pressure[len(Timing_Files) - 1]) + 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 = []
 
bool Error = True
 
list Data_2_P = []
 
list Data_2_V_1 = []
 
list Data_2_V_2 = []
 
list Data_2_V_3 = []
 

Function Documentation

◆ Parse_Nektar_Output()

def CG_Iterations.Parse_Nektar_Output (   Input_Filename,
  Skip_Steps 
)

Definition at line 31 of file CG_Iterations.py.

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

Referenced by parallel.Run_Parallel_Comparison().

Variable Documentation

◆ ax

CG_Iterations.ax

◆ Benchmark_PBS

CG_Iterations.Benchmark_PBS

Definition at line 161 of file CG_Iterations.py.

◆ CG_Max_Pressure

CG_Iterations.CG_Max_Pressure = []

Definition at line 261 of file CG_Iterations.py.

◆ CG_Max_Velocity_1

CG_Iterations.CG_Max_Velocity_1 = []

Definition at line 264 of file CG_Iterations.py.

◆ CG_Max_Velocity_2

CG_Iterations.CG_Max_Velocity_2 = []

Definition at line 267 of file CG_Iterations.py.

◆ CG_Max_Velocity_3

CG_Iterations.CG_Max_Velocity_3 = []

Definition at line 270 of file CG_Iterations.py.

◆ CG_Min_Pressure

CG_Iterations.CG_Min_Pressure = []

Definition at line 260 of file CG_Iterations.py.

◆ CG_Min_Velocity_1

CG_Iterations.CG_Min_Velocity_1 = []

Definition at line 263 of file CG_Iterations.py.

◆ CG_Min_Velocity_2

CG_Iterations.CG_Min_Velocity_2 = []

Definition at line 266 of file CG_Iterations.py.

◆ CG_Min_Velocity_3

CG_Iterations.CG_Min_Velocity_3 = []

Definition at line 269 of file CG_Iterations.py.

◆ cmd_string_clear

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

Definition at line 169 of file CG_Iterations.py.

◆ Compare_Parallel

bool CG_Iterations.Compare_Parallel = True

Definition at line 152 of file CG_Iterations.py.

◆ Compare_Serial

bool CG_Iterations.Compare_Serial = False

Definition at line 143 of file CG_Iterations.py.

◆ Conditions

CG_Iterations.Conditions

Definition at line 161 of file CG_Iterations.py.

◆ Conditions_File

string CG_Iterations.Conditions_File = 'conditions_80.xml'

Definition at line 130 of file CG_Iterations.py.

◆ Consider_Modes

list CG_Iterations.Consider_Modes = [80]

Definition at line 136 of file CG_Iterations.py.

◆ Data_2_P

list CG_Iterations.Data_2_P = []

Definition at line 703 of file CG_Iterations.py.

◆ Data_2_V_1

list CG_Iterations.Data_2_V_1 = []

Definition at line 704 of file CG_Iterations.py.

◆ Data_2_V_2

list CG_Iterations.Data_2_V_2 = []

Definition at line 705 of file CG_Iterations.py.

◆ Data_2_V_3

list CG_Iterations.Data_2_V_3 = []

Definition at line 706 of file CG_Iterations.py.

◆ data_mean

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

Definition at line 396 of file CG_Iterations.py.

◆ Data_P

list CG_Iterations.Data_P = []

Definition at line 404 of file CG_Iterations.py.

◆ data_std_dev

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

Definition at line 397 of file CG_Iterations.py.

◆ Data_V_1

list CG_Iterations.Data_V_1 = []

Definition at line 405 of file CG_Iterations.py.

◆ Data_V_2

list CG_Iterations.Data_V_2 = []

Definition at line 406 of file CG_Iterations.py.

◆ Data_V_3

list CG_Iterations.Data_V_3 = []

Definition at line 407 of file CG_Iterations.py.

◆ data_var

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

Definition at line 398 of file CG_Iterations.py.

◆ Error

bool CG_Iterations.Error = True

Definition at line 683 of file CG_Iterations.py.

◆ fig

CG_Iterations.fig

Definition at line 316 of file CG_Iterations.py.

◆ Input_Nektar_Max

CG_Iterations.Input_Nektar_Max

Definition at line 161 of file CG_Iterations.py.

◆ key_P

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

Definition at line 248 of file CG_Iterations.py.

◆ key_V_1

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

Definition at line 249 of file CG_Iterations.py.

◆ key_V_2

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

Definition at line 250 of file CG_Iterations.py.

◆ key_V_3

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

Definition at line 251 of file CG_Iterations.py.

◆ label

CG_Iterations.label

◆ loc

CG_Iterations.loc

Definition at line 323 of file CG_Iterations.py.

Referenced by Nektar::MultiRegions::AssemblyMap.Assemble(), Nektar::MultiRegions::AssemblyMap.AssembleBnd(), Nektar::SolverUtils::EquationSystem.Checkpoint_Output(), Nektar::FieldUtils::Iso.GetX(), Nektar::FieldUtils::Iso.GetY(), Nektar::FieldUtils::Iso.GetZ(), Nektar::MultiRegions::AssemblyMap.GlobalToLocal(), Nektar::MultiRegions::AssemblyMap.GlobalToLocalBnd(), Nektar::MultiRegions::AssemblyMap.GlobalToLocalBndWithoutSign(), Nektar::LibUtilities::FieldIOHdf5.ImportFieldDef(), Nektar::LibUtilities::FieldIOXml.ImportFieldDefs(), Nektar::LibUtilities::Comm.Irecv(), Nektar::LibUtilities::Comm.Irsend(), Nektar::LibUtilities::Comm.Isend(), Nektar::MultiRegions::AssemblyMap.LocalBndToGlobal(), Nektar::MultiRegions::AssemblyMap.LocalToGlobal(), Nektar::FieldUtils.MappingIdealToRef(), Nektar::FieldUtils::Octree::Octant.Octant(), Nektar::MultiRegions::AssemblyMap.PatchAssemble(), Nektar::MultiRegions::AssemblyMap.PatchGlobalToLocal(), Nektar::MultiRegions::AssemblyMap.PatchLocalToGlobal(), Nektar::FieldUtils::Octree.QueryNode(), Nektar::LibUtilities::Comm.RecvInit(), Nektar::LibUtilities::Comm.SendInit(), Nektar::FieldUtils::Iso.SetFields(), Nektar::FieldUtils::Iso.SetX(), Nektar::FieldUtils::Iso.SetY(), Nektar::FieldUtils::Iso.SetZ(), Nektar::MultiRegions::AssemblyMapCG.v_Assemble(), Nektar::MultiRegions::AssemblyMapDG.v_Assemble(), Nektar::MultiRegions::PreconditionerLowEnergy.v_BuildPreconditioner(), Nektar::MultiRegions::AssemblyMapCG.v_GlobalToLocal(), Nektar::MultiRegions::AssemblyMapDG.v_GlobalToLocal(), Nektar::MultiRegions::PreconditionerLinearWithLowEnergy.v_InitObject(), Nektar::LibUtilities::CommMpi.v_Irecv(), Nektar::LibUtilities::CommMpi.v_Irsend(), Nektar::LibUtilities::CommMpi.v_Isend(), Nektar::MultiRegions::AssemblyMapCG.v_LocalToGlobal(), Nektar::MultiRegions::AssemblyMapDG.v_LocalToGlobal(), Nektar::LibUtilities::CommMpi.v_RecvInit(), and Nektar::LibUtilities::CommMpi.v_SendInit().

◆ Loc_Parallel_Timing_Files

CG_Iterations.Loc_Parallel_Timing_Files

Definition at line 161 of file CG_Iterations.py.

◆ Loc_Serial_Timing_Files

CG_Iterations.Loc_Serial_Timing_Files

Definition at line 161 of file CG_Iterations.py.

◆ max_modes

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

Definition at line 377 of file CG_Iterations.py.

◆ Max_N_Z

string CG_Iterations.Max_N_Z = 'output_72.txt'

Definition at line 127 of file CG_Iterations.py.

◆ Max_Pressure_CG

list CG_Iterations.Max_Pressure_CG = []

Definition at line 214 of file CG_Iterations.py.

◆ Max_Velocity_1_CG

list CG_Iterations.Max_Velocity_1_CG = []

Definition at line 215 of file CG_Iterations.py.

◆ Max_Velocity_2_CG

list CG_Iterations.Max_Velocity_2_CG = []

Definition at line 216 of file CG_Iterations.py.

◆ Max_Velocity_3_CG

list CG_Iterations.Max_Velocity_3_CG = []

Definition at line 217 of file CG_Iterations.py.

◆ Mesh

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

Definition at line 124 of file CG_Iterations.py.

Referenced by main().

◆ Mesh_File

CG_Iterations.Mesh_File

Definition at line 161 of file CG_Iterations.py.

◆ Min_Pressure_CG

list CG_Iterations.Min_Pressure_CG = []

Definition at line 219 of file CG_Iterations.py.

◆ Min_Velocity_1_CG

list CG_Iterations.Min_Velocity_1_CG = []

Definition at line 220 of file CG_Iterations.py.

◆ Min_Velocity_2_CG

list CG_Iterations.Min_Velocity_2_CG = []

Definition at line 221 of file CG_Iterations.py.

◆ Min_Velocity_3_CG

list CG_Iterations.Min_Velocity_3_CG = []

Definition at line 222 of file CG_Iterations.py.

◆ modes

list CG_Iterations.modes = []

◆ MPI_Benchmark

CG_Iterations.MPI_Benchmark

Definition at line 161 of file CG_Iterations.py.

◆ Nektar_Modes

CG_Iterations.Nektar_Modes

Definition at line 201 of file CG_Iterations.py.

◆ Node_Map

CG_Iterations.Node_Map

Definition at line 161 of file CG_Iterations.py.

◆ Num_Constants

int CG_Iterations.Num_Constants = 2

Definition at line 139 of file CG_Iterations.py.

◆ Num_Node

int CG_Iterations.Num_Node = 1

Definition at line 155 of file CG_Iterations.py.

◆ output_path

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

Definition at line 167 of file CG_Iterations.py.

◆ Parallel

bool CG_Iterations.Parallel = True

Definition at line 146 of file CG_Iterations.py.

◆ Parallelisation

string CG_Iterations.Parallelisation = 'Hybrid_Socket'

Definition at line 149 of file CG_Iterations.py.

◆ Pressure

list CG_Iterations.Pressure = []

Definition at line 204 of file CG_Iterations.py.

◆ pressure

CG_Iterations.pressure

◆ Pressure_Key

list CG_Iterations.Pressure_Key = []

Definition at line 209 of file CG_Iterations.py.

◆ process

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

Definition at line 170 of file CG_Iterations.py.

◆ savefile

string CG_Iterations.savefile = 'Output/Figures/Max_Min_CG/Min_CG' + '_' + str(Nektar_Modes[i]) + '.png'

◆ Scheme

string CG_Iterations.Scheme = 'IterativeStaticCond'

Definition at line 133 of file CG_Iterations.py.

◆ Settling_Deviation_P

CG_Iterations.Settling_Deviation_P = []

Definition at line 675 of file CG_Iterations.py.

◆ Settling_Deviation_V_1

CG_Iterations.Settling_Deviation_V_1 = []

Definition at line 676 of file CG_Iterations.py.

◆ Settling_Deviation_V_2

CG_Iterations.Settling_Deviation_V_2 = []

Definition at line 677 of file CG_Iterations.py.

◆ Settling_Deviation_V_3

CG_Iterations.Settling_Deviation_V_3 = []

Definition at line 678 of file CG_Iterations.py.

◆ Settling_Time

list CG_Iterations.Settling_Time = []

Definition at line 680 of file CG_Iterations.py.

◆ Skip_Steps

int CG_Iterations.Skip_Steps = 20

Definition at line 225 of file CG_Iterations.py.

◆ Timing_Files

CG_Iterations.Timing_Files

Definition at line 201 of file CG_Iterations.py.

◆ title

string CG_Iterations.title = 'Minimum CG Iterations: ' + 'Planes = ' + str(Nektar_Modes[i])

◆ Velocity_1

list CG_Iterations.Velocity_1 = []

Definition at line 205 of file CG_Iterations.py.

◆ velocity_1

CG_Iterations.velocity_1

Definition at line 229 of file CG_Iterations.py.

◆ Velocity_1_Key

list CG_Iterations.Velocity_1_Key = []

Definition at line 210 of file CG_Iterations.py.

◆ Velocity_2

list CG_Iterations.Velocity_2 = []

Definition at line 206 of file CG_Iterations.py.

◆ velocity_2

CG_Iterations.velocity_2

Definition at line 229 of file CG_Iterations.py.

◆ Velocity_2_Key

list CG_Iterations.Velocity_2_Key = []

Definition at line 211 of file CG_Iterations.py.

◆ Velocity_3

list CG_Iterations.Velocity_3 = []

Definition at line 207 of file CG_Iterations.py.

◆ velocity_3

CG_Iterations.velocity_3

Definition at line 229 of file CG_Iterations.py.

◆ Velocity_3_Key

list CG_Iterations.Velocity_3_Key = []

Definition at line 212 of file CG_Iterations.py.