C++ CodeSample Programming Codes

Liquefaction Triggering Analysis – C++ Code

 

This C++ code performs liquefaction triggering analysis per Youd et al. (2001) and Boulanger and Idriss (2014) approaches. The input for the code is CPT data in the format of “.txt”. The input text file should contain depth (ft) in column 1, uncorrected cone resistance (tsf) in column 2, sleeve friction (tsf) in column 3, and pore pressure (psi) in column 4. The data must start from the first line without any header. The output file name is defined by the user and the current version includes depth, correct cone resistance (q_t), sleeve friction (fs), q_{c1N,cs}, I_c, CRR, CSR, and safety factor.

Note that the code is object-oriented and includes three independent classes:

  • class “basicIntrep”: this class gets input values from user, reads input CPT file (in text format), calculates Ic per Robertson and Wride (1998), and lastly creates output file.
  • class “B&I(2014)”: this class calculates CSR, CRR, and safety factor against liquefaction per the approach of Boulanger and Idriss (2014).
  • class “Youd_et_al_2001”: this class calculates CSR, CRR, and safety factor against liquefaction per the approach of Youd et al. (2001).

You can download the .cpp and .hpp files here:  Liquefaction-Triggering-Analysis.zip

A sample main file is also included to clarify how to properly use the classes and functions. Please also note that the code has been verified by comparing results against the results of CLiq software. However, it is highly recommended that you carry out your own verification.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Leave a Reply

Your email address will not be published. Required fields are marked *