Skip to content

Commit

Permalink
Reintroduced source fields into Data Definitions (#932)
Browse files Browse the repository at this point in the history
* Reintroduced source fields into Data Definitions

* Updated stable to match previous commit
  • Loading branch information
elwazana authored and JacquesCarette committed Jul 23, 2018
1 parent df9f936 commit 9e640a0
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 107 deletions.
7 changes: 5 additions & 2 deletions code/drasil-data/Data/Drasil/Citations.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Data.Drasil.Citations (koothoor2013, parnasClements1986, smithLai2005, jnlCGJ
module Data.Drasil.Citations (campidelli, koothoor2013, parnasClements1986, smithLai2005, jnlCGJ
) where

import Language.Drasil --(S,(:+:),(+:+),sC,phrase,F,Accent(..),Citation(..),CiteField(..))
import Data.Drasil.People (dParnas, jRalyte, lLai, nKoothoor, nKraiem,
pcClements, pjAgerfalk, spencerSmith)
pcClements, pjAgerfalk, spencerSmith, mCampidelli)
import Data.Drasil.Software.Products (sciCompS)

---------------
Expand All @@ -12,6 +12,9 @@ import Data.Drasil.Software.Products (sciCompS)

koothoor2013, parnasClements1986, smithLai2005 :: Citation

campidelli = cBooklet "campidelli"
(S "Glass-BR Software for the design and risk assessment of glass facades subjected to blast loading") [author [mCampidelli]]

koothoor2013 =
cMThesis "koothoor2013" [nKoothoor]
(S "A document drive approach to certifying" +:+ phrase sciCompS)
Expand Down
4 changes: 2 additions & 2 deletions code/drasil-docLang/Drasil/DocumentLanguage/Definitions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ mkQField d _ l@DefiningEquation fs = (show l, (eqUnR $ sy d $= d ^. equat):[]) :
mkQField d m l@(Description v u) fs =
(show l, buildDDescription v u d m) : fs
mkQField _ _ l@(RefBy) fs = (show l, fixme) : fs --FIXME: fill this in
mkQField _ _ l@(Source) fs = (show l, fixme) : fs
mkQField d _ l@(Source) fs = (show l, [Paragraph $ getSource d]) : fs
mkQField d _ l@(Notes) fs = maybe fs (\ss -> (show l, map Paragraph ss) : fs) (d ^. getNotes)
mkQField _ _ label _ = error $ "Label " ++ show label ++ " not supported " ++
"for data definitions"
Expand All @@ -122,7 +122,7 @@ mkDDField d _ l@DefiningEquation fs = (show l, (eqUnR $ sy d $= d ^. relat):[])
mkDDField d m l@(Description v u) fs =
(show l, buildDDescription' v u d m) : fs
mkDDField _ _ l@(RefBy) fs = (show l, fixme) : fs --FIXME: fill this in
mkDDField _ _ l@(Source) fs = (show l, fixme) : fs
mkDDField d _ l@(Source) fs = (show l, [Paragraph $ getSource d]) : fs
mkDDField d _ l@(Notes) fs = maybe fs (\ss -> (show l, map Paragraph ss) : fs) (d ^. getNotes)
mkDDField _ _ label _ = error $ "Label " ++ show label ++ " not supported " ++
"for data definitions"
Expand Down
14 changes: 10 additions & 4 deletions code/drasil-example/Drasil/GlassBR/DataDefs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ module Drasil.GlassBR.DataDefs (aspRat, dataDefns, dimLL, gbQDefns, glaTyFac,

import Language.Drasil
import Prelude hiding (log, exp, sqrt)
import Drasil.DocLang (refA)

import Drasil.GlassBR.Unitals (actualThicknesses, aspectR,
demand, dimlessLoad, gTF, glassTypeAbbrsStr, glassTypeFactors, glass_type,
lDurFac, load_dur, mod_elas, nom_thick, nominalThicknesses, nonFactorL, pb_tol,
plate_len, plate_width, risk_fun, sdf_tol, sdx, sdy, sdz, standOffDist, sflawParamK,
sflawParamM, stressDistFac, tolLoad, min_thick)
import Drasil.GlassBR.Assumptions (gbRefDB, newA5)

import Data.Drasil.Concepts.Documentation (datum, user)
import Data.Drasil.Concepts.Math (probability, parameter, calculation)
Expand All @@ -33,15 +35,16 @@ gbQDefns = [Parallel hFromt {-DD2-} [glaTyFac {-DD6-}]] ++ --can be calculated o
risk_eq :: Expr
risk_eq = ((sy sflawParamK) /
((sy plate_len) * (sy plate_width)) $^ ((sy sflawParamM) - 1) *
(1000 * sy mod_elas * (square $ sy min_thick)) $^ (sy sflawParamM)
(sy mod_elas * (square $ sy min_thick)) $^ (sy sflawParamM)
* (sy lDurFac) * (exp (sy stressDistFac)))

-- FIXME [4] !!!
risk :: QDefinition
risk = mkDataDef risk_fun risk_eq

riskDD :: DataDefinition
riskDD = mkDD risk [sourceref $ S "[4]"] [{-derivation-}] ""{-temporary-}
riskDD = mkDD risk [(sourceref (S "[4]")), (sourceref (S "[5, Eq. 14]"))]
[{-derivation-}] ""{-temporary-}
(Just $ aGrtrThanB : hRef : ldfRef : jRef : [])

--DD2--
Expand Down Expand Up @@ -124,8 +127,8 @@ dimLL :: QDefinition
dimLL = mkDataDef dimlessLoad dimLL_eq

dimLLDD :: DataDefinition
dimLLDD = mkDD dimLL [{-references-}] [{-derivation-}] ""--temporary
(Just $ qRef : aGrtrThanB : hRef : gtfRef : [])
dimLLDD = mkDD dimLL [sourceref $ S "[5, Eq. 7]"] [{-derivation-}] ""--temporary
(Just $ qRef : aGrtrThanB : hRef : gtfRef : a5Ref : [])

--DD8--

Expand Down Expand Up @@ -236,3 +239,6 @@ jRef2 = (ch stressDistFac +:+ S "is the" +:+ phrase stressDistFac `sC`

jtolRelToPbtol :: Sentence
jtolRelToPbtol = (ch sdf_tol +:+ S " is calculated with reference to " +:+. ch pb_tol)

a5Ref :: Sentence
a5Ref = (ch dimlessLoad +:+ S "is calculated with reference to" +:+. (refA gbRefDB newA5))
6 changes: 3 additions & 3 deletions code/drasil-example/Drasil/GlassBR/References.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ module Drasil.GlassBR.References where

import Language.Drasil

import Data.Drasil.Citations (koothoor2013, smithLai2005, parnasClements1986)
import Data.Drasil.Citations (campidelli, koothoor2013, smithLai2005, parnasClements1986)
import Data.Drasil.People (jRobertson, jmBracci, sRobertson, tlKohutek, wlBeason)

rbrtsn2012, astm2009, astm2016, astm2012, beasonEtAl1998 :: Citation

gbCitations :: BibRef
gbCitations = [koothoor2013, smithLai2005, rbrtsn2012, astm2009, astm2016,
gbCitations = [campidelli, koothoor2013, smithLai2005, rbrtsn2012, astm2009, astm2016,
astm2012, beasonEtAl1998, parnasClements1986]

rbrtsn2012 = cMisc "rbrtsn2012" [author [jRobertson, sRobertson], title
Expand Down Expand Up @@ -42,4 +42,4 @@ beasonEtAl1998 = cMisc "beasonEtAl1998"
title (S "Basis for ASTME E 1300 Annealed Glass Thickness Selection Charts"),
bookTitle (S "ASCE Library"),
month Feb, year 1998,
howPublishedU (S "doi.org/10.1061/(ASCE)0733-9445(1998)124:2(215)")]
howPublishedU (S "doi.org/10.1061/(ASCE)0733-9445(1998)124:2(215)")]
16 changes: 8 additions & 8 deletions code/stable/gamephys/SRS/Chipmunk_SRS.tex
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ \subsubsection{Data Definitions}
\item{$M$ is the total mass of the rigid body (kg)}
\end{symbDescription}
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -659,7 +659,7 @@ \subsubsection{Data Definitions}
\item{$\mathbf{p}$ is the position (m)}
\end{symbDescription}
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -687,7 +687,7 @@ \subsubsection{Data Definitions}
\item{$\mathbf{r}$ is the displacement (m)}
\end{symbDescription}
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -715,7 +715,7 @@ \subsubsection{Data Definitions}
\item{$\mathbf{v}$ is the velocity ($\frac{\text{m}}{\text{s}}$)}
\end{symbDescription}
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -743,7 +743,7 @@ \subsubsection{Data Definitions}
\item{$ϕ$ is the orientation (rad)}
\end{symbDescription}
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -771,7 +771,7 @@ \subsubsection{Data Definitions}
\item{$θ$ is the angular displacement (rad)}
\end{symbDescription}
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -799,7 +799,7 @@ \subsubsection{Data Definitions}
\item{$ω$ is the angular velocity ($\frac{\text{rad}}{\text{s}}$)}
\end{symbDescription}
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -835,7 +835,7 @@ \subsubsection{Data Definitions}
\item{${\mathbf{I}_{B}}$ is the moment of inertia of rigid body B (kg$\text{m}^{2}$)}
\end{symbDescription}
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down
16 changes: 8 additions & 8 deletions code/stable/gamephys/Website/Chipmunk_SRS.html
Original file line number Diff line number Diff line change
Expand Up @@ -2061,7 +2061,7 @@ <h3>
</th>
<td>
<p class="paragraph">
FIXME: This needs to be filled in

</p>
</td>
</tr>
Expand Down Expand Up @@ -2152,7 +2152,7 @@ <h3>
</th>
<td>
<p class="paragraph">
FIXME: This needs to be filled in

</p>
</td>
</tr>
Expand Down Expand Up @@ -2243,7 +2243,7 @@ <h3>
</th>
<td>
<p class="paragraph">
FIXME: This needs to be filled in

</p>
</td>
</tr>
Expand Down Expand Up @@ -2334,7 +2334,7 @@ <h3>
</th>
<td>
<p class="paragraph">
FIXME: This needs to be filled in

</p>
</td>
</tr>
Expand Down Expand Up @@ -2425,7 +2425,7 @@ <h3>
</th>
<td>
<p class="paragraph">
FIXME: This needs to be filled in

</p>
</td>
</tr>
Expand Down Expand Up @@ -2516,7 +2516,7 @@ <h3>
</th>
<td>
<p class="paragraph">
FIXME: This needs to be filled in

</p>
</td>
</tr>
Expand Down Expand Up @@ -2607,7 +2607,7 @@ <h3>
</th>
<td>
<p class="paragraph">
FIXME: This needs to be filled in

</p>
</td>
</tr>
Expand Down Expand Up @@ -2750,7 +2750,7 @@ <h3>
</th>
<td>
<p class="paragraph">
FIXME: This needs to be filled in

</p>
</td>
</tr>
Expand Down
29 changes: 17 additions & 12 deletions code/stable/glassbr/SRS/GlassBR_SRS.tex
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ \subsubsection{Data Definitions}
Units & Unitless
\\ \midrule \\
Equation & \begin{dmath}
B=\frac{k}{\left(a b\right)^{m-1}} \left(1000 E h^{2}\right)^{m} LDF e^{J}
B=\frac{k}{\left(a b\right)^{m-1}} \left(E h^{2}\right)^{m} LDF e^{J}
\end{dmath}
\\ \midrule \\
Description & \begin{symbDescription}
Expand All @@ -443,7 +443,7 @@ \subsubsection{Data Definitions}
$LDF$ is the load duration factor as defined by DD3.
$J$ is the stress distribution factor (Function) , as defined in DD4.
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source & [4] [5, Eq. 14]
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -485,7 +485,7 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Notes & $t$ is a function that maps from the nominal thickness ($h$) to the minimum thickness.
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -513,7 +513,7 @@ \subsubsection{Data Definitions}
\item{$m$ is the surface flaw parameter ($\frac{\text{m}^{12}}{\text{N}^{7}}$)}
\end{symbDescription}
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -546,7 +546,7 @@ \subsubsection{Data Definitions}
$\hat{q}$ is the dimensionless load defined in DD7.
$AR$ is the aspect ratio defined in DD11.
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -581,7 +581,7 @@ \subsubsection{Data Definitions}
$h$ is the minimum thickness, which is based on the nominal thicknesses as shown in DD2.
${\hat{q}_{tol}}$ is the tolerable load defined in DD8.
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -612,7 +612,7 @@ \subsubsection{Data Definitions}
\item{$g$ is the glass type $g\in{}\{AN,FT,HS\}$ (Unitless)}
\end{symbDescription}
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -648,8 +648,9 @@ \subsubsection{Data Definitions}
$a$, $b$ are dimensions of the plate, where ($a>b$).
$h$ is the minimum thickness, which is based on the nominal thicknesses as shown in DD2.
$GTF$ is the glass type factor, as given by DD6.
$\hat{q}$ is calculated with reference to A\ref{A:glassLiteA}.
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source & [5, Eq. 7]
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -681,7 +682,7 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Notes & ${\hat{q}_{tol}}$ is the tolerable load which is obtained from Figure 7 using ${J_{tol}}$ and aspect ratio as parameters using interpolation. Calculations of ${J_{tol}}$ and $AR$ are defined in DD9 and DD11, respectively.
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -721,7 +722,7 @@ \subsubsection{Data Definitions}
$LDF$ is the load duration factor as defined by DD3.
${P_{btol}}$ is the tolerable probability entered by the user.
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -750,7 +751,7 @@ \subsubsection{Data Definitions}
\item{${SD_{z}}$ is the stand off distance (z-component) (m)}
\end{symbDescription}
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -780,7 +781,7 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Notes & $a$, $b$ are dimensions of the plate, where ($a>b$).
\\ \midrule \\
Source & FIXME: This needs to be filled in
Source &
\\ \midrule \\
RefBy & FIXME: This needs to be filled in
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -1247,6 +1248,10 @@ \section{References}
year={1998},
howpublished={\url{doi.org/10.1061/(ASCE)0733-9445(1998)124:2(215)}}}

@booklet{campidelli,
title={Glass-BR Software for the design and risk assessment of glass facades subjected to blast loading},
author={Campidelli, Manuel}}

@mastersthesis{koothoor2013,
author={Koothoor, Nirmitha},
title={A document drive approach to certifying scientific computing software},
Expand Down
Loading

0 comments on commit 9e640a0

Please sign in to comment.