Data Structures | |
| struct | TRecord |
Typedefs | |
| typedef std::vector< int > | TNodeLabels |
| typedef int | TElementLab |
| typedef std::map< TElementLab, TRecord > | TDataSet |
Functions | |
| void | Read (std::ifstream &in_stream, TDataSet &theDataSet) |
| void | Write (std::ofstream &out_stream, const TDataSet &theDataSet) |
| bool | IsBeam (int theFeDescriptorId) |
| bool | IsFace (int theFeDescriptorId) |
| bool | IsVolume (int theFeDescriptorId) |
| typedef std::map<TElementLab,TRecord> UNV2412.TDataSet |
Definition at line 53 of file UNV2412_Structure.hxx.
| typedef int UNV2412.TElementLab |
Definition at line 52 of file UNV2412_Structure.hxx.
| typedef std::vector<int> UNV2412.TNodeLabels |
Definition at line 35 of file UNV2412_Structure.hxx.
Definition at line 290 of file UNV2412_Structure.cxx.
Referenced by DriverUNV_R_SMDS_Mesh.Perform(), Read(), and Write().
{
switch (theFeDescriptorId){
case 11: // edge with 2 nodes
case 21:
case 22: // edge with 3 nodes
case 23: // curved beam
case 24:
case 25:
return true;
}
return false;
}
Definition at line 304 of file UNV2412_Structure.cxx.
Referenced by DriverUNV_R_SMDS_Mesh.Perform().
{
return ( 41 <= theFeDescriptorId && theFeDescriptorId <= 96 );
// switch (theFeDescriptorId){
// case 71: // TRI3
// case 72:
// case 74:
// case 41: // Plane Stress Linear Triangle - TRI3
// case 51: // Plane Strain Linear Triangle
// case 91: // Thin Shell Linear Triangle - TRI3
// case 42: // Plane Stress Quadratic Triangle - TRI6
// case 52: // Plane Strain Parabolic Triangle
// case 92: // Thin Shell Quadratic Triangle - TRI6
// case 43: // Plane Stress Cubic Triangle
// case 44: // Plane Stress Linear Quadrilateral - QUAD4
// case 94: // Thin Shell Linear Quadrilateral - QUAD4
// case 45: // Plane Stress Quadratic Quadrilateral - QUAD8
// case 95: // Thin Shell Quadratic Quadrilateral - QUAD8
// case 46: // Plane Stress Cubic Quadrilateral
// return true;
// }
// return false;
}
Definition at line 336 of file UNV2412_Structure.cxx.
Referenced by DriverUNV_R_SMDS_Mesh.Perform().
{
//if(!IsBeam(theFeDescriptorId) && !IsFace(theFeDescriptorId))
// return true;
switch (theFeDescriptorId){
case 111: // Solid Linear Tetrahedron - TET4
case 118: // Solid Quadratic Tetrahedron - TET10
case 112: // Solid Linear Prism - PRISM6
case 113: // Solid Quadratic Prism - PRISM15
case 115: // Solid Linear Brick - HEX8
case 116: // Solid Quadratic Brick - HEX20
case 117: // Solid Cubic Brick
case 114: // pyramid of 13 nodes (quadratic)
return true;
}
return false;
}
| void UNV2412::Read | ( | std::ifstream & | in_stream, |
| TDataSet & | theDataSet | ||
| ) |
Definition at line 194 of file UNV2412_Structure.cxx.
References _label_dataset, UNV2412.TRecord.beam_aft_end, UNV2412.TRecord.beam_fore_end, UNV2412.TRecord.beam_orientation, UNV.beginning_of_dataset(), UNV2412.TRecord.color, EXCEPTION, UNV2412.TRecord.fe_descriptor_id, IsBeam(), UNV2412.TRecord.mat_prop_tab_num, UNV2412.TRecord.node_labels, and UNV2412.TRecord.phys_prop_tab_num.
{
if(!in_stream.good())
EXCEPTION(runtime_error,"ERROR: Input file not good.");
/*
* adjust the \p istream to our
* position
*/
if(!beginning_of_dataset(in_stream,_label_dataset))
EXCEPTION(runtime_error,"ERROR: Could not find "<<_label_dataset<<" dataset!");
TElementLab aLabel;
for(; !in_stream.eof();){
in_stream >> aLabel ;
if(aLabel == -1){
// end of dataset is reached
break;
}
int n_nodes;
TRecord aRec;
in_stream>>aRec.fe_descriptor_id;
in_stream>>aRec.phys_prop_tab_num;
in_stream>>aRec.mat_prop_tab_num;
in_stream>>aRec.color;
in_stream>>n_nodes;
if(IsBeam(aRec.fe_descriptor_id)){
in_stream>>aRec.beam_orientation;
in_stream>>aRec.beam_fore_end;
in_stream>>aRec.beam_aft_end;
}
aRec.node_labels.resize(n_nodes);
for(int j=0; j < n_nodes; j++){
// read node labels
in_stream>>aRec.node_labels[j];
}
theDataSet.insert(TDataSet::value_type(aLabel,aRec));
}
}
| void UNV2412::Write | ( | std::ofstream & | out_stream, |
| const TDataSet & | theDataSet | ||
| ) |
Definition at line 240 of file UNV2412_Structure.cxx.
References _label_dataset, UNV2412.TRecord.beam_aft_end, UNV2412.TRecord.beam_fore_end, UNV2412.TRecord.beam_orientation, UNV2412.TRecord.color, EXCEPTION, UNV2412.TRecord.fe_descriptor_id, IsBeam(), UNV2412.TRecord.mat_prop_tab_num, UNV2412.TRecord.node_labels, and UNV2412.TRecord.phys_prop_tab_num.
{
if(!out_stream.good())
EXCEPTION(runtime_error,"ERROR: Output file not good.");
/*
* Write beginning of dataset
*/
out_stream<<" -1\n";
out_stream<<" "<<_label_dataset<<"\n";
TDataSet::const_iterator anIter = theDataSet.begin();
for(; anIter != theDataSet.end(); anIter++){
const TElementLab& aLabel = anIter->first;
const TRecord& aRec = anIter->second;
out_stream<<std::setw(10)<<aLabel; /* element ID */
out_stream<<std::setw(10)<<aRec.fe_descriptor_id; /* type of element */
out_stream<<std::setw(10)<<aRec.phys_prop_tab_num;
out_stream<<std::setw(10)<<aRec.mat_prop_tab_num;
out_stream<<std::setw(10)<<aRec.color;
out_stream<<std::setw(10)<<aRec.node_labels.size()<<std::endl; /* No. of nodes per element */
if(IsBeam(aRec.fe_descriptor_id)){
out_stream<<std::setw(10)<<aRec.beam_orientation;
out_stream<<std::setw(10)<<aRec.beam_fore_end;
out_stream<<std::setw(10)<<aRec.beam_aft_end<<std::endl;
}
int n_nodes = aRec.node_labels.size();
int iEnd = (n_nodes-1)/8 + 1;
for(int i = 0, k = 0; i < iEnd; i++){
int jEnd = n_nodes - 8*(i+1);
if(jEnd < 0)
jEnd = 8 + jEnd;
else
jEnd = 8;
for(int j = 0; j < jEnd ; k++, j++){
out_stream<<std::setw(10)<<aRec.node_labels[k];
}
out_stream<<std::endl;
}
}
/*
* Write end of dataset
*/
out_stream<<" -1\n";
}