diff --git a/code/drasil-code/lib/Language/Drasil/Code/Imperative/Modules.hs b/code/drasil-code/lib/Language/Drasil/Code/Imperative/Modules.hs index 856ebabbb1e..62c73f12e84 100644 --- a/code/drasil-code/lib/Language/Drasil/Code/Imperative/Modules.hs +++ b/code/drasil-code/lib/Language/Drasil/Code/Imperative/Modules.hs @@ -51,7 +51,7 @@ import Language.Drasil.Choices (Comments(..), ConstantStructure(..), Logging(..), Structure(..), hasSampleInput, InternalConcept(..)) import Language.Drasil.CodeSpec (HasOldCodeSpec(..)) import Language.Drasil.Expr.Development (Completeness(..)) -import Language.Drasil.Printers (SingleLine(OneLine), codeExprDoc, showHasSymbImpl, PrintingInformation) +import Language.Drasil.Printers (SingleLine(OneLine), showHasSymbImpl, PrintingInformation) import Drasil.GOOL (MSBody, MSBlock, SVariable, SValue, MSStatement, SMethod, CSStateVar, SClass, SharedProg, OOProg, BodySym(..), bodyStatements, @@ -63,7 +63,7 @@ import Drasil.GOOL (MSBody, MSBlock, SVariable, SValue, MSStatement, VisibilitySym(..), MethodSym(..), StateVarSym(..), pubDVar, convType, convTypeOO, VisibilityTag(..)) -import qualified Drasil.GOOL as OO (SFile) +import qualified Drasil.GOOL as OO (SFile, SValue) import Drasil.GProc (ProcProg) import qualified Drasil.GProc as Proc (SFile) @@ -419,15 +419,15 @@ printConstraint v c = do printConstraint' _ (Range _ (Bounded (_, e1) (_, e2))) = do lb <- convExpr e1 ub <- convExpr e2 - return $ [printStr "between ", print lb] ++ printExpr e1 db ++ - [printStr " and ", print ub] ++ printExpr e2 db ++ [printStrLn "."] + return $ [printStr "between "] ++ printExpr lb db ++ + [printStr " and "] ++ printExpr ub db ++ [printStrLn "."] printConstraint' _ (Range _ (UpTo (_, e))) = do ub <- convExpr e - return $ [printStr "below ", print ub] ++ printExpr e db ++ + return $ [printStr "below "] ++ printExpr ub db ++ [printStrLn "."] printConstraint' _ (Range _ (UpFrom (_, e))) = do lb <- convExpr e - return $ [printStr "above ", print lb] ++ printExpr e db ++ [printStrLn "."] + return $ [printStr "above "] ++ printExpr lb db ++ [printStrLn "."] printConstraint' name (Elem _ e) = do lb <- convExpr (Variable ("set_" ++ name) e) return $ [printStr "an element of the set ", print lb] ++ [printStrLn "."] @@ -437,9 +437,8 @@ printConstraint v c = do -- | Don't print expressions that are just literals, because that would be -- redundant (the values are already printed by printConstraint). -- If expression is more than just a literal, print it in parentheses. -printExpr :: (SharedProg r) => CodeExpr -> PrintingInformation -> [MSStatement r] -printExpr Lit{} _ = [] -printExpr e db = [printStr $ " (" ++ render (codeExprDoc db OneLine e) ++ ")"] +printExpr :: (SharedProg r) => OO.SValue r -> PrintingInformation -> [MSStatement r] +printExpr e db = [print e] -- [printStr " (", print e, printStr ")"] -- ++ render (codeExprDoc db OneLine e) ++ ")"] -- | | Generates a function for reading inputs from a file. genInputFormat :: (OOProg r) => VisibilityTag -> @@ -984,15 +983,15 @@ printConstraintProc c = do printConstraint' (Range _ (Bounded (_, e1) (_, e2))) = do lb <- convExprProc e1 ub <- convExprProc e2 - return $ [printStr "between ", print lb] ++ printExpr e1 db ++ - [printStr " and ", print ub] ++ printExpr e2 db ++ [printStrLn "."] + return $ [printStr "between "] ++ printExpr lb db ++ + [printStr " and "] ++ printExpr ub db ++ [printStrLn "."] printConstraint' (Range _ (UpTo (_, e))) = do ub <- convExprProc e - return $ [printStr "below ", print ub] ++ printExpr e db ++ + return $ [printStr "below "] ++ printExpr ub db ++ [printStrLn "."] printConstraint' (Range _ (UpFrom (_, e))) = do lb <- convExprProc e - return $ [printStr "above ", print lb] ++ printExpr e db ++ [printStrLn "."] + return $ [printStr "above "] ++ printExpr lb db ++ [printStrLn "."] printConstraint' (Elem _ e) = do lb <- convExprProc e return $ [printStr "an element of the set ", print lb] ++ [printStrLn "."] diff --git a/code/drasil-lang/lib/Drasil/Code/CodeExpr/Convert.hs b/code/drasil-lang/lib/Drasil/Code/CodeExpr/Convert.hs index f375965c41c..668a6d47b0b 100644 --- a/code/drasil-lang/lib/Drasil/Code/CodeExpr/Convert.hs +++ b/code/drasil-lang/lib/Drasil/Code/CodeExpr/Convert.hs @@ -58,13 +58,10 @@ realInterval (Bounded (il, el) (ir, er)) = Bounded (il, expr el) (ir, expr er) realInterval (UpTo (i, e)) = UpTo (i, expr e) realInterval (UpFrom (i, e)) = UpFrom (i, expr e) -con :: E.Expr -> CodeExpr -con = expr - -- | Convert constrained expressions ('ConstraintE') into 'Constraint''CodeExpr's. constraint :: ConstraintE -> Constraint CodeExpr constraint (Range r ri) = Range r (realInterval ri) -constraint (Elem r ri) = Elem r (con ri) +constraint (Elem r ri) = Elem r (expr ri) -- | Convert 'DomainDesc Expr Expr' into 'DomainDesc CodeExpr CodeExpr's. renderDomainDesc :: DiscreteDomainDesc E.Expr E.Expr -> DiscreteDomainDesc CodeExpr CodeExpr diff --git a/code/drasil-lang/lib/Language/Drasil/Document/Contents.hs b/code/drasil-lang/lib/Language/Drasil/Document/Contents.hs index 873bf2054a6..415a6a7d23c 100644 --- a/code/drasil-lang/lib/Language/Drasil/Document/Contents.hs +++ b/code/drasil-lang/lib/Language/Drasil/Document/Contents.hs @@ -10,24 +10,19 @@ module Language.Drasil.Document.Contents ( unlbldCode ) where -import Drasil.Code.CodeExpr.Lang (CodeExpr) +import Control.Lens ((^.)) + import Language.Drasil.Classes (Definition(..)) import Language.Drasil.ShortName (HasShortName(..), getSentSN) import Language.Drasil.Document (llcc, ulcc) -import Language.Drasil.Document.Core - (LabelledContent, - RawContent(Enumeration, EqnBlock, CodeBlock), - Contents(UlC), - ListTuple, - ItemType(Flat), - ListType(Simple)) +import Language.Drasil.Document.Combinators (bulletFlat, mkEnumAbbrevList) +import Language.Drasil.Document.Core (LabelledContent, RawContent(Enumeration, + EqnBlock, CodeBlock), Contents(UlC), ListTuple, ItemType(Flat), ListType(Simple)) +import Language.Drasil.Expr.Lang (Expr) +import Language.Drasil.Label.Type ( Referable(refAdd) ) import Language.Drasil.ModelExpr.Lang (ModelExpr) import Language.Drasil.Reference (Reference) import Language.Drasil.Sentence (Sentence (..)) -import Language.Drasil.Document.Combinators (bulletFlat, mkEnumAbbrevList) -import Language.Drasil.Label.Type ( Referable(refAdd) ) - -import Control.Lens ((^.)) -- | Displays a given expression and attaches a 'Reference' to it. lbldExpr :: ModelExpr -> Reference -> LabelledContent @@ -38,7 +33,7 @@ unlbldExpr :: ModelExpr -> Contents unlbldExpr c = UlC $ ulcc $ EqnBlock c -- | Unlabelled code expression -unlbldCode :: CodeExpr -> Contents +unlbldCode :: Expr -> Contents unlbldCode c = UlC $ ulcc $ CodeBlock c -- | Creates a bulleted list. diff --git a/code/drasil-lang/lib/Language/Drasil/Document/Core.hs b/code/drasil-lang/lib/Language/Drasil/Document/Core.hs index ab711eba37f..b90a11dc08e 100644 --- a/code/drasil-lang/lib/Language/Drasil/Document/Core.hs +++ b/code/drasil-lang/lib/Language/Drasil/Document/Core.hs @@ -2,9 +2,11 @@ -- | Contains types and functions common to aspects of generating documents. module Language.Drasil.Document.Core where +import Control.Lens ((^.), makeLenses, Lens', set, view) + import Drasil.Database (HasChunkRefs(..), HasUID(..), UID) -import Drasil.Code.CodeExpr.Lang (CodeExpr) +import Language.Drasil.Expr.Lang (Expr) import Language.Drasil.Chunk.Citation (BibRef) import Language.Drasil.ShortName (HasShortName(shortname)) import Language.Drasil.ModelExpr.Lang (ModelExpr) @@ -13,8 +15,6 @@ import Language.Drasil.Label.Type (getAdd, prepend, IRefProg, import Language.Drasil.Reference (Reference) import Language.Drasil.Sentence (Sentence) -import Control.Lens ((^.), makeLenses, Lens', set, view) - -- * Lists -- | Denotes the different possible types that can be used as a list. @@ -78,8 +78,7 @@ data RawContent = -- ^ For creating figures in a document includes whether the figure has a caption. | Bib BibRef -- ^ Grants the ability to reference something. | Graph [(Sentence, Sentence)] (Maybe Width) (Maybe Height) Lbl -- ^ Contain a graph with coordinates ('Sentence's), maybe a width and height, and a label ('Sentence'). - | CodeBlock CodeExpr -- ^ Block for codes - -- TODO: Fill this one in. + | CodeBlock Expr -- ^ Block for codes -- | An identifier is just a 'String'. type Identifier = String diff --git a/code/drasil-printers/lib/Language/Drasil/Plain/Print.hs b/code/drasil-printers/lib/Language/Drasil/Plain/Print.hs index 20f1ad470d5..f8e42c3e01e 100644 --- a/code/drasil-printers/lib/Language/Drasil/Plain/Print.hs +++ b/code/drasil-printers/lib/Language/Drasil/Plain/Print.hs @@ -3,7 +3,7 @@ module Language.Drasil.Plain.Print ( -- * Types SingleLine(..), -- * Functions - exprDoc, codeExprDoc, sentenceDoc, symbolDoc, unitDoc, showSymb, + exprDoc, sentenceDoc, symbolDoc, unitDoc, showSymb, showHasSymbImpl ) where @@ -13,14 +13,13 @@ import Text.PrettyPrint.HughesPJ (Doc, (<>), (<+>), brackets, comma, double, doubleQuotes, empty, hcat, hsep, integer, parens, punctuate, space, text, vcat, render) -import qualified Drasil.Code.CodeExpr.Development as C (CodeExpr) import Language.Drasil (Sentence, Special(..), Stage(..), Symbol, USymb(..)) import qualified Language.Drasil as L (Expr, HasSymbol(..)) import Utils.Drasil (toPlainName) import Language.Drasil.Printing.AST (Expr(..), Spec(..), Ops(..), Fence(..), OverSymb(..), Fonts(..), Spacing(..), LinkType(..)) -import Language.Drasil.Printing.Import (expr, codeExpr, spec, symbol) +import Language.Drasil.Printing.Import (expr, spec, symbol) import Language.Drasil.Printing.PrintingInformation (PrintingInformation) -- | Data is either linear or not. @@ -30,10 +29,6 @@ data SingleLine = OneLine | MultiLine exprDoc :: PrintingInformation -> SingleLine -> L.Expr -> Doc exprDoc pinfo sl e = pExprDoc sl (expr e pinfo) --- | Create code expressions for a document in 'Doc' format. -codeExprDoc :: PrintingInformation -> SingleLine -> C.CodeExpr -> Doc -codeExprDoc pinfo sl e = pExprDoc sl (codeExpr e pinfo) - -- | Create sentences for a document in 'Doc' format. sentenceDoc :: PrintingInformation -> SingleLine -> Sentence -> Doc sentenceDoc pinfo sl s = specDoc sl (spec pinfo s) diff --git a/code/drasil-printers/lib/Language/Drasil/Printers.hs b/code/drasil-printers/lib/Language/Drasil/Printers.hs index d65daf3f331..4a940ff54fb 100644 --- a/code/drasil-printers/lib/Language/Drasil/Printers.hs +++ b/code/drasil-printers/lib/Language/Drasil/Printers.hs @@ -21,7 +21,7 @@ module Language.Drasil.Printers ( -- ** Types , SingleLine(..) -- ** Functions - , sentenceDoc, exprDoc, codeExprDoc, symbolDoc, unitDoc, showSymb, + , sentenceDoc, exprDoc, symbolDoc, unitDoc, showSymb, showHasSymbImpl -- * TeX , genTeX @@ -48,7 +48,7 @@ import Language.Drasil.Markdown.Config (makeBook, makeRequirements) import Language.Drasil.Markdown.CreateMd (makeMd, introInfo, verInfo, unsupOS, extLibSec, instDoc, regularSec, endNote, whatInfo) import Language.Drasil.Plain.Print (SingleLine(..), sentenceDoc, exprDoc, - codeExprDoc, symbolDoc, unitDoc, showSymb, showHasSymbImpl) + symbolDoc, unitDoc, showSymb, showHasSymbImpl) import Language.Drasil.TeX.Print (genTeX) import Language.Drasil.Printing.PrintingInformation (PrintingInformation, HasPrintingOptions(..), Notation(..), piSys, diff --git a/code/drasil-printers/lib/Language/Drasil/Printing/Import.hs b/code/drasil-printers/lib/Language/Drasil/Printing/Import.hs index ffde38a01b5..590bb240bb4 100644 --- a/code/drasil-printers/lib/Language/Drasil/Printing/Import.hs +++ b/code/drasil-printers/lib/Language/Drasil/Printing/Import.hs @@ -1,11 +1,10 @@ -- | Re-export top-level functions for easy use across drasil-printers. module Language.Drasil.Printing.Import ( - expr, codeExpr, literal, modelExpr, + expr, literal, modelExpr, space, spec, symbol, makeDocument, makeProject ) where -import Language.Drasil.Printing.Import.CodeExpr (codeExpr) import Language.Drasil.Printing.Import.Document (makeDocument, makeProject) import Language.Drasil.Printing.Import.Expr (expr) import Language.Drasil.Printing.Import.Literal (literal) diff --git a/code/drasil-printers/lib/Language/Drasil/Printing/Import/CodeExpr.hs b/code/drasil-printers/lib/Language/Drasil/Printing/Import/CodeExpr.hs deleted file mode 100644 index 8ad21dcd58b..00000000000 --- a/code/drasil-printers/lib/Language/Drasil/Printing/Import/CodeExpr.hs +++ /dev/null @@ -1,223 +0,0 @@ -{-# LANGUAGE GADTs #-} - --- | Defines functions to render 'CodeExpr's as printable 'P.Expr's. -module Language.Drasil.Printing.Import.CodeExpr (codeExpr) where - -import Data.List (intersperse) - -import Drasil.Code.CodeExpr.Development - -import Language.Drasil (DomainDesc(..), Inclusive(..), - RTopology(..), RealInterval(..), UID, LiteralC (int)) -import qualified Language.Drasil.Display as S (Symbol(..)) -import Language.Drasil.Literal.Development - -import qualified Language.Drasil.Printing.AST as P -import Language.Drasil.Printing.PrintingInformation (PrintingInformation) -import Language.Drasil.Printing.Import.Helpers (lookupC', parens) -import Language.Drasil.Printing.Import.Literal (literal) -import Language.Drasil.Printing.Import.Symbol (symbol) - --- | Helper that creates an expression row given printing information, an operator, and an expression. -mkCall :: PrintingInformation -> P.Ops -> CodeExpr -> P.Expr -mkCall s o e = P.Row [P.MO o, parens $ codeExpr e s] - --- | Helper that creates a binary expression row given printing information, an operator, and two expressions. -mkBOp :: PrintingInformation -> P.Ops -> CodeExpr -> CodeExpr -> P.Expr -mkBOp sm o a b = P.Row [codeExpr a sm, P.MO o, codeExpr b sm] - --- | Helper that adds parenthesis to an expression where appropriate. -expr' :: PrintingInformation -> Int -> CodeExpr -> P.Expr -expr' s p e = fence $ codeExpr e s - where fence = if eprec e < p then parens else id - --- | Helper for properly rendering negation of expressions. -neg' :: CodeExpr -> Bool -neg' (Lit (Dbl _)) = True -neg' (Lit (Int _)) = True -neg' (Lit (ExactDbl _)) = True -neg' Operator{} = True -neg' (AssocA Mul _) = True -neg' (LABinaryOp Index _ _) = True -neg' (UnaryOp _ _) = True -neg' (UnaryOpB _ _) = True -neg' (UnaryOpVV _ _) = True -neg' (C _) = True -neg' _ = False - --- | Render negated expressions. -neg :: PrintingInformation -> CodeExpr -> P.Expr -neg sm a = P.Row [P.MO P.Neg, (if neg' a then id else parens) $ codeExpr a sm] - --- | For printing indexes. -indx :: PrintingInformation -> CodeExpr -> CodeExpr -> P.Expr -indx sm (C c) i = f s - where - i' = codeExpr i sm - s = lookupC' sm c - f (S.Corners [] [] [] [b] e) = - let e' = symbol e - b' = symbol b in - P.Row [P.Row [e', P.Sub (P.Row [b', P.MO P.Comma, i'])]] -- FIXME, extra Row - f a@(S.Variable _) = P.Row [symbol a, P.Sub i'] - f a@(S.Label _) = P.Row [symbol a, P.Sub i'] --- f a@(Greek _) = P.Row [symbol a, P.Sub i'] - f e = let e' = symbol e in P.Row [P.Row [e'], P.Sub i'] -indx sm a i = P.Row [P.Row [codeExpr a sm], P.Sub $ codeExpr i sm] - --- | For printing expressions that call something. -call :: PrintingInformation -> UID -> [CodeExpr] -> [(UID, CodeExpr)] -> P.Expr -call sm f ps ns = P.Row [symbol $ lookupC' sm f, - parens $ P.Row $ intersperse (P.MO P.Comma) $ map (`codeExpr` sm) ps ++ - zipWith (\n a -> P.Row [symbol $ lookupC' sm n, - P.MO P.Eq, codeExpr a sm]) (map fst ns) (map snd ns)] - --- | Helper function for addition 'EOperator's. -eopAdds :: PrintingInformation -> DomainDesc t CodeExpr CodeExpr -> CodeExpr -> P.Expr -eopAdds sm (BoundedDD v Continuous l h) e = - P.Row [P.MO P.Inte, P.Sub (codeExpr l sm), P.Sup (codeExpr h sm), - P.Row [codeExpr e sm], P.Spc P.Thin, P.Ident "d", symbol v] -eopAdds sm (AllDD v Continuous) e = - P.Row [P.MO P.Inte, P.Sub (symbol v), P.Row [codeExpr e sm], P.Spc P.Thin, - P.Ident "d", symbol v] -eopAdds sm (BoundedDD v Discrete l h) e = - P.Row [P.MO P.Summ, P.Sub (P.Row [symbol v, P.MO P.Eq, codeExpr l sm]), P.Sup (codeExpr h sm), - P.Row [codeExpr e sm]] -eopAdds sm (AllDD _ Discrete) e = P.Row [P.MO P.Summ, P.Row [codeExpr e sm]] - --- | Helper function for multiplicative 'EOperator's. -eopMuls :: PrintingInformation -> DomainDesc t CodeExpr CodeExpr -> CodeExpr -> P.Expr -eopMuls sm (BoundedDD v Discrete l h) e = - P.Row [P.MO P.Prod, P.Sub (P.Row [symbol v, P.MO P.Eq, codeExpr l sm]), P.Sup (codeExpr h sm), - P.Row [codeExpr e sm]] -eopMuls sm (AllDD _ Discrete) e = P.Row [P.MO P.Prod, P.Row [codeExpr e sm]] -eopMuls _ (AllDD _ Continuous) _ = error "Printing/Import.hs Product-Integral not implemented." -eopMuls _ (BoundedDD _ Continuous _ _) _ = error "Printing/Import.hs Product-Integral not implemented." - - --- | Helper function for translating 'EOperator's. -eop :: PrintingInformation -> AssocArithOper -> DomainDesc t CodeExpr CodeExpr -> CodeExpr -> P.Expr -eop sm Add = eopAdds sm -eop sm Mul = eopMuls sm - --- | Translate 'CodeExpr's to printable layout AST 'Expr's. -codeExpr :: CodeExpr -> PrintingInformation -> P.Expr -codeExpr (Lit l) sm = literal l sm -codeExpr (AssocB And l) sm = assocExpr P.And (precB And) l sm -codeExpr (AssocB Or l) sm = assocExpr P.Or (precB Or) l sm -codeExpr (AssocA Add l) sm = P.Row $ addExpr l Add sm -codeExpr (AssocA Mul l) sm = P.Row $ mulExpr l Mul sm -codeExpr (AssocC SUnion l) sm = P.Row $ mulExpr l Mul sm -codeExpr (C c) sm = symbol $ lookupC' sm c -codeExpr (FCall f [x] []) sm = - P.Row [symbol $ lookupC' sm f, parens $ codeExpr x sm] -codeExpr (FCall f l ns) sm = call sm f l ns -codeExpr (New c l ns) sm = call sm c l ns -codeExpr (Message a m l ns) sm = - P.Row [symbol $ lookupC' sm a, P.MO P.Point, call sm m l ns] -codeExpr (Field o f) sm = P.Row [symbol $ lookupC' sm o, - P.MO P.Point, symbol $ lookupC' sm f] -codeExpr (Case _ ps) sm = - if length ps < 2 - then error "Attempting to use multi-case codeExpr incorrectly" - else P.Case (zip (map (flip codeExpr sm . fst) ps) (map (flip codeExpr sm . snd) ps)) -codeExpr (Matrix a) sm = P.Mtx $ map (map (`codeExpr` sm)) a -codeExpr (Set _ a) sm = P.Row $ map (`codeExpr` sm) a -codeExpr (Variable _ l) sm = codeExpr l sm -codeExpr (UnaryOp Log u) sm = mkCall sm P.Log u -codeExpr (UnaryOp Ln u) sm = mkCall sm P.Ln u -codeExpr (UnaryOp Sin u) sm = mkCall sm P.Sin u -codeExpr (UnaryOp Cos u) sm = mkCall sm P.Cos u -codeExpr (UnaryOp Tan u) sm = mkCall sm P.Tan u -codeExpr (UnaryOp Sec u) sm = mkCall sm P.Sec u -codeExpr (UnaryOp Csc u) sm = mkCall sm P.Csc u -codeExpr (UnaryOp Cot u) sm = mkCall sm P.Cot u -codeExpr (UnaryOp Arcsin u) sm = mkCall sm P.Arcsin u -codeExpr (UnaryOp Arccos u) sm = mkCall sm P.Arccos u -codeExpr (UnaryOp Arctan u) sm = mkCall sm P.Arctan u -codeExpr (UnaryOp Exp u) sm = P.Row [P.MO P.Exp, P.Sup $ codeExpr u sm] -codeExpr (UnaryOp Abs u) sm = P.Fenced P.Abs P.Abs $ codeExpr u sm -codeExpr (UnaryOpB Not u) sm = P.Row [P.MO P.Not, codeExpr u sm] -codeExpr (UnaryOpVN Norm u) sm = P.Fenced P.Norm P.Norm $ codeExpr u sm -codeExpr (UnaryOpVN Dim u) sm = mkCall sm P.Dim u -codeExpr (UnaryOp Sqrt u) sm = P.Sqrt $ codeExpr u sm -codeExpr (UnaryOp Neg u) sm = neg sm u -codeExpr (UnaryOpVV NegV u) sm = neg sm u -codeExpr (ArithBinaryOp Frac a b) sm = P.Div (codeExpr a sm) (codeExpr b sm) -codeExpr (ArithBinaryOp Pow a b) sm = pow sm a b -codeExpr (ArithBinaryOp Subt a b) sm = P.Row [codeExpr a sm, P.MO P.Subt, codeExpr b sm] -codeExpr (BoolBinaryOp Impl a b) sm = mkBOp sm P.Impl a b -codeExpr (BoolBinaryOp Iff a b) sm = mkBOp sm P.Iff a b -codeExpr (EqBinaryOp Eq a b) sm = mkBOp sm P.Eq a b -codeExpr (EqBinaryOp NEq a b) sm = mkBOp sm P.NEq a b -codeExpr (LABinaryOp Index a b) sm = indx sm a b -codeExpr (LABinaryOp IndexOf a b) sm = indx sm a b -codeExpr (OrdBinaryOp Lt a b) sm = mkBOp sm P.Lt a b -codeExpr (OrdBinaryOp Gt a b) sm = mkBOp sm P.Gt a b -codeExpr (OrdBinaryOp LEq a b) sm = mkBOp sm P.LEq a b -codeExpr (OrdBinaryOp GEq a b) sm = mkBOp sm P.GEq a b -codeExpr (VVNBinaryOp Dot a b) sm = mkBOp sm P.Dot a b -codeExpr (VVVBinaryOp Cross a b) sm = mkBOp sm P.Cross a b -codeExpr (VVVBinaryOp VAdd a b) sm = mkBOp sm P.VAdd a b -codeExpr (VVVBinaryOp VSub a b) sm = mkBOp sm P.VSub a b -codeExpr (NVVBinaryOp Scale a b) sm = mkBOp sm P.Scale a b -codeExpr (ESSBinaryOp SAdd a b) sm = mkBOp sm P.SAdd a b -codeExpr (ESSBinaryOp SRemove a b) sm = mkBOp sm P.SRemove a b -codeExpr (ESBBinaryOp SContains a b) sm = mkBOp sm P.SContains a b -codeExpr (Operator o d e) sm = eop sm o d e -codeExpr (RealI c ri) sm = renderRealInt sm (lookupC' sm c) ri - --- | Common method of converting associative operations into printable layout AST. -assocExpr :: P.Ops -> Int -> [CodeExpr] -> PrintingInformation -> P.Expr -assocExpr op prec exprs sm = P.Row $ intersperse (P.MO op) $ map (expr' sm prec) exprs - --- | Helper for rendering printable expressions. -addExpr :: [CodeExpr] -> AssocArithOper -> PrintingInformation -> [P.Expr] -addExpr exprs o sm = addExprFilter (map (expr' sm (precA o)) exprs) - --- | Add add symbol only when the second Expr is not negation -addExprFilter :: [P.Expr] -> [P.Expr] -addExprFilter [] = [] -addExprFilter [x] = [x] -addExprFilter (x1:P.Row[P.MO P.Neg, x2]:xs) = x1 : addExprFilter (P.Row[P.MO P.Neg, x2] : xs) -addExprFilter (x:xs) = x : P.MO P.Add : addExprFilter xs - --- | Helper for rendering printable expressions. -mulExpr :: [CodeExpr] -> AssocArithOper -> PrintingInformation -> [P.Expr] -mulExpr (hd1:hd2:tl) o sm = case (hd1, hd2) of - (a, Lit (Int _)) -> [expr' sm (precA o) a, P.MO P.Dot] ++ mulExpr (hd2 : tl) o sm - (a, Lit (ExactDbl _)) -> [expr' sm (precA o) a, P.MO P.Dot] ++ mulExpr (hd2 : tl) o sm - (a, Lit (Dbl _)) -> [expr' sm (precA o) a, P.MO P.Dot] ++ mulExpr (hd2 : tl) o sm - (a, _) -> [expr' sm (precA o) a, P.MO P.Mul] ++ mulExpr (hd2 : tl) o sm -mulExpr [hd] o sm = [expr' sm (precA o) hd] -mulExpr [] o sm = [expr' sm (precA o) (int 1)] - - --- | Helper that adds parenthesis to the first expression. The second expression --- is written as a superscript attached to the first. -withParens :: PrintingInformation -> CodeExpr -> CodeExpr -> P.Expr -withParens prI a b = P.Row [parens (codeExpr a prI), P.Sup (codeExpr b prI)] - --- | Helper for properly rendering exponents. -pow :: PrintingInformation -> CodeExpr -> CodeExpr -> P.Expr -pow prI a@(AssocA Add _) b = withParens prI a b -pow prI a@(AssocA Mul _) b = withParens prI a b -pow prI a@(ArithBinaryOp Subt _ _) b = withParens prI a b -pow prI a@(ArithBinaryOp Frac _ _) b = withParens prI a b -pow prI a@(ArithBinaryOp Pow _ _) b = withParens prI a b -pow prI a b = P.Row [codeExpr a prI, P.Sup (codeExpr b prI)] - --- | Print a 'RealInterval'. -renderRealInt :: PrintingInformation -> S.Symbol -> RealInterval CodeExpr CodeExpr -> P.Expr -renderRealInt st s (Bounded (Inc,a) (Inc,b)) = - P.Row [codeExpr a st, P.MO P.LEq, symbol s, P.MO P.LEq, codeExpr b st] -renderRealInt st s (Bounded (Inc,a) (Exc,b)) = - P.Row [codeExpr a st, P.MO P.LEq, symbol s, P.MO P.Lt, codeExpr b st] -renderRealInt st s (Bounded (Exc,a) (Inc,b)) = - P.Row [codeExpr a st, P.MO P.Lt, symbol s, P.MO P.LEq, codeExpr b st] -renderRealInt st s (Bounded (Exc,a) (Exc,b)) = - P.Row [codeExpr a st, P.MO P.Lt, symbol s, P.MO P.Lt, codeExpr b st] -renderRealInt st s (UpTo (Inc,a)) = P.Row [symbol s, P.MO P.LEq, codeExpr a st] -renderRealInt st s (UpTo (Exc,a)) = P.Row [symbol s, P.MO P.Lt, codeExpr a st] -renderRealInt st s (UpFrom (Inc,a)) = P.Row [symbol s, P.MO P.GEq, codeExpr a st] -renderRealInt st s (UpFrom (Exc,a)) = P.Row [symbol s, P.MO P.Gt, codeExpr a st] diff --git a/code/drasil-printers/lib/Language/Drasil/Printing/Import/Document.hs b/code/drasil-printers/lib/Language/Drasil/Printing/Import/Document.hs index d20253a8f86..0ac1220752f 100644 --- a/code/drasil-printers/lib/Language/Drasil/Printing/Import/Document.hs +++ b/code/drasil-printers/lib/Language/Drasil/Printing/Import/Document.hs @@ -1,23 +1,20 @@ -- | Defines functions to transform Drasil-based documents into a printable version. module Language.Drasil.Printing.Import.Document where +import Control.Lens ((^.)) +import Data.Bifunctor (bimap, second) import Data.Map (fromList) -import Language.Drasil hiding (neg, sec, symbol, isIn, codeExpr) +import Language.Drasil hiding (neg, sec, symbol, isIn) import qualified Language.Drasil.Printing.AST as P import qualified Language.Drasil.Printing.Citation as P import qualified Language.Drasil.Printing.LayoutObj as T -import Language.Drasil.Printing.PrintingInformation - (PrintingInformation) - +import Language.Drasil.Printing.PrintingInformation (PrintingInformation) +import Language.Drasil.Printing.Import.Expr (expr) import Language.Drasil.Printing.Import.ModelExpr (modelExpr) -import Language.Drasil.Printing.Import.CodeExpr (codeExpr) import Language.Drasil.Printing.Import.Sentence (spec) -import Control.Lens ((^.)) -import Data.Bifunctor (bimap, second) - -- * Main Function -- | Translates from 'Document' to a printable representation of 'T.Document'. @@ -155,7 +152,7 @@ layLabelled sm x@(LblC _ _ (DerivBlock h d)) = T.HDiv ["subsubsubsection"] where refr = P.S $ refAdd x ++ "Deriv" layLabelled sm (LblC _ _ (Enumeration cs)) = T.List $ makeL sm cs layLabelled _ (LblC _ _ (Bib bib)) = T.Bib $ map layCite bib -layLabelled sm (LblC _ _ (CodeBlock c)) = T.CodeBlock (P.E (codeExpr c sm)) +layLabelled sm (LblC _ _ (CodeBlock c)) = T.CodeBlock (P.E (expr c sm)) -- | Helper that translates 'RawContent's to a printable representation of 'T.LayoutObj'. -- Called internally by 'lay'. @@ -176,7 +173,7 @@ layUnlabelled sm (Defini dtyp pairs) = T.Definition dtyp (layPairs pairs) (P.S where layPairs = map (second (map temp)) temp y = layUnlabelled sm (y ^. accessContents) layUnlabelled _ (Bib bib) = T.Bib $ map layCite bib -layUnlabelled sm (CodeBlock c) = T.CodeBlock (P.E (codeExpr c sm)) +layUnlabelled sm (CodeBlock c) = T.CodeBlock (P.E (expr c sm)) -- | For importing a bibliography. layCite :: Citation -> P.Citation diff --git a/code/stable/glassbr/src/cpp/InputParameters.cpp b/code/stable/glassbr/src/cpp/InputParameters.cpp index b966eea8feb..ec6557bcf7e 100644 --- a/code/stable/glassbr/src/cpp/InputParameters.cpp +++ b/code/stable/glassbr/src/cpp/InputParameters.cpp @@ -205,10 +205,8 @@ void InputParameters::input_constraints() { std::cout << ", but is expected to be "; std::cout << "between "; std::cout << 0.1; - std::cout << " (d_min)"; std::cout << " and "; std::cout << 5.0; - std::cout << " (d_max)"; std::cout << "." << std::endl; throw("InputError"); } @@ -218,10 +216,8 @@ void InputParameters::input_constraints() { std::cout << ", but is expected to be "; std::cout << "between "; std::cout << 0.1; - std::cout << " (d_min)"; std::cout << " and "; std::cout << 5.0; - std::cout << " (d_max)"; std::cout << "." << std::endl; throw("InputError"); } @@ -231,10 +227,8 @@ void InputParameters::input_constraints() { std::cout << ", but is expected to be "; std::cout << "between "; std::cout << 4.5; - std::cout << " (w_min)"; std::cout << " and "; std::cout << 910.0; - std::cout << " (w_max)"; std::cout << "." << std::endl; throw("InputError"); } @@ -274,10 +268,8 @@ void InputParameters::input_constraints() { std::cout << ", but is expected to be "; std::cout << "between "; std::cout << 6.0; - std::cout << " (SD_min)"; std::cout << " and "; std::cout << 130.0; - std::cout << " (SD_max)"; std::cout << "." << std::endl; throw("InputError"); } @@ -287,7 +279,6 @@ void InputParameters::input_constraints() { std::cout << ", but is expected to be "; std::cout << "below "; std::cout << 5.0; - std::cout << " (AR_max)"; std::cout << "." << std::endl; throw("InputError"); } @@ -307,7 +298,6 @@ void InputParameters::input_constraints() { std::cout << ", but is expected to be "; std::cout << "above "; std::cout << this->b; - std::cout << " (b)"; std::cout << "." << std::endl; throw("InputError"); } @@ -319,7 +309,6 @@ void InputParameters::input_constraints() { std::cout << 0.0; std::cout << " and "; std::cout << this->a; - std::cout << " (a)"; std::cout << "." << std::endl; throw("InputError"); } diff --git a/code/stable/glassbr/src/csharp/InputParameters.cs b/code/stable/glassbr/src/csharp/InputParameters.cs index 9050ad297d3..646bf9387e8 100644 --- a/code/stable/glassbr/src/csharp/InputParameters.cs +++ b/code/stable/glassbr/src/csharp/InputParameters.cs @@ -220,10 +220,8 @@ private void input_constraints() { Console.Write(", but is expected to be "); Console.Write("between "); Console.Write(0.1); - Console.Write(" (d_min)"); Console.Write(" and "); Console.Write(5.0); - Console.Write(" (d_max)"); Console.WriteLine("."); throw new Exception("InputError"); } @@ -233,10 +231,8 @@ private void input_constraints() { Console.Write(", but is expected to be "); Console.Write("between "); Console.Write(0.1); - Console.Write(" (d_min)"); Console.Write(" and "); Console.Write(5.0); - Console.Write(" (d_max)"); Console.WriteLine("."); throw new Exception("InputError"); } @@ -246,10 +242,8 @@ private void input_constraints() { Console.Write(", but is expected to be "); Console.Write("between "); Console.Write(4.5); - Console.Write(" (w_min)"); Console.Write(" and "); Console.Write(910.0); - Console.Write(" (w_max)"); Console.WriteLine("."); throw new Exception("InputError"); } @@ -289,10 +283,8 @@ private void input_constraints() { Console.Write(", but is expected to be "); Console.Write("between "); Console.Write(6.0); - Console.Write(" (SD_min)"); Console.Write(" and "); Console.Write(130.0); - Console.Write(" (SD_max)"); Console.WriteLine("."); throw new Exception("InputError"); } @@ -302,7 +294,6 @@ private void input_constraints() { Console.Write(", but is expected to be "); Console.Write("below "); Console.Write(5.0); - Console.Write(" (AR_max)"); Console.WriteLine("."); throw new Exception("InputError"); } @@ -322,7 +313,6 @@ private void input_constraints() { Console.Write(", but is expected to be "); Console.Write("above "); Console.Write(this.b); - Console.Write(" (b)"); Console.WriteLine("."); throw new Exception("InputError"); } @@ -334,7 +324,6 @@ private void input_constraints() { Console.Write(0.0); Console.Write(" and "); Console.Write(this.a); - Console.Write(" (a)"); Console.WriteLine("."); throw new Exception("InputError"); } diff --git a/code/stable/glassbr/src/java/GlassBR/InputParameters.java b/code/stable/glassbr/src/java/GlassBR/InputParameters.java index 6c581be08d2..82941722278 100644 --- a/code/stable/glassbr/src/java/GlassBR/InputParameters.java +++ b/code/stable/glassbr/src/java/GlassBR/InputParameters.java @@ -226,10 +226,8 @@ private void input_constraints() throws Exception, IOException { System.out.print(", but is expected to be "); System.out.print("between "); System.out.print(0.1); - System.out.print(" (d_min)"); System.out.print(" and "); System.out.print(5.0); - System.out.print(" (d_max)"); System.out.println("."); throw new Exception("InputError"); } @@ -239,10 +237,8 @@ private void input_constraints() throws Exception, IOException { System.out.print(", but is expected to be "); System.out.print("between "); System.out.print(0.1); - System.out.print(" (d_min)"); System.out.print(" and "); System.out.print(5.0); - System.out.print(" (d_max)"); System.out.println("."); throw new Exception("InputError"); } @@ -252,10 +248,8 @@ private void input_constraints() throws Exception, IOException { System.out.print(", but is expected to be "); System.out.print("between "); System.out.print(4.5); - System.out.print(" (w_min)"); System.out.print(" and "); System.out.print(910.0); - System.out.print(" (w_max)"); System.out.println("."); throw new Exception("InputError"); } @@ -295,10 +289,8 @@ private void input_constraints() throws Exception, IOException { System.out.print(", but is expected to be "); System.out.print("between "); System.out.print(6.0); - System.out.print(" (SD_min)"); System.out.print(" and "); System.out.print(130.0); - System.out.print(" (SD_max)"); System.out.println("."); throw new Exception("InputError"); } @@ -308,7 +300,6 @@ private void input_constraints() throws Exception, IOException { System.out.print(", but is expected to be "); System.out.print("below "); System.out.print(5.0); - System.out.print(" (AR_max)"); System.out.println("."); throw new Exception("InputError"); } @@ -328,7 +319,6 @@ private void input_constraints() throws Exception, IOException { System.out.print(", but is expected to be "); System.out.print("above "); System.out.print(this.b); - System.out.print(" (b)"); System.out.println("."); throw new Exception("InputError"); } @@ -340,7 +330,6 @@ private void input_constraints() throws Exception, IOException { System.out.print(0.0); System.out.print(" and "); System.out.print(this.a); - System.out.print(" (a)"); System.out.println("."); throw new Exception("InputError"); } diff --git a/code/stable/glassbr/src/python/InputParameters.py b/code/stable/glassbr/src/python/InputParameters.py index cbd60b6b4d0..e6909c77277 100644 --- a/code/stable/glassbr/src/python/InputParameters.py +++ b/code/stable/glassbr/src/python/InputParameters.py @@ -183,10 +183,8 @@ def input_constraints(self): print(", but is expected to be ", end="") print("between ", end="") print(0.1, end="") - print(" (d_min)", end="") print(" and ", end="") print(5.0, end="") - print(" (d_max)", end="") print(".") raise Exception("InputError") if not(0.1 <= self.b and self.b <= 5.0): @@ -195,10 +193,8 @@ def input_constraints(self): print(", but is expected to be ", end="") print("between ", end="") print(0.1, end="") - print(" (d_min)", end="") print(" and ", end="") print(5.0, end="") - print(" (d_max)", end="") print(".") raise Exception("InputError") if not(4.5 <= self.w and self.w <= 910.0): @@ -207,10 +203,8 @@ def input_constraints(self): print(", but is expected to be ", end="") print("between ", end="") print(4.5, end="") - print(" (w_min)", end="") print(" and ", end="") print(910.0, end="") - print(" (w_max)", end="") print(".") raise Exception("InputError") set_g = {"AN", "FT", "HS"} @@ -245,10 +239,8 @@ def input_constraints(self): print(", but is expected to be ", end="") print("between ", end="") print(6.0, end="") - print(" (SD_min)", end="") print(" and ", end="") print(130.0, end="") - print(" (SD_max)", end="") print(".") raise Exception("InputError") if not(self.AR <= 5.0): @@ -257,7 +249,6 @@ def input_constraints(self): print(", but is expected to be ", end="") print("below ", end="") print(5.0, end="") - print(" (AR_max)", end="") print(".") raise Exception("InputError") @@ -275,7 +266,6 @@ def input_constraints(self): print(", but is expected to be ", end="") print("above ", end="") print(self.b, end="") - print(" (b)", end="") print(".") raise Exception("InputError") if not(0.0 < self.b and self.b <= self.a): @@ -286,7 +276,6 @@ def input_constraints(self): print(0.0, end="") print(" and ", end="") print(self.a, end="") - print(" (a)", end="") print(".") raise Exception("InputError") if not(self.w > 0.0): diff --git a/code/stable/glassbr/src/swift/InputParameters.swift b/code/stable/glassbr/src/swift/InputParameters.swift index bf0d936ec60..eb8e66b9462 100644 --- a/code/stable/glassbr/src/swift/InputParameters.swift +++ b/code/stable/glassbr/src/swift/InputParameters.swift @@ -703,10 +703,8 @@ class InputParameters { print(", but is expected to be ", terminator: "") print("between ", terminator: "") print(0.1, terminator: "") - print(" (d_min)", terminator: "") print(" and ", terminator: "") print(5.0, terminator: "") - print(" (d_max)", terminator: "") print(".") throw "InputError" } @@ -716,10 +714,8 @@ class InputParameters { print(", but is expected to be ", terminator: "") print("between ", terminator: "") print(0.1, terminator: "") - print(" (d_min)", terminator: "") print(" and ", terminator: "") print(5.0, terminator: "") - print(" (d_max)", terminator: "") print(".") throw "InputError" } @@ -729,10 +725,8 @@ class InputParameters { print(", but is expected to be ", terminator: "") print("between ", terminator: "") print(4.5, terminator: "") - print(" (w_min)", terminator: "") print(" and ", terminator: "") print(910.0, terminator: "") - print(" (w_max)", terminator: "") print(".") throw "InputError" } @@ -762,10 +756,8 @@ class InputParameters { print(", but is expected to be ", terminator: "") print("between ", terminator: "") print(6.0, terminator: "") - print(" (SD_min)", terminator: "") print(" and ", terminator: "") print(130.0, terminator: "") - print(" (SD_max)", terminator: "") print(".") throw "InputError" } @@ -775,7 +767,6 @@ class InputParameters { print(", but is expected to be ", terminator: "") print("below ", terminator: "") print(5.0, terminator: "") - print(" (AR_max)", terminator: "") print(".") throw "InputError" } @@ -795,7 +786,6 @@ class InputParameters { print(", but is expected to be ", terminator: "") print("above ", terminator: "") print(self.b, terminator: "") - print(" (b)", terminator: "") print(".") throw "InputError" } @@ -807,7 +797,6 @@ class InputParameters { print(0.0, terminator: "") print(" and ", terminator: "") print(self.a, terminator: "") - print(" (a)", terminator: "") print(".") throw "InputError" } diff --git a/code/stable/pdcontroller/src/cpp/InputParameters.cpp b/code/stable/pdcontroller/src/cpp/InputParameters.cpp index 742a6053819..5f4a078e999 100644 --- a/code/stable/pdcontroller/src/cpp/InputParameters.cpp +++ b/code/stable/pdcontroller/src/cpp/InputParameters.cpp @@ -64,10 +64,8 @@ void input_constraints(double r_t, double K_d, double K_p, double t_step, double std::cout << ", but is expected to be "; std::cout << "between "; std::cout << (1.0 / 1000.0); - std::cout << " ((1)/(1000))"; std::cout << " and "; std::cout << t_sim; - std::cout << " (t_sim)"; std::cout << "." << std::endl; throw("InputError"); } diff --git a/code/stable/pdcontroller/src/csharp/InputParameters.cs b/code/stable/pdcontroller/src/csharp/InputParameters.cs index 2a32c63eec2..ca4c1a1da78 100644 --- a/code/stable/pdcontroller/src/csharp/InputParameters.cs +++ b/code/stable/pdcontroller/src/csharp/InputParameters.cs @@ -74,10 +74,8 @@ public static void input_constraints(double r_t, double K_d, double K_p, double Console.Write(", but is expected to be "); Console.Write("between "); Console.Write(1.0 / 1000.0); - Console.Write(" ((1)/(1000))"); Console.Write(" and "); Console.Write(t_sim); - Console.Write(" (t_sim)"); Console.WriteLine("."); throw new Exception("InputError"); } diff --git a/code/stable/pdcontroller/src/java/PDController/InputParameters.java b/code/stable/pdcontroller/src/java/PDController/InputParameters.java index 8344322f3d5..de21691c0fb 100644 --- a/code/stable/pdcontroller/src/java/PDController/InputParameters.java +++ b/code/stable/pdcontroller/src/java/PDController/InputParameters.java @@ -92,10 +92,8 @@ public static void input_constraints(double r_t, double K_d, double K_p, double System.out.print(", but is expected to be "); System.out.print("between "); System.out.print(1.0 / 1000.0); - System.out.print(" ((1)/(1000))"); System.out.print(" and "); System.out.print(t_sim); - System.out.print(" (t_sim)"); System.out.println("."); throw new Exception("InputError"); } diff --git a/code/stable/pdcontroller/src/python/InputParameters.py b/code/stable/pdcontroller/src/python/InputParameters.py index 2dbf6bcc6da..ec48a36c0f7 100644 --- a/code/stable/pdcontroller/src/python/InputParameters.py +++ b/code/stable/pdcontroller/src/python/InputParameters.py @@ -63,10 +63,8 @@ def input_constraints(r_t, K_d, K_p, t_step, t_sim): print(", but is expected to be ", end="") print("between ", end="") print(1.0 / 1000.0, end="") - print(" ((1)/(1000))", end="") print(" and ", end="") print(t_sim, end="") - print(" (t_sim)", end="") print(".") raise Exception("InputError") if not(1.0 <= t_sim and t_sim <= 60.0): diff --git a/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/cpp/InputParameters.cpp b/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/cpp/InputParameters.cpp index b183c35fdbf..e2921604fe4 100644 --- a/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/cpp/InputParameters.cpp +++ b/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/cpp/InputParameters.cpp @@ -46,7 +46,6 @@ void input_constraints(float v_launch, float theta, float p_target) { std::cout << 0.0f; std::cout << " and "; std::cout << (M_PI / 2.0f); - std::cout << " ((pi)/(2))"; std::cout << "." << std::endl; } if (!(p_target > 0.0f)) { diff --git a/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/csharp/InputParameters.cs b/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/csharp/InputParameters.cs index 77e6228b027..20369321022 100644 --- a/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/csharp/InputParameters.cs +++ b/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/csharp/InputParameters.cs @@ -51,7 +51,6 @@ public static void input_constraints(float v_launch, float theta, float p_target Console.Write(0.0f); Console.Write(" and "); Console.Write(Math.PI / 2.0f); - Console.Write(" ((pi)/(2))"); Console.WriteLine("."); } if (!(p_target > 0.0f)) { diff --git a/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/java/Projectile/InputParameters.java b/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/java/Projectile/InputParameters.java index b21d88b26f6..2706492b815 100644 --- a/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/java/Projectile/InputParameters.java +++ b/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/java/Projectile/InputParameters.java @@ -65,7 +65,6 @@ public static void input_constraints(float v_launch, float theta, float p_target System.out.print(0.0f); System.out.print(" and "); System.out.print(Math.PI / 2.0f); - System.out.print(" ((pi)/(2))"); System.out.println("."); } if (!(p_target > 0.0f)) { diff --git a/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/julia/InputParameters.jl b/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/julia/InputParameters.jl index 60ce230ce5b..545144bbceb 100644 --- a/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/julia/InputParameters.jl +++ b/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/julia/InputParameters.jl @@ -49,7 +49,6 @@ function input_constraints(v_launch::Float32, theta::Float32, p_target::Float32) print(Float32(0.0)) print(" and ") print(pi / Float32(2.0)) - print(" ((pi)/(2))") println(".") end if !(p_target > Float32(0.0)) diff --git a/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/python/InputParameters.py b/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/python/InputParameters.py index c313adcab76..6e35c1f144f 100644 --- a/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/python/InputParameters.py +++ b/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/python/InputParameters.py @@ -44,7 +44,6 @@ def input_constraints(v_launch, theta, p_target): print(0.0, end="") print(" and ", end="") print(math.pi / 2.0, end="") - print(" ((pi)/(2))", end="") print(".") if not(p_target > 0.0): print("Warning: ", end="") diff --git a/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/swift/InputParameters.swift b/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/swift/InputParameters.swift index bb21c21c311..787721896a3 100644 --- a/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/swift/InputParameters.swift +++ b/code/stable/projectile/projectile_m_l_nol_u_u_v_f/src/swift/InputParameters.swift @@ -58,7 +58,6 @@ func input_constraints(_ v_launch: Float, _ theta: Float, _ p_target: Float) -> print(0.0, terminator: "") print(" and ", terminator: "") print(Double.pi / Double(2.0), terminator: "") - print(" ((pi)/(2))", terminator: "") print(".") } if !(p_target > 0.0) { diff --git a/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/cpp/InputParameters.cpp b/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/cpp/InputParameters.cpp index 3ee11bd2c8a..7621de75528 100644 --- a/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/cpp/InputParameters.cpp +++ b/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/cpp/InputParameters.cpp @@ -51,7 +51,6 @@ void InputParameters::input_constraints() { std::cout << 0.0; std::cout << " and "; std::cout << (M_PI / 2.0); - std::cout << " ((pi)/(2))"; std::cout << "." << std::endl; } if (!(this->p_target > 0.0)) { diff --git a/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/csharp/InputParameters.cs b/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/csharp/InputParameters.cs index ba050eb1070..c622d99e668 100644 --- a/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/csharp/InputParameters.cs +++ b/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/csharp/InputParameters.cs @@ -58,7 +58,6 @@ private void input_constraints() { Console.Write(0.0); Console.Write(" and "); Console.Write(Math.PI / 2.0); - Console.Write(" ((pi)/(2))"); Console.WriteLine("."); } if (!(this.p_target > 0.0)) { diff --git a/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/java/Projectile/InputParameters.java b/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/java/Projectile/InputParameters.java index 7103af85d8a..b77cfbf26ee 100644 --- a/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/java/Projectile/InputParameters.java +++ b/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/java/Projectile/InputParameters.java @@ -61,7 +61,6 @@ private void input_constraints() { System.out.print(0.0); System.out.print(" and "); System.out.print(Math.PI / 2.0); - System.out.print(" ((pi)/(2))"); System.out.println("."); } if (!(this.p_target > 0.0)) { diff --git a/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/python/InputParameters.py b/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/python/InputParameters.py index 3d133454968..b61a69db4ae 100644 --- a/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/python/InputParameters.py +++ b/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/python/InputParameters.py @@ -44,7 +44,6 @@ def input_constraints(self): print(0.0, end="") print(" and ", end="") print(math.pi / 2.0, end="") - print(" ((pi)/(2))", end="") print(".") if not(self.p_target > 0.0): print("Warning: ", end="") diff --git a/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/swift/InputParameters.swift b/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/swift/InputParameters.swift index 6cc9269a1c6..a5327afd44f 100644 --- a/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/swift/InputParameters.swift +++ b/code/stable/projectile/projectile_m_p_nol_b_u_v_d/src/swift/InputParameters.swift @@ -61,7 +61,6 @@ class InputParameters { print(0.0, terminator: "") print(" and ", terminator: "") print(Double.pi / 2.0, terminator: "") - print(" ((pi)/(2))", terminator: "") print(".") } if !(self.p_target > 0.0) { diff --git a/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/cpp/Projectile.cpp b/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/cpp/Projectile.cpp index e1fd291faf9..8c6463cfc5e 100644 --- a/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/cpp/Projectile.cpp +++ b/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/cpp/Projectile.cpp @@ -95,7 +95,6 @@ void InputParameters::input_constraints() { std::cout << 0.0; std::cout << " and "; std::cout << (M_PI / 2.0); - std::cout << " ((pi)/(2))"; std::cout << "." << std::endl; } if (!(this->p_target > 0.0)) { diff --git a/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/csharp/Projectile.cs b/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/csharp/Projectile.cs index 7f27cd38127..cad246d7efd 100644 --- a/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/csharp/Projectile.cs +++ b/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/csharp/Projectile.cs @@ -208,7 +208,6 @@ private void input_constraints() { Console.Write(0.0); Console.Write(" and "); Console.Write(Math.PI / 2.0); - Console.Write(" ((pi)/(2))"); Console.WriteLine("."); } if (!(this.p_target > 0.0)) { diff --git a/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/java/Projectile/Projectile.java b/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/java/Projectile/Projectile.java index a61f1e930d9..fadc7e62d66 100644 --- a/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/java/Projectile/Projectile.java +++ b/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/java/Projectile/Projectile.java @@ -214,7 +214,6 @@ private void input_constraints() throws IOException { System.out.print(0.0); System.out.print(" and "); System.out.print(Math.PI / 2.0); - System.out.print(" ((pi)/(2))"); System.out.println("."); } if (!(this.p_target > 0.0)) { diff --git a/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/python/Projectile.py b/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/python/Projectile.py index e0e62d443e4..7de3fdc2d1e 100644 --- a/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/python/Projectile.py +++ b/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/python/Projectile.py @@ -79,7 +79,6 @@ def input_constraints(self): print(0.0, end="") print(" and ", end="") print(math.pi / 2.0, end="") - print(" ((pi)/(2))", end="") print(".") if not(self.p_target > 0.0): print("Warning: ", end="") diff --git a/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/swift/main.swift b/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/swift/main.swift index ccddf290e9c..b46a7c7177d 100644 --- a/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/swift/main.swift +++ b/code/stable/projectile/projectile_u_p_l_b_b_c_d/src/swift/main.swift @@ -239,7 +239,6 @@ class InputParameters { print(0.0, terminator: "") print(" and ", terminator: "") print(Double.pi / 2.0, terminator: "") - print(" ((pi)/(2))", terminator: "") print(".") } if !(self.p_target > 0.0) { diff --git a/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/cpp/Projectile.cpp b/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/cpp/Projectile.cpp index edf22d51f11..1e372c191ce 100644 --- a/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/cpp/Projectile.cpp +++ b/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/cpp/Projectile.cpp @@ -95,7 +95,6 @@ void InputParameters::input_constraints() { std::cout << 0.0f; std::cout << " and "; std::cout << (M_PI / 2.0f); - std::cout << " ((pi)/(2))"; std::cout << "." << std::endl; } if (!(this->p_target > 0.0f)) { diff --git a/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/csharp/Projectile.cs b/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/csharp/Projectile.cs index c029c1f6698..b93aa30ac83 100644 --- a/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/csharp/Projectile.cs +++ b/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/csharp/Projectile.cs @@ -210,7 +210,6 @@ private void input_constraints() { Console.Write(0.0f); Console.Write(" and "); Console.Write(Math.PI / 2.0f); - Console.Write(" ((pi)/(2))"); Console.WriteLine("."); } if (!(this.p_target > 0.0f)) { diff --git a/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/java/Projectile/Projectile.java b/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/java/Projectile/Projectile.java index dfecdc8212c..a1ae85284f3 100644 --- a/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/java/Projectile/Projectile.java +++ b/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/java/Projectile/Projectile.java @@ -216,7 +216,6 @@ private void input_constraints() throws IOException { System.out.print(0.0f); System.out.print(" and "); System.out.print(Math.PI / 2.0f); - System.out.print(" ((pi)/(2))"); System.out.println("."); } if (!(this.p_target > 0.0f)) { diff --git a/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/python/Projectile.py b/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/python/Projectile.py index db93342008c..e8fb2c6e92c 100644 --- a/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/python/Projectile.py +++ b/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/python/Projectile.py @@ -82,7 +82,6 @@ def input_constraints(self): print(0.0, end="") print(" and ", end="") print(math.pi / 2.0, end="") - print(" ((pi)/(2))", end="") print(".") if not(self.p_target > 0.0): print("Warning: ", end="") diff --git a/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/swift/main.swift b/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/swift/main.swift index 92f3ec74ac6..5ed88e779bd 100644 --- a/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/swift/main.swift +++ b/code/stable/projectile/projectile_u_p_l_b_wi_v_f/src/swift/main.swift @@ -241,7 +241,6 @@ class InputParameters { print(0.0, terminator: "") print(" and ", terminator: "") print(Double.pi / Double(2.0), terminator: "") - print(" ((pi)/(2))", terminator: "") print(".") } if !(self.p_target > 0.0) { diff --git a/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/cpp/Projectile.cpp b/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/cpp/Projectile.cpp index a4f8d2070a9..e90bf06ab97 100644 --- a/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/cpp/Projectile.cpp +++ b/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/cpp/Projectile.cpp @@ -87,7 +87,6 @@ void input_constraints(double v_launch, double theta, double p_target) { std::cout << 0.0; std::cout << " and "; std::cout << (M_PI / 2.0); - std::cout << " ((pi)/(2))"; std::cout << "." << std::endl; } if (!(p_target > 0.0)) { diff --git a/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/csharp/Projectile.cs b/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/csharp/Projectile.cs index ca6ac7ca056..abeb6136678 100644 --- a/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/csharp/Projectile.cs +++ b/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/csharp/Projectile.cs @@ -98,7 +98,6 @@ public static void input_constraints(double v_launch, double theta, double p_tar Console.Write(0.0); Console.Write(" and "); Console.Write(Math.PI / 2.0); - Console.Write(" ((pi)/(2))"); Console.WriteLine("."); } if (!(p_target > 0.0)) { diff --git a/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/java/Projectile/Projectile.java b/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/java/Projectile/Projectile.java index 25a4e51c18e..7c9f2e1ab31 100644 --- a/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/java/Projectile/Projectile.java +++ b/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/java/Projectile/Projectile.java @@ -118,7 +118,6 @@ public static void input_constraints(double v_launch, double theta, double p_tar System.out.print(0.0); System.out.print(" and "); System.out.print(Math.PI / 2.0); - System.out.print(" ((pi)/(2))"); System.out.println("."); } if (!(p_target > 0.0)) { diff --git a/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/julia/Projectile.jl b/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/julia/Projectile.jl index adf8e3ff32c..2cb921deb3b 100644 --- a/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/julia/Projectile.jl +++ b/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/julia/Projectile.jl @@ -78,7 +78,6 @@ function input_constraints(v_launch::Float64, theta::Float64, p_target::Float64) print(0.0) print(" and ") print(pi / 2.0) - print(" ((pi)/(2))") println(".") end if !(p_target > 0.0) diff --git a/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/python/Projectile.py b/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/python/Projectile.py index 337743996fc..084e3637f5d 100644 --- a/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/python/Projectile.py +++ b/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/python/Projectile.py @@ -68,7 +68,6 @@ def input_constraints(v_launch, theta, p_target): print(0.0, end="") print(" and ", end="") print(math.pi / 2.0, end="") - print(" ((pi)/(2))", end="") print(".") if not(p_target > 0.0): print("Warning: ", end="") diff --git a/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/swift/main.swift b/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/swift/main.swift index 4aac1611fef..2397f56f3b8 100644 --- a/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/swift/main.swift +++ b/code/stable/projectile/projectile_u_p_nol_u_wi_v_d/src/swift/main.swift @@ -87,7 +87,6 @@ func input_constraints(_ v_launch: Double, _ theta: Double, _ p_target: Double) print(0.0, terminator: "") print(" and ", terminator: "") print(Double.pi / 2.0, terminator: "") - print(" ((pi)/(2))", terminator: "") print(".") } if !(p_target > 0.0) { diff --git a/code/stable/swhsnopcm/src/cpp/InputParameters.cpp b/code/stable/swhsnopcm/src/cpp/InputParameters.cpp index d588c532424..26f02c2be5a 100644 --- a/code/stable/swhsnopcm/src/cpp/InputParameters.cpp +++ b/code/stable/swhsnopcm/src/cpp/InputParameters.cpp @@ -73,7 +73,6 @@ void input_constraints(double A_C, double C_W, double h_C, double T_init, double std::cout << ", but is suggested to be "; std::cout << "below "; std::cout << Constants::A_C_max; - std::cout << " (A_C_max)"; std::cout << "." << std::endl; } if (!(Constants::C_W_min < C_W && C_W < Constants::C_W_max)) { @@ -83,10 +82,8 @@ void input_constraints(double A_C, double C_W, double h_C, double T_init, double std::cout << ", but is suggested to be "; std::cout << "between "; std::cout << Constants::C_W_min; - std::cout << " (C_W_min)"; std::cout << " and "; std::cout << Constants::C_W_max; - std::cout << " (C_W_max)"; std::cout << "." << std::endl; } if (!(Constants::h_C_min <= h_C && h_C <= Constants::h_C_max)) { @@ -96,10 +93,8 @@ void input_constraints(double A_C, double C_W, double h_C, double T_init, double std::cout << ", but is suggested to be "; std::cout << "between "; std::cout << Constants::h_C_min; - std::cout << " (h_C_min)"; std::cout << " and "; std::cout << Constants::h_C_max; - std::cout << " (h_C_max)"; std::cout << "." << std::endl; } if (!(t_final < Constants::t_final_max)) { @@ -109,7 +104,6 @@ void input_constraints(double A_C, double C_W, double h_C, double T_init, double std::cout << ", but is suggested to be "; std::cout << "below "; std::cout << Constants::t_final_max; - std::cout << " (t_final_max)"; std::cout << "." << std::endl; } if (!(Constants::L_min <= L && L <= Constants::L_max)) { @@ -119,10 +113,8 @@ void input_constraints(double A_C, double C_W, double h_C, double T_init, double std::cout << ", but is suggested to be "; std::cout << "between "; std::cout << Constants::L_min; - std::cout << " (L_min)"; std::cout << " and "; std::cout << Constants::L_max; - std::cout << " (L_max)"; std::cout << "." << std::endl; } if (!(Constants::rho_W_min < rho_W && rho_W <= Constants::rho_W_max)) { @@ -132,10 +124,8 @@ void input_constraints(double A_C, double C_W, double h_C, double T_init, double std::cout << ", but is suggested to be "; std::cout << "between "; std::cout << Constants::rho_W_min; - std::cout << " (rho_W_min)"; std::cout << " and "; std::cout << Constants::rho_W_max; - std::cout << " (rho_W_max)"; std::cout << "." << std::endl; } if (!(Constants::AR_min <= D && D <= Constants::AR_max)) { @@ -145,10 +135,8 @@ void input_constraints(double A_C, double C_W, double h_C, double T_init, double std::cout << ", but is suggested to be "; std::cout << "between "; std::cout << Constants::AR_min; - std::cout << " (AR_min)"; std::cout << " and "; std::cout << Constants::AR_max; - std::cout << " (AR_max)"; std::cout << "." << std::endl; } @@ -228,7 +216,6 @@ void input_constraints(double A_C, double C_W, double h_C, double T_init, double std::cout << 0.0; std::cout << " and "; std::cout << t_final; - std::cout << " (t_final)"; std::cout << "." << std::endl; } if (!(rho_W > 0.0)) { diff --git a/code/stable/swhsnopcm/src/csharp/InputParameters.cs b/code/stable/swhsnopcm/src/csharp/InputParameters.cs index d3e666fd8af..7d0b5deeb2c 100644 --- a/code/stable/swhsnopcm/src/csharp/InputParameters.cs +++ b/code/stable/swhsnopcm/src/csharp/InputParameters.cs @@ -91,7 +91,6 @@ public static void input_constraints(double A_C, double C_W, double h_C, double Console.Write(", but is suggested to be "); Console.Write("below "); Console.Write(Constants.A_C_max); - Console.Write(" (A_C_max)"); Console.WriteLine("."); } if (!(Constants.C_W_min < C_W && C_W < Constants.C_W_max)) { @@ -101,10 +100,8 @@ public static void input_constraints(double A_C, double C_W, double h_C, double Console.Write(", but is suggested to be "); Console.Write("between "); Console.Write(Constants.C_W_min); - Console.Write(" (C_W_min)"); Console.Write(" and "); Console.Write(Constants.C_W_max); - Console.Write(" (C_W_max)"); Console.WriteLine("."); } if (!(Constants.h_C_min <= h_C && h_C <= Constants.h_C_max)) { @@ -114,10 +111,8 @@ public static void input_constraints(double A_C, double C_W, double h_C, double Console.Write(", but is suggested to be "); Console.Write("between "); Console.Write(Constants.h_C_min); - Console.Write(" (h_C_min)"); Console.Write(" and "); Console.Write(Constants.h_C_max); - Console.Write(" (h_C_max)"); Console.WriteLine("."); } if (!(t_final < Constants.t_final_max)) { @@ -127,7 +122,6 @@ public static void input_constraints(double A_C, double C_W, double h_C, double Console.Write(", but is suggested to be "); Console.Write("below "); Console.Write(Constants.t_final_max); - Console.Write(" (t_final_max)"); Console.WriteLine("."); } if (!(Constants.L_min <= L && L <= Constants.L_max)) { @@ -137,10 +131,8 @@ public static void input_constraints(double A_C, double C_W, double h_C, double Console.Write(", but is suggested to be "); Console.Write("between "); Console.Write(Constants.L_min); - Console.Write(" (L_min)"); Console.Write(" and "); Console.Write(Constants.L_max); - Console.Write(" (L_max)"); Console.WriteLine("."); } if (!(Constants.rho_W_min < rho_W && rho_W <= Constants.rho_W_max)) { @@ -150,10 +142,8 @@ public static void input_constraints(double A_C, double C_W, double h_C, double Console.Write(", but is suggested to be "); Console.Write("between "); Console.Write(Constants.rho_W_min); - Console.Write(" (rho_W_min)"); Console.Write(" and "); Console.Write(Constants.rho_W_max); - Console.Write(" (rho_W_max)"); Console.WriteLine("."); } if (!(Constants.AR_min <= D && D <= Constants.AR_max)) { @@ -163,10 +153,8 @@ public static void input_constraints(double A_C, double C_W, double h_C, double Console.Write(", but is suggested to be "); Console.Write("between "); Console.Write(Constants.AR_min); - Console.Write(" (AR_min)"); Console.Write(" and "); Console.Write(Constants.AR_max); - Console.Write(" (AR_max)"); Console.WriteLine("."); } @@ -246,7 +234,6 @@ public static void input_constraints(double A_C, double C_W, double h_C, double Console.Write(0.0); Console.Write(" and "); Console.Write(t_final); - Console.Write(" (t_final)"); Console.WriteLine("."); } if (!(rho_W > 0.0)) { diff --git a/code/stable/swhsnopcm/src/java/SWHSNoPCM/InputParameters.java b/code/stable/swhsnopcm/src/java/SWHSNoPCM/InputParameters.java index 85fa3e9fe73..a23a3a0d6cd 100644 --- a/code/stable/swhsnopcm/src/java/SWHSNoPCM/InputParameters.java +++ b/code/stable/swhsnopcm/src/java/SWHSNoPCM/InputParameters.java @@ -125,7 +125,6 @@ public static void input_constraints(double A_C, double C_W, double h_C, double System.out.print(", but is suggested to be "); System.out.print("below "); System.out.print(Constants.A_C_max); - System.out.print(" (A_C_max)"); System.out.println("."); } if (!(Constants.C_W_min < C_W && C_W < Constants.C_W_max)) { @@ -135,10 +134,8 @@ public static void input_constraints(double A_C, double C_W, double h_C, double System.out.print(", but is suggested to be "); System.out.print("between "); System.out.print(Constants.C_W_min); - System.out.print(" (C_W_min)"); System.out.print(" and "); System.out.print(Constants.C_W_max); - System.out.print(" (C_W_max)"); System.out.println("."); } if (!(Constants.h_C_min <= h_C && h_C <= Constants.h_C_max)) { @@ -148,10 +145,8 @@ public static void input_constraints(double A_C, double C_W, double h_C, double System.out.print(", but is suggested to be "); System.out.print("between "); System.out.print(Constants.h_C_min); - System.out.print(" (h_C_min)"); System.out.print(" and "); System.out.print(Constants.h_C_max); - System.out.print(" (h_C_max)"); System.out.println("."); } if (!(t_final < Constants.t_final_max)) { @@ -161,7 +156,6 @@ public static void input_constraints(double A_C, double C_W, double h_C, double System.out.print(", but is suggested to be "); System.out.print("below "); System.out.print(Constants.t_final_max); - System.out.print(" (t_final_max)"); System.out.println("."); } if (!(Constants.L_min <= L && L <= Constants.L_max)) { @@ -171,10 +165,8 @@ public static void input_constraints(double A_C, double C_W, double h_C, double System.out.print(", but is suggested to be "); System.out.print("between "); System.out.print(Constants.L_min); - System.out.print(" (L_min)"); System.out.print(" and "); System.out.print(Constants.L_max); - System.out.print(" (L_max)"); System.out.println("."); } if (!(Constants.rho_W_min < rho_W && rho_W <= Constants.rho_W_max)) { @@ -184,10 +176,8 @@ public static void input_constraints(double A_C, double C_W, double h_C, double System.out.print(", but is suggested to be "); System.out.print("between "); System.out.print(Constants.rho_W_min); - System.out.print(" (rho_W_min)"); System.out.print(" and "); System.out.print(Constants.rho_W_max); - System.out.print(" (rho_W_max)"); System.out.println("."); } if (!(Constants.AR_min <= D && D <= Constants.AR_max)) { @@ -197,10 +187,8 @@ public static void input_constraints(double A_C, double C_W, double h_C, double System.out.print(", but is suggested to be "); System.out.print("between "); System.out.print(Constants.AR_min); - System.out.print(" (AR_min)"); System.out.print(" and "); System.out.print(Constants.AR_max); - System.out.print(" (AR_max)"); System.out.println("."); } @@ -280,7 +268,6 @@ public static void input_constraints(double A_C, double C_W, double h_C, double System.out.print(0.0); System.out.print(" and "); System.out.print(t_final); - System.out.print(" (t_final)"); System.out.println("."); } if (!(rho_W > 0.0)) { diff --git a/code/stable/swhsnopcm/src/python/InputParameters.py b/code/stable/swhsnopcm/src/python/InputParameters.py index 7b827085a53..180f8f5383f 100644 --- a/code/stable/swhsnopcm/src/python/InputParameters.py +++ b/code/stable/swhsnopcm/src/python/InputParameters.py @@ -81,7 +81,6 @@ def input_constraints(A_C, C_W, h_C, T_init, t_final, L, T_C, t_step, rho_W, D, print(", but is suggested to be ", end="") print("below ", end="") print(Constants.Constants.A_C_MAX, end="") - print(" (A_C_max)", end="") print(".") if not(Constants.Constants.C_W_MIN < C_W and C_W < Constants.Constants.C_W_MAX): print("Warning: ", end="") @@ -90,10 +89,8 @@ def input_constraints(A_C, C_W, h_C, T_init, t_final, L, T_C, t_step, rho_W, D, print(", but is suggested to be ", end="") print("between ", end="") print(Constants.Constants.C_W_MIN, end="") - print(" (C_W_min)", end="") print(" and ", end="") print(Constants.Constants.C_W_MAX, end="") - print(" (C_W_max)", end="") print(".") if not(Constants.Constants.H_C_MIN <= h_C and h_C <= Constants.Constants.H_C_MAX): print("Warning: ", end="") @@ -102,10 +99,8 @@ def input_constraints(A_C, C_W, h_C, T_init, t_final, L, T_C, t_step, rho_W, D, print(", but is suggested to be ", end="") print("between ", end="") print(Constants.Constants.H_C_MIN, end="") - print(" (h_C_min)", end="") print(" and ", end="") print(Constants.Constants.H_C_MAX, end="") - print(" (h_C_max)", end="") print(".") if not(t_final < Constants.Constants.T_FINAL_MAX): print("Warning: ", end="") @@ -114,7 +109,6 @@ def input_constraints(A_C, C_W, h_C, T_init, t_final, L, T_C, t_step, rho_W, D, print(", but is suggested to be ", end="") print("below ", end="") print(Constants.Constants.T_FINAL_MAX, end="") - print(" (t_final_max)", end="") print(".") if not(Constants.Constants.L_MIN <= L and L <= Constants.Constants.L_MAX): print("Warning: ", end="") @@ -123,10 +117,8 @@ def input_constraints(A_C, C_W, h_C, T_init, t_final, L, T_C, t_step, rho_W, D, print(", but is suggested to be ", end="") print("between ", end="") print(Constants.Constants.L_MIN, end="") - print(" (L_min)", end="") print(" and ", end="") print(Constants.Constants.L_MAX, end="") - print(" (L_max)", end="") print(".") if not(Constants.Constants.RHO_W_MIN < rho_W and rho_W <= Constants.Constants.RHO_W_MAX): print("Warning: ", end="") @@ -135,10 +127,8 @@ def input_constraints(A_C, C_W, h_C, T_init, t_final, L, T_C, t_step, rho_W, D, print(", but is suggested to be ", end="") print("between ", end="") print(Constants.Constants.RHO_W_MIN, end="") - print(" (rho_W_min)", end="") print(" and ", end="") print(Constants.Constants.RHO_W_MAX, end="") - print(" (rho_W_max)", end="") print(".") if not(Constants.Constants.AR_MIN <= D and D <= Constants.Constants.AR_MAX): print("Warning: ", end="") @@ -147,10 +137,8 @@ def input_constraints(A_C, C_W, h_C, T_init, t_final, L, T_C, t_step, rho_W, D, print(", but is suggested to be ", end="") print("between ", end="") print(Constants.Constants.AR_MIN, end="") - print(" (AR_min)", end="") print(" and ", end="") print(Constants.Constants.AR_MAX, end="") - print(" (AR_max)", end="") print(".") if not(A_C > 0.0): @@ -222,7 +210,6 @@ def input_constraints(A_C, C_W, h_C, T_init, t_final, L, T_C, t_step, rho_W, D, print(0.0, end="") print(" and ", end="") print(t_final, end="") - print(" (t_final)", end="") print(".") if not(rho_W > 0.0): print("Warning: ", end="")