Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Rocin/test/param_test.C
Go to the documentation of this file.
1 /* *******************************************************************
2  * Rocstar Simulation Suite *
3  * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4  * *
5  * Illinois Rocstar LLC *
6  * Champaign, IL *
7  * www.illinoisrocstar.com *
8  * sales@illinoisrocstar.com *
9  * *
10  * License: See LICENSE file in top level of distribution package or *
11  * http://opensource.org/licenses/NCSA *
12  *********************************************************************/
13 /* *******************************************************************
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21  * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22  *********************************************************************/
23 // $Id: param_test.C,v 1.3 2008/12/06 08:43:20 mtcampbe Exp $
24 // $Author: mtcampbe $
25 // $Date: 2008/12/06 08:43:20 $
26 
27 // $Log: param_test.C,v $
28 // Revision 1.3 2008/12/06 08:43:20 mtcampbe
29 // Updated license.
30 //
31 // Revision 1.2 2008/11/19 22:16:34 mtcampbe
32 // Added Illinois Open Source License/Copyright
33 //
34 // Revision 1.1 2004/11/03 20:12:45 palexand
35 // Initial versions.
36 //
37 
42 #include "Rocin.h"
43 #include "Roccom_base.h"
44 #include "roccom.h"
45 #include "roccom_devel.h"
46 
47 #include <iostream>
48 #include <cstring>
49 #include <string>
50 
53 
54 using namespace std;
55 
56 int main(int argc, char *argv[]) {
57  COM_init( &argc, &argv);
58 
59  if ( argc < 3 || argc > 3 ) {
60  std::cout << "Usage: To test in serial: \n\t" << argv[0]
61  << " <parameter file> <winname>\n"
62  << std::endl;
63  exit(-1);
64  }
65 
66  const char *FILE_in = argv[1];
67  const string winname(argv[2]);
68 
70  COM_set_verbose(10);
71 
74 
75  //===== Read in parameter file using Rocin
76  int IN_param = COM_get_function_handle( "IN.read_parameter_file");
77 
78  COM_call_function(IN_param, FILE_in, winname.c_str());
79  int PARAM_all = COM_get_attribute_handle ((winname+".all").c_str());
80 
81  COM_window_init_done(winname.c_str());
82 
83  //===== Write out using Rocout
84  int OUT_write = COM_get_function_handle( "OUT.write_attribute");
85  COM_call_function( OUT_write, winname.c_str(),
86  &PARAM_all,winname.c_str(), "000");
87 
88  COM_print_profile("", "");
89  COM_finalize();
90 }
91 
92 
93 
94 
95 
96 
This file contains the prototypes for Roccom API.
void COM_set_verbose(int i)
Definition: roccom_c++.h:543
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
void COM_finalize()
Definition: roccom_c++.h:59
void COM_print_profile(const char *fname, const char *header)
Definition: roccom_c++.h:557
Definition: Rocin.h:64
Definition: Rocout.h:81
void COM_window_init_done(const char *w_str, int pane_changed=true)
Definition: roccom_c++.h:102
void COM_set_profiling(int i)
Definition: roccom_c++.h:550
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
Rocin creates a series of Roccom windows by reading in a list of files.
int main(int argc, char *argv[])
Definition: blastest.C:94
void COM_init(int *argc, char ***argv)
Definition: roccom_c++.h:57
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
Definition: roccom_basic.h:111
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428
#define COM_EXTERN_MODULE(moduleName)
Definition: roccom_basic.h:116
Contains declaration of the base class for Roccom implementations.