Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FluPatch Class Reference

#include <FluRegion.H>

Inheritance diagram for FluPatch:
Collaboration diagram for FluPatch:

Public Member Functions

bool InitSurfaceSoln (const string &prefix="", bool=false)
 
bool RegisterSoln (const string &, bool)
 
- Public Member Functions inherited from GEM_DomainBoundary
unsigned int NNodes (void)
 
bool SetSolverDataBlock (const std::string &wname, double *cell_data, int nval_cells, double *node_data, int nval_nodes)
 
 GEM_DomainBoundary (const GEM_DomainBoundary &db)
 
 GEM_DomainBoundary ()
 
GEM_DomainBoundaryoperator= (const GEM_DomainBoundary &db)
 
bool debug (bool s=true)
 
void report ()
 
void PopulateSurfaceArrays (const std::vector< double > &, unsigned int)
 
bool Register_com_surfmesh (const std::string &wname)
 
void Create_com_surfsoln (const std::string &wname, const std::string &fname, std::vector< double > &fvec, unsigned int ncomp, const std::string &unit)
 

Public Attributes

unsigned int _ntri
 
unsigned int _nquad
 
FluSurfSoln _soln
 
unsigned int _bcflag
 
int _constr_type
 
- Public Attributes inherited from GEM_DomainBoundary
unsigned int _id
 
unsigned int _ngtri
 
unsigned int _ngquad
 
unsigned int _nnodes
 
std::vector< unsigned int > _triconn
 
std::vector< unsigned int > _quadconn
 
std::vector< double > surface_coordinates
 
unsigned int surface_ngnodes
 
std::vector< unsigned int > surface_tri
 
std::vector< unsigned int > surface_quad
 
GEM_UserData _data
 
GEM_UserData _solver_data
 
bool _debug
 
std::ostream * _out
 
int pane_id
 

Detailed Description

Definition at line 99 of file FluRegion.H.

Member Function Documentation

bool InitSurfaceSoln ( const string &  prefix = "",
bool  = false 
)

Definition at line 882 of file FluRegion.C.

Referenced by FluRegion::InitSurfaceSoln(), and FluRegion::ReadGSPASCII().

883 {
884  string pre(prefix);
885  if(_debug && _out)
886  *_out << "FluPatch(" << _id << ")::InitSurfaceSoln Enter" << endl;
887  if(pre.empty())
888  pre = "./";
889  if(all){
890  _ntri = _triconn.size()/3;
891  _nquad = _quadconn.size()/4;
892  //#ifdef _ROCSTAR_X_
894  //#else
895  // _soln.gsp.resize(_ntri+_nquad - (_ngtri+_ngquad),0.0);
896  //#endif
897  }
898  //#ifdef _ROCSTAR_X_
899  int constraint_map[] = { 2 , 120, 121, 122, -122, -121, -120, 0};
900  // Populate the Rocstar data living on the surface
901  string fname(pre+".bc");
902  ifstream Inf;
903  Inf.open(fname.c_str());
904  if(!Inf){
905  if(_out){
906  *_out << "FluPatch::InitSurfaceSoln: Error: could not locate bc file."
907  << endl;
908  }
909  return false;
910  }
911  string line;
912  bool found_patch = false;
913  while(getline(Inf,line) && !found_patch){
914  if(line[0] != '#'){
915  string::size_type patchx = line.find("PATCH");
916  if( patchx != string::npos){
917  string tstr;
918  unsigned int ubound,lbound;
919  istringstream Istr(line);
920  Istr >> tstr >> lbound >> ubound;
921  if(_id >= lbound && _id <= ubound)
922  found_patch = true;
923  }
924  }
925  }
926  if(!found_patch){
927  if(_out){
928  *_out << "FluPatch::InitSurfaceSoln: Error: Did not find patch "
929  << _id << " in bc file." << endl;
930  }
931  return(false);
932  }
933  // Now we want to search forward for the relevant data until we encounter #
934  bool end_section = false;
935  _constr_type = 2;
936  _bcflag = 2;
937  while(getline(Inf,line) && !end_section){
938  if(line[0] == '#') end_section = true;
939  else{
940  string::size_type movx = line.find("MOVEDIR");
941  string::size_type coupx = line.find("COUPLED");
942  string::size_type burn = line.find("BFLAG");
943  if(movx != string::npos){
944  string tstr;
945  int mvdir;
946  istringstream Istr(line);
947  Istr >> tstr >> mvdir;
948  _constr_type = constraint_map[mvdir];
949  }
950  if(coupx != string::npos){
951  string tstr;
952  istringstream Istr(line);
953  Istr >> tstr >> _bcflag;
954  }
955  if(burn != string::npos){
956  string tstr;
957  unsigned int burnf = 0;
958  istringstream Istr(line);
959  Istr >> tstr >> burnf;
960  _soln._bflag.resize(_ntri+_nquad,burnf);
961  }
962  }
963  }
964  //#endif
965  Inf.close();
966  if(_debug && _out)
967  *_out << "FluPatch(" << _id << ")::InitSurfaceSoln Exit" << endl;
968  return true;
969 }
unsigned int _bcflag
Definition: FluRegion.H:107
std::vector< double > surface_coordinates
Definition: GEM.H:133
int _constr_type
Definition: FluRegion.H:108
unsigned int _ntri
Definition: FluRegion.H:102
vector< int > _bflag
Definition: FluRegion.H:75
std::vector< unsigned int > _quadconn
Definition: GEM.H:132
unsigned int _nquad
Definition: FluRegion.H:103
unsigned int _id
Definition: GEM.H:127
std::vector< unsigned int > _triconn
Definition: GEM.H:131
FluSurfSoln _soln
Definition: FluRegion.H:104
void Resize(unsigned int nfaces=0, unsigned int nvert=0)
Definition: FluRegion.H:81
std::ostream * _out
Definition: GEM.H:140

Here is the caller graph for this function:

bool RegisterSoln ( const string &  ,
bool   
)

Definition at line 1705 of file FluRegion.C.

References COM_set_array(), and COM_set_size().

Referenced by FluRegion::RegisterSurfaceSoln().

1706 {
1707  if(_debug && _out)
1708  *_out << "FluPatch(" << _id << ")::RegisterSoln: "
1709  << "Registering pane " << pane_id << "." << endl;
1710  if(_soln._gsp.size() != 0){
1711  COM_set_array((wname+".gs"),pane_id,&(_soln._gsp[0]));
1712  }
1713  bool do_t0 = (t0_coords.size() != 0);
1714  COM_set_size((wname+".patchNo"),pane_id,1);
1715  COM_set_array((wname+".patchNo"),pane_id,&_id);
1716  if(do_t0){
1717  COM_set_size((wname+"0"+".bcflag"),pane_id,1);
1718  COM_set_array((wname+"0"+".bcflag"),pane_id,&_bcflag);
1719  }
1720  COM_set_size((wname+".bcflag"),pane_id,1);
1721  COM_set_array((wname+".bcflag"),pane_id,&_bcflag);
1722  COM_set_size((wname+".constr_type"),pane_id,1);
1723  COM_set_array((wname+".constr_type"),pane_id,&_constr_type);
1724  if(all){
1725  COM_set_array((wname+".du_alp"),pane_id,&_soln._du_alp[0]);
1726  Create_com_surfsoln(wname,"rhofvf_alp",_soln._rhofvf_alp,3,"kg/(m^2s)");
1727  Create_com_surfsoln(wname,"nf_alp",_soln._nf_alp,3,"");
1728  Create_com_surfsoln(wname,"rhof_alp",_soln._rhof_alp,1,"kg/m^3");
1729  Create_com_surfsoln(wname,"pf",_soln._pf,1,"Pa");
1730  Create_com_surfsoln(wname,"qc",_soln._qc,1,"W/m^2");
1731  Create_com_surfsoln(wname,"qr",_soln._qr,1,"W/m^2");
1732  Create_com_surfsoln(wname,"tf",_soln._tf,3,"Pa");
1733  Create_com_surfsoln(wname,"Tb_alp",_soln._Tb_alp,1,"K");
1734  Create_com_surfsoln(wname,"mdot_alp",_soln._mdot_alp,1,"kg/(m^2s)");
1735  Create_com_surfsoln(wname,"Tflm_alp",_soln._Tflm_alp,1,"K");
1736  COM_set_array((wname+".bflag"),pane_id,&(_soln._bflag[0]));
1737  }
1738  return(true);
1739 }
vector< double > _du_alp
Definition: FluRegion.H:63
void Create_com_surfsoln(const std::string &wname, const std::string &fname, std::vector< double > &fvec, unsigned int ncomp, const std::string &unit)
Definition: GEM.C:426
unsigned int _bcflag
Definition: FluRegion.H:107
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
Definition: roccom_c++.h:136
int _constr_type
Definition: FluRegion.H:108
vector< int > _bflag
Definition: FluRegion.H:75
vector< double > _nf_alp
Definition: FluRegion.H:65
vector< double > _rhofvf_alp
Definition: FluRegion.H:64
vector< double > _pf
Definition: FluRegion.H:67
vector< double > _Tflm_alp
Definition: FluRegion.H:73
vector< double > _qc
Definition: FluRegion.H:68
unsigned int _id
Definition: GEM.H:127
FluSurfSoln _soln
Definition: FluRegion.H:104
vector< double > _mdot_alp
Definition: FluRegion.H:72
vector< double > _tf
Definition: FluRegion.H:70
void COM_set_array(const char *wa_str, int pane_id, void *addr, int strd=0, int cap=0)
Associates an array with an attribute for a specific pane.
Definition: roccom_c++.h:156
vector< double > _gsp
Definition: FluRegion.H:74
std::ostream * _out
Definition: GEM.H:140
vector< double > _Tb_alp
Definition: FluRegion.H:71
vector< double > _rhof_alp
Definition: FluRegion.H:66
vector< double > _qr
Definition: FluRegion.H:69

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

unsigned int _bcflag

Definition at line 107 of file FluRegion.H.

int _constr_type

Definition at line 108 of file FluRegion.H.

FluSurfSoln _soln

Definition at line 104 of file FluRegion.H.

Referenced by FluRegion::ReadGSPASCII(), and FluRegion::WriteGSPASCII().


The documentation for this class was generated from the following files: