svFSIplus
ChnlMod.h
1 /**
2  * Copyright (c) Stanford University, The Regents of the University of California, and others.
3  *
4  * All Rights Reserved.
5  *
6  * See Copyright-SimVascular.txt for additional details.
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject
14  * to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
20  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
23  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 // The classes defined here duplicate the data structures in the Fortran CHNLMOD module
33 // defined in CHNL.f.
34 
35 // This module defines data structures for
36 
37 #include "Array.h"
38 #include "Vector.h"
39 
40 #include <string>
41 
42 #ifndef CHNL_MOD_H
43 #define CHNL_MOD_H
44 
45 /// @brief Channel type, used in I/O
46 class chnlType
47 {
48  // Whether it is open to the screen
49  bool oTS = false;
50 
51  // Whether it is open to the file
52  bool oTF = false;
53 
54  // Channel identifier
55  int id;
56 
57  // File ID
58  int fId;
59 
60  // File address
61  std::string fName = "histor";
62 
63  // Channel tag
64  std::string tag = "";
65 
66  // Creates a new channel
67  // PROCEDURE :: new => newChnl
68  // Closes the channel
69  // PROCEDURE :: close => closeChnl
70  // To send a string to channel
71  // PROCEDURE chnlAssign
72  // GENERIC :: ASSIGNMENT(=) => chnlAssign
73 };
74 
75 /// @brief Only to group four channels, in case I rather have them as one
76 /// variable
77 class ioType
78 {
79  // Standard output
80  chnlType o;
81 
82  // Error
83  chnlType e;
84 
85  // Warning
86  chnlType w;
87 
88  // Debugging
89  chnlType d;
90 
91  // Status file
92  chnlType s;
93 
94  // CONTAINS
95  //! Opens all as standard channels
96  //PROCEDURE :: new => newIO
97  //! Closes the channel
98  //PROCEDURE :: close => closeIO
99 };
100 
101 class ChnlMod
102 {
103  public:
104  ChnlMod();
105 
106  // Channels cases: standard output, error output, warning output,
107  // debugging output
108  int CHNL_O = 601;
109  int CHNL_E = 602;
110  int CHNL_W = 603;
111  int CHNL_D = 604;
112 
113  // Whether to use color in printing outputs
114  bool pClr = true;
115 
116  // A general counter for file ID
117  int gFID = 314;
118 
119  // Appended path to all files that are going to be saved
120  std::string appPath = "";
121 
122 };
123 
124 #endif
125 
Definition: ChnlMod.h:102
ChnlMod()
Definition: ChnlMod.cpp:34
Channel type, used in I/O.
Definition: ChnlMod.h:47
Only to group four channels, in case I rather have them as one variable.
Definition: ChnlMod.h:78