File size: 4,665 Bytes
10f2621
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/**
 * @defgroup MCsh MCsh class 
 * @brief    the foundation MC context class
 */

/**
 *  @file       mcsh.h
 *  @ingroup    MCsh
 *  @brief      Class MCsh: the foundation MC context class.
 *  @author     Michael Holst
 *  @note       None
 *  @version    $Id: mcsh.h,v 1.16 2010/08/12 05:19:11 fetk Exp $ 
 *
 *  @attention
 *  @verbatim
 *
 * MC = < Manifold Code >
 * Copyright (C) 1994-- Michael Holst
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 *  @endverbatim
 */

#ifndef _MCSH_H_
#define _MCSH_H_

#include <mc/mc_base.h>

#include <mc/nam.h>

/*
 * ***************************************************************************
 * Class MCsh: Parameters and datatypes
 * ***************************************************************************
 */

/** 
 * @ingroup MCsh
 * @brief   Class MCsh: Definition
 * @author  Michael Holst
 */
struct sMCsh {

    Vmem *vmem;     /**< @brief the memory manager                           */
                                                                              
    Gem  *gm;       /**< @brief the geometry machine object                  */
    PDE  *pde;      /**< @brief the differential equation object             */
    Aprx *aprx;     /**< @brief the approximation object                     */
    AM   *am;       /**< @brief the multilevel linear algebra manager object */

    Vsh  *vsh;      /**< @brief the environment and shell object             */

    char PR[80];    /**< @brief shell prompt                                 */

    /** @brief user defined shell object */
    int (*USER_shell)(void *thee, int argc, char **argv);

};

/**
 * @ingroup MCsh
 * @brief   Declaration of the MCsh class as the MCsh structure
 * @author  Michael Holst
 */
typedef struct sMCsh MCsh;

/*
 * ***************************************************************************
 * Class MCsh: Inlineable methods (mcsh.c)
 * ***************************************************************************
 */

#if !defined(VINLINE_MCSH)
#else /* if defined(VINLINE_MCSH) */
#endif /* if !defined(VINLINE_MCSH) */

/*
 * ***************************************************************************
 * Class MCsh: Non-inlineable methods (mcsh.c)
 * ***************************************************************************
 */

/**
 * @ingroup MCsh
 * @brief   The MCsh constructor.
 * @author  Michael Holst
 * @note    Class MCsh: Non-inlineable methods (mcsh.c) 
 * @return  Pointer to a new allocated MCsh shell
 * @param   tpde Pointer to the PDE object
 * @param   argc number of the command line arguments
 * @param   argv the command line arguments
 */
VEXTERNC MCsh* MCsh_ctor(PDE *tpde, int argc, char **argv);

/**
 * @ingroup MCsh
 * @brief   The MCsh destructor.
 * @author  Michael Holst
 * @note    Class MCsh: Non-inlineable methods (mcsh.c) 
 * @return  None
 * @param   thee Pointer to a MCsh shell
 */
VEXTERNC void MCsh_dtor(MCsh **thee);

/**
 * @ingroup MCsh
 * @brief   The actuall shell
 * @author  Michael Holst
 * @note    Class MCsh: Non-inlineable methods (mcsh.c) 
 * @return  Success enumeration
 * @param   thee       Pointer to a MCsh shell
 * @param   USER_shell Pointer to a user-defined shell
 */
VEXTERNC int MCsh_shell(MCsh *thee,
    int (*USER_shell)(void *thee, int argc, char **argv));

/**
 * @ingroup MCsh
 * @brief   The actuall shell (version with parallel extensions).
 * @author  Michael Holst
 * @note    Class MCsh: Non-inlineable methods (mcsh.c) 
 * @return  Success enumeration
 * @param   thee       Pointer to a MCsh shell
 * @param   USER_shell Pointer to a user-defined shell
 */
VEXTERNC int MCsh_pshell(MCsh *thee,
    int (*USER_shell)(void *thee, int argc, char **argv));

/**
 * @ingroup MCsh
 * @brief   Print the exact current malloc usage.   
 * @author  Michael Holst
 * @note    Class MCsh: Non-inlineable methods (mcsh.c) 
 * @return  None
 * @param   thee Pointer to a MCsh shell
 */
VEXTERNC void MCsh_memChk(MCsh *thee);

#endif /* _MCSH_H_ */