Hi Jia,
Example 2 uses the MDOF_LU tool to generate an idealized finite element model for each building and obtain the peak floor acceleration (PFA) and peak interstory drift ratio (PID) at each floor. The tool was developed by Prof. Xinzheng Lu's research group.
The capabilities are described to some extent in the appendix of this publication:
http://dx.doi.org/10.1016/j.advengsoft.2014.01.010 .
You can also take a look at the source code here:
https://github.com/NHERI-SimCenter/SimCenterBackendApplications/tree/master/modules/createSAM/MDOF-LUMost assumptions are coded into the Building.cpp and HazusSAM_Generator.cpp files.
Now, to answer your specific questions:
1, Take a look at the CalcBldgPara function in HazusSAM_Generator.cpp. The four code levels are enumerated as integers ranging from 0 to 3 and you'll see how the Zone, Year of Construction, and Structure Type are used to obtain the design level. The developers aimed to implement the logic presented in the Hazus Earthquake Model; please let us know if you experience any errors in their implementation.
2, The damage is stored in the DM_*.csv file (where * is replaced by the range of building IDs). Example 2 uses the fragility functions from the Hazus Earthquake Model to simulate damages; this yields Damage States ranging from 0 to 4. 0 corresponds to no damage, while 1-2-3-4 corresponds to slight, moderate, extensive, and complete, just like you described in your question. Damage state 4 has two mutually exclusive sub-states (see some clarification on this in the end*), complete damage and collapse. Following the Hazus methodology, complete damage does not yield injuries, while collapse results in injuries and fatalities. Complete damage is encoded as DS 4_1, while collapse is encoded as DS 4_2.
You shall see the likelihood of observing each damage state in the structural and non-structural components of each building. If you are looking for each damage realization, you'll need to check the "Output EDP, DM, DV, every sampling realization" in the General Information (GI) panel of R2D (see here:
https://nheri-simcenter.github.io/R2D-Documentation/common/user_manual/usage/desktop/R2DTool/GI.html). Afterward, you'll see a realizations.hdf5 file among the results that provides a specific damage state for each realization for each building. Let me know if you need more information on how to extract the information from this file.
3, PID in the EDP file refers to Peak Interstory Drift Ratio. As far as I can tell, this is in line with the PBE tool training video and has no unit.
Let me know if you have further questions.
Adam
* Additional information on mutually exclusive damage states:
Currently, R2D uses Pelicun 2.6 to simulate damage and loss. This earlier version of Pelicun followed the FEMA P-58 naming convention and assigned Damage State Groups (DSG) to fragility functions and each DSG could have one or more Damage States in it. This led to the DS_X_Y type of identification where X refers to the DSG and Y refers to the DS.
For the sake of clarity, with Pelicun 3, I updated this naming convention using Limit States instead of DSG. So, the results of an analysis performed by Pelicun 3 will show LS_X to identify the limit states or DS_Y to identify the damage states. I wanted to mention this detail here because Pelicun 3 will be available in R2D this April and it will completely replace Pelicun 2.6 in the near future.