35 write(std::ostream& os,
const int t) {
36 os.write((
char*)&t,
sizeof(
int));
40 read(std::istream& is,
int& t) {
41 is.read((
char*)&t,
sizeof(
int));
77 os.write( (
char *)&three,
sizeof(
Real));
87 os.write( (
const char*)p, 3*
_base->size_of_nodes()*
sizeof(
Real));
89 if (
_base->is_structured()) {
95 std::vector< const COM::Connectivity*> elems;
96 _base->elements( elems);
97 write( os, elems.size());
99 for ( std::vector<const COM::Connectivity*>::const_iterator
100 it = elems.begin(); it != elems.end(); ++it) {
101 write( os, (*it)->size_of_nodes_pe());
102 write( os, (*it)->size_of_elements());
104 const int *e = (*it)->pointer();
105 const int nn = (*it)->size_of_nodes_pe();
106 os.write( (
const char*)e, (*it)->size_of_elements()*nn*
sizeof(int));
112 for ( B2v_table::const_iterator
114 const B2v &b2v = it->second;
118 os.write( (
const char*)&b2v[0], n*
sizeof(b2v[0]));
121 for ( V2b_table::const_iterator
123 write( os, it->first);
124 write( os, it->second.first);
125 write( os, it->second.second);
163 read_binary( std::istream &is, std::vector <int> *b2v_all, COM::Pane *pn_in) {
172 bool need_swap = (t1 != 1);
176 is.read( (
char*)&version,
sizeof(
Real));
187 if ( pn != NULL) pn->set_size( pn->attribute(
COM::COM_NC), t1, 0);
194 int n=3*
_base->size_of_nodes();
195 std::vector< Real> buf( n);
196 is.read( (
char*)&buf.front(), n*
sizeof(
Real));
200 int ntypes, is_structured=
false;
202 for (
int i=0;
i<ntypes; ++
i) {
210 read( is, dims[0]);
read( is, dims[1]);
214 COM::Connectivity *conn = pn->connectivity(
":st2:");
215 pn->reinit_conn( conn, COM::Pane::OP_SET, &t, 0, 0);
225 case 3: elem=
":t3:";
break;
226 case 4: elem=
":q4:";
break;
227 case 6: elem=
":t6:";
break;
228 case 8: elem=
":q8:";
break;
229 case 9: elem=
":q9:";
break;
233 COM::Connectivity *conn=pn->connectivity( elem);
234 pn->set_size( conn, t2, 0);
235 pn->reinit_conn( conn, COM::Pane::OP_RESIZE, &buf, 0, 0);
237 is.read( (
char*)buf, n*
sizeof(
int));
242 for (
int i=0;
i<
n; ++
i) is.read( (
char*)&t,
sizeof(
int));
250 if ( b2v_all) b2v_all->reserve(t1);
251 for (
int i=0;
i<t1; ++
i) {
257 is.read( (
char*)&b2v[0], n*
sizeof(b2v[0]));
262 b2v_all->push_back( pane_id); b2v_all->push_back( n);
263 b2v_all->insert( b2v_all->end(), b2v.begin(), b2v.end());
268 for (
int i=0;
i<t1; ++
i) {
291 for (
int j=0;
j<
n; ++
j) {
299 for (
int j=0;
j<
n; ++
j) {
307 for (
int j=0;
j<
n; ++
j) {
316 for (
int j=0;
j<
n; ++
j) {
323 for (
int j=0;
j<
n; ++
j) {
329 for (
int j=0;
j<
n; ++
j) {
void swap(int &a, int &b)
void write_binary(std::ostream &os) const
void comp_nat_coors()
Compute the natural coordinates.
Base * _base
Reference to its base object.
int size_of_faces() const
The total number of faces in the pane.
std::vector< Three_tuple< int > > _subfaces
std::vector< Edge_ID > _subnode_parents
Edge ids of parents.
#define RFC_END_NAME_SPACE
void read_binary(std::istream &is, std::vector< int > *b2v_all=NULL, COM::Pane *p=NULL)
**********************************************************************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
void write(std::ostream &os, const T &t, const io_Read_write &)
int size_of_nodes() const
The total number of nodes in the pane.
#define RFC_BEGIN_NAME_SPACE
std::vector< Node_ID > _subnode_counterparts
Ids of counterparts of subnodes.
#define RFC_assertion_code
int _color
Is a node on border?
std::vector< int > _subface_parents
Face ids of the parents of the subfaces.
std::vector< int > _subface_offsets
Offsets of first subfaces contained in a face.
void read(std::istream &is, T &t, const io_Read_write &)
std::vector< Point_2S > _subnode_nat_coors
Natual coordinates in the parent face.
void swap_endian(short int &t)
std::vector< int > B2v
From local boundary ids to node ids.
std::vector< Face_ID > _subface_counterparts
Ids of counterparts of faces.