Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mainc.c
Go to the documentation of this file.
1 
2 
3 /* A "C" main */
4 
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <strstream.h>
8 #include <fstream.h>
9 #include "Mesh.hpp"
10 #include "Element.hpp"
11 #include "Face.hpp"
12 
13 int main( int argc, char** argv){
14 
15  if( argc < 4 || argc > 5){
16  cerr << "Wrong format. Should be:\n"
17  << argv[0] << " [file name] [type1] [type2] <type3>\n";
18  exit(-1);
19  }
20  Mesh mesh;
21  ifstream ifs( argv[1] );
22  ifs >> mesh;
23  int type1 = atoi( argv[2] );
24  int type2 = atoi( argv[3] );
25  int type3 = -1;
26  if( argc == 5 ){
27  type3 = atoi( argv[4] );
28  }
29 
30  mesh.addCohesive( type1, type2, type3);
31 
32  char line[80];
33  ostrstream str(line,sizeof(line));
34  str << argv[1] <<"." << "coh"<< '\0';
35  ofstream ocohesive( str.str() );
36  ocohesive << mesh;
37 
38  char line1[80];
39  ostrstream str1(line1,sizeof(line1));
40  str1 << argv[1] <<"." << "bound"<< '\0';
41  ofstream obound( str1.str() );
42  mesh.write_boundary( obound );
43 
44  return(0);
45 }
46 
47 
48 
Class Mesh is the main class that holds all information to describe the current state of the mesh...
Definition: Mesh.hpp:19
int main(int argc, char *argv[])
Definition: blastest.C:94