HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
Loading...
Searching...
No Matches
Functions
convergence_analyzer Namespace Reference

Functions

 parse_simulation_file (filename)
 
 compute_energy_norm (data)
 
 calculate_convergence_rate (mesh_sizes, errors)
 
 create_convergence_plots (data_by_degree)
 
 generate_latex_document (data_by_degree)
 
 main ()
 

Detailed Description

Simple Convergence Rate Analyzer for HHO-NSA Simulation Data

This script analyzes convergence rates from simulation output files and generates
publication-quality plots with LaTeX styling - ALL ON ONE GRAPH.

Usage:
    python3 convergence_analyzer.py timehistory_linear_k*_mesh*.txt

Function Documentation

◆ calculate_convergence_rate()

convergence_analyzer.calculate_convergence_rate (   mesh_sizes,
  errors 
)
Calculate convergence rate using least squares fit.

◆ compute_energy_norm()

convergence_analyzer.compute_energy_norm (   data)
Compute the energy norm using the specified formula:
energy_norm^2 = L2_density_err_N^2 + L2_velocity_err_N^2 + 
                time_step * sum_{n=0}^{N-1} upw_density_err_{n+1}^2 + 
                (time_step * viscosity/2) * sum_{n=0}^{N-1} H1_velocity_err_{n+1}^2

Parameters:
data (dict): Dictionary containing time history and parameters

Returns:
float: Energy norm value

◆ create_convergence_plots()

convergence_analyzer.create_convergence_plots (   data_by_degree)
Create a single convergence plot with all degrees and error types.

◆ generate_latex_document()

convergence_analyzer.generate_latex_document (   data_by_degree)
Generate a LaTeX document with a single pgfplot showing all curves.

◆ main()

convergence_analyzer.main ( )
Main function: parse files and generate convergence analysis.

◆ parse_simulation_file()

convergence_analyzer.parse_simulation_file (   filename)
Extract convergence data from a single simulation output file.