Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mainc.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <strstream.h>
#include <fstream.h>
#include "Mesh.hpp"
#include "Element.hpp"
#include "Face.hpp"
Include dependency graph for mainc.c:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 13 of file mainc.c.

13  {
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 }
Class Mesh is the main class that holds all information to describe the current state of the mesh...
Definition: Mesh.hpp:19