37 if (
_base->size_of_nodes()==0)
return;
40 if (
_base->is_structured())
43 std::vector< const COM::Connectivity*> elems;
44 _base->elements( elems);
46 if ( elems.size() == 1 && elems[0]->size_of_edges_pe() == 3)
55 static void write_attr( std::ostream &os,
const COM::Attribute *attr,
int i) {
56 const int dim = attr->size_of_components();
57 switch ( attr->data_type()) {
60 const double *values =
reinterpret_cast<const double*
>(attr->pointer());
61 for (
int j=0;
j<dim; ++
j) os <<
' ' << values[i*dim+
j];
66 const float *values =
reinterpret_cast<const float*
>(attr->pointer());
67 for (
int j=0;
j<dim; ++
j) os <<
' ' << values[i*dim+
j];
72 const int *values =
reinterpret_cast<const int*
>(attr->pointer());
73 for (
int j=0;
j<dim; ++
j) os <<
' ' << values[i*dim+
j];
77 assert(
false); abort();
83 write_tec_ij( std::ostream &os,
const COM::Attribute *attr)
const {
88 os <<
"TITLE = \"" << attr->name() <<
"\" \n";
90 os <<
"TITLE = \"Structured mesh\" \n";
91 os <<
"VARIABLES = \"X\", \"Y\", \"Z\"";
93 const int MAXDIM=4, dim=attr->size_of_components();
94 const char vname[MAXDIM+1]=
"UVWT";
96 for (
int i=0;
i<dim; ++
i)
97 os <<
", \"" << vname[
i] <<
"\"";
99 os <<
"\nZONE I=" <<
_base->size_i()
100 <<
", J=" <<
_base->size_j() <<
", F=POINT\n";
104 for (
int i=0,
n=
_base->size_of_nodes();
i<
n; ++
i) {
105 os << p[3*
i] <<
' ' << p[3*
i+1] <<
' ' << p[3*
i+2];
115 const COM::Attribute *attr)
const {
119 os <<
"TITLE = \"" << attr->name() <<
"\" \n";
121 os <<
"TITLE = \"Triangular finite element mesh\" \n";
122 os <<
"VARIABLES = \"X\", \"Y\", \"Z\"";
124 const int MAXDIM=4, dim=attr->size_of_components();
125 const char vname[MAXDIM+1]=
"UVWT";
127 for (
int i=0;
i<dim; ++
i)
128 os <<
", \"" << vname[
i] <<
"\"";
130 os <<
"\nZONE N=" <<
_base->size_of_nodes() <<
", E="
131 <<
_base->size_of_elements() <<
", F=FEPOINT, ET=TRIANGLE\n";
135 for (
int i=0,
n=
_base->size_of_nodes();
i<
n; ++
i) {
136 os << p[3*
i] <<
' ' << p[3*
i+1] <<
' ' << p[3*
i+2];
143 const int *e = ec.pointer();
144 int nn = ec.size_of_nodes_pe();
145 for (
unsigned int i=0, n=
_base->size_of_elements();
i<
n; ++
i)
146 { os << e[nn*
i] <<
' ' << e[nn*
i+1] <<
' ' << e[nn*
i+2] << std::endl; }
152 const std::vector<const COM::Connectivity*> &elems,
153 const COM::Attribute *attr)
const {
157 os <<
"TITLE = \"" << attr->name() <<
"\" \n";
159 os <<
"TITLE = \"Triangular finite element mesh\" \n";
160 os <<
"VARIABLES = \"X\", \"Y\", \"Z\"";
162 const int MAXDIM=4, dim=attr->size_of_components();
163 const char vname[MAXDIM+1]=
"UVWT";
165 for (
int i=0;
i<dim; ++
i)
166 os <<
", \"" << vname[
i] <<
"\"";
168 os <<
"\nZONE N=" <<
_base->size_of_nodes() <<
", E="
169 <<
_base->size_of_elements() <<
", F=FEPOINT, ET=QUADRILATERAL\n";
173 for (
int i=0,
n=
_base->size_of_nodes();
i<
n; ++
i) {
174 os << p[3*
i] <<
' ' << p[3*
i+1] <<
' ' << p[3*
i+2];
181 for ( std::vector<const COM::Connectivity*>::const_iterator
182 it = elems.begin(); it != elems.end(); ++it) {
183 const int *e = (*it)->pointer();
184 int nn = (*it)->size_of_nodes_pe();
185 switch ( (*it)->size_of_edges_pe()) {
187 for (
int i=0,n=(*it)->size_of_elements();
i<
n; ++
i)
188 { os << e[nn*
i] <<
' ' << e[nn*
i+1] <<
' '
189 << e[nn*
i+2] <<
' ' << e[nn*
i+2] << std::endl; }
192 for (
int i=0, n=(*it)->size_of_elements();
i<
n; ++
i)
193 { os << e[nn*
i] <<
' ' << e[nn*
i+1] <<
' '
194 << e[nn*
i+2] <<
' ' << e[nn*
i+3] << std::endl; }
209 os <<
"TITLE = \"Triangular subdivision mesh\" \n";
210 os <<
"VARIABLES = \"X\", \"Y\", \"Z\"";
218 os << p.
x() <<
' ' << p.
y() <<
' ' << p.
z() << std::endl;
236 std::ofstream os( (std::string( prefix) +
".plt").c_str());
RFC_assertion(os);
238 os.setf( std::ios::scientific, std::ios::floatfield);
239 for (Pane_set::const_iterator
254 std::ofstream os( (std::string( prefix) +
".plt").c_str());
RFC_assertion(os);
256 os.setf( std::ios::scientific, std::ios::floatfield);
257 for (Pane_set::const_iterator
void write_tec_ascii(std::ostream &os, const COM::Attribute *attr=0) const
Base * _base
Reference to its base object.
const RFC_Pane_base & pane(const int pid) const
void write_tec_sub(std::ostream &) const
std::vector< Three_tuple< int > > _subfaces
void write_tec_ascii(const char *prefix) const
Ouptut a mesh in Tecplot format.
bool is_master() const
Is this pane a master copy?
int size_of_subnodes() const
The total number of nodes in the subdivision of the pane.
The base implementation of RFC_Pane.
#define RFC_END_NAME_SPACE
void write_tec_tri(std::ostream &, const COM::Connectivity &, const COM::Attribute *a=0) const
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode iend
static void write_attr(std::ostream &os, const COM::Attribute *attr, int i)
#define RFC_BEGIN_NAME_SPACE
Point_3 get_point_of_subnode(int id) const
void write_tec_ij(std::ostream &, const COM::Attribute *a=0) const
int size_of_subfaces() const
The total number of faces in the subdivision of the pane.
void write_tec_sub(const char *prefix) const
Ouptut a subdivision of a mesh in Tecplot format.
Pane_set _pane_set
The set of panes contained in the window.
IO::Mode set_ascii_mode(std::ios &i)
void write_tec_mixed(std::ostream &, const std::vector< const COM::Connectivity * > &, const COM::Attribute *a=0) const