Blockstructured Adaptive Mesh Refinement in object-oriented C++
00001 00006 #include "DCoords.h" 00007 00008 #define MATCH(s, c) while ((s).get() != (c)) 00009 00010 /*************************************************************************/ 00011 /* Static empty coords */ 00012 /*************************************************************************/ 00013 class DCoords DCoords::_empty_dcoords; 00014 /*************************************************************************/ 00015 00016 /* 00017 ************************************************************************* 00018 * * 00019 * istream& operator >> (istream& s, DCoords& c) * 00020 * * 00021 * Operator >> reads in DCoords information in the form: * 00022 * * 00023 * (c(0),c(1), ... ,c(N)). * 00024 * * 00025 ************************************************************************* 00026 */ 00027 00028 istream& operator >> (istream& s, DCoords& c) 00029 { 00030 MATCH(s, '('); s >> c(0); 00031 register int i; for (i=1;i<c.rank;i++) MATCH(s, ','); s >> c(i); 00032 MATCH(s, ')'); 00033 return(s); 00034 } 00035 00036 /* 00037 ************************************************************************* 00038 * * 00039 * ostream& operator << (ostream& s, const DCoords& c) * 00040 * * 00041 * Operator << writes the point information in p in the form: * 00042 * * 00043 * (c(0),c(1), ..., c(N)). * 00044 * * 00045 ************************************************************************* 00046 */ 00047 00048 ostream& operator << (ostream& s, const DCoords& c) 00049 { 00050 s << '(' << c(0); 00051 for (register int i=1;i<c.rank;i++) s << ',' << c(i); 00052 s << ')'; 00053 return(s); 00054 }
Quickstart Users Guide Programmers Reference Installation Examples Download
AMROC Main Home Contactlast update: 06/01/04