├── main.cpp ├── .gitignore ├── Makefile ├── README.md ├── tecplotread.hpp ├── tecplotread.cpp └── LICENSE /main.cpp: -------------------------------------------------------------------------------- 1 | #include "tecplotread.hpp" 2 | 3 | // this is a really simple main file 4 | int main(int argc, char* arcg[]) 5 | { 6 | assert(argc == 2); 7 | 8 | std::string filetp(arcg[1]); 9 | 10 | shared_ptr tpobj = make_shared(filetp); 11 | 12 | tpobj->complete_information(); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.bin 6 | *.app 7 | /bin/* 8 | .ccache/* 9 | 10 | # Compiled Dynamic libraries 11 | *.so 12 | *.dylib 13 | 14 | # Compiled Static libraries 15 | lib/* 16 | *.lai 17 | *.la 18 | *.a 19 | 20 | # Data file 21 | examples/* 22 | *.dat 23 | *.plt 24 | *.lay 25 | 26 | # Temp files 27 | *.cpp~ 28 | *.hpp~ 29 | Makefile~ 30 | *.swp 31 | *~ 32 | .dropbox.attr 33 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # variables 2 | COMP_C := g++ 3 | FLAGS_C := -Wall -O3 -std=c++11 4 | TARGETDIR=. 5 | 6 | main: main.o tecplotread.o 7 | $(COMP_C) $(FLAGS_C) -o main.bin main.o tecplotread.o 8 | 9 | # Compile all source files .cpp into .o files 10 | $(TARGETDIR)/%.o: $(TARGETDIR)/%.cpp 11 | $(COMP_C) $(FLAGS_C) -c $< -o $@ 12 | 13 | # Compile all source files .cpp into .o files 14 | $(TARGETDIR)/%.o: $(TARGETDIR)/%.cpp $(TARGETDIR)/%.h 15 | $(COMP_C) $(FLAGS_C) -c $< -o $@ 16 | 17 | clean: 18 | rm -f *.o; 19 | rm -f main.bin; 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Author: Philippe Miron 2 | 3 | ## Information 4 | 5 | Tecplot library to read binary files created with TECIO or from the Tecplot 360 interface. It is based on the information 6 | provided in the "Data Format Guide" available at [ftp://ftp.tecplot.com/pub/doc/tecplot/360/dataformat.pdf](ftp://ftp.tecplot.com/pub/doc/tecplot/360/dataformat.pdf). 7 | 8 | This is based on the `#!TDV112` version format. This library is not error-proof, and I have only tested this code using a handful of data files that I use regularly. 9 | 10 | ## Usage: 11 | 12 | ``` 13 | git clone https://github.com/philippemiron/tecplot-binary-read.git 14 | cd tecplot-binary-read/ 15 | make 16 | ./main.bin examples/x.plt 17 | ``` 18 | 19 | This will *print* on the console the `complete_information()` of the plt file. 20 | 21 | The printed information makes it easy to see the variable tables and names available, the number of zones, etc. 22 | 23 | 1. Retrieving the variable name(s): 24 | - `vector vars_name = tpobj->getVariableNames();` 25 | - `string var1 = tpobj->getVariableName(0);` 26 | 27 | 2. Retrieving the number of points or elements in the first zone: 28 | - `int number_points = tpobj->getZone(0)->getNumberPoints();` 29 | - `int number_elements = tpobj->getZone(0)->getNumberElements();` 30 | 31 | 3. Retrieving the variables in the data section: 32 | - if the datatype is` float`, the following would retrieve data from the first variable of the first zone: 33 | `vector var1_zone1 = tpobj->getZone(0)->getDataFloat(0);` 34 | - Or you can retrieve all the values of all variables of the first zone: 35 | `vector> vars_zone1 = tpobj->getZone(0)->getDataFloat();` 36 | 37 | All variables read by the library are available through the getter methods. Take a look at the header file. 38 | -------------------------------------------------------------------------------- /tecplotread.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | // TODO: the geometry & auxiliary class 12 | // is currently not used in the code 13 | // It has to be validate but for now 14 | // I don't have need for this :| 15 | class auxiliary 16 | { 17 | friend class zone; 18 | public: 19 | auxiliary(); 20 | ~auxiliary() {}; 21 | 22 | string auxiliary_name; 23 | int auxiliary_format; 24 | string auxiliary_value; 25 | }; 26 | 27 | class geometry 28 | { 29 | friend class tecplotread; 30 | public: 31 | geometry(); 32 | ~geometry() {}; 33 | 34 | int coord_sys; 35 | int scope; 36 | double x; // or theta 37 | double y; // or r 38 | double z; // or dummy 39 | int zone; // 0 = all 40 | int color; 41 | int fill_color; 42 | int is_filled; // 0=no 1=yes 43 | int geom_type; // 0=Line 1=Rectangle 2=Square 3=Circle 4=ellipse 44 | int line_pattern; // 0=Solid 1=Dashed 2=DashDot 3=DashDotDot 4=Dotted 5=LongDash 45 | int pattern_length; 46 | double line_thickness; 47 | int num_ellipse_pts; 48 | int arrowhead_style; // 0=Plain 1=Filled 2=Hollow 49 | int arrowhead_attachement; // 0=None 1=Beg 2=End 3=Both 50 | double arrowhead_size; 51 | double arrowhead_angle; 52 | string macro_name; 53 | int polyline_data_type; // 1= Float, 2=Double 54 | int clipping; // Clipping 0=ClipToAxes 1=ClipToViewport 2=ClipToFrame 55 | 56 | // line 57 | int number_of_polylines; 58 | int number_of_points; // line 1. 59 | vector x_float; 60 | vector x_double; 61 | vector y_float; 62 | vector y_double; 63 | vector z_float; // Grid3D Only 64 | vector z_double; // Grid3D Only 65 | }; 66 | 67 | class zone 68 | { 69 | friend class tecplotread; 70 | public: 71 | zone(); 72 | ~zone() {}; 73 | 74 | string getZoneName() const { return zone_name; }; 75 | int getParentZone() const { return parent_zone; }; 76 | int getStrandId() const { return strand_id; }; 77 | double getSolutionTime() const { return solution_time; }; 78 | int getZoneType() const { return zone_type; }; 79 | int getDataPacking() const { return data_packing; }; 80 | int getVarLocation() const { return var_location; }; 81 | vector getVarsLocation() const { return vars_location; }; 82 | int getVarsLocation(int id) const; 83 | 84 | int getFaceNeighbors() const { return face_neighbors; }; 85 | int getNumberFaceNeighbors() const { return number_face_neighbors; }; 86 | int getFaceNeighborsMode() const { return face_neighbors_mode; }; 87 | int getFeFaceNeighbors() const { return fe_face_neighbors; }; 88 | 89 | int getIMax() const { return imax; }; 90 | int getJMax() const { return jmax; }; 91 | int getKMax() const { return kmax; }; 92 | 93 | int getNumberPoints() const { return number_points; }; 94 | int getNumberFaces() const { return number_faces; }; 95 | int getTotalFaces() const { return total_faces; }; 96 | int getTotalBoundaryConnections() const { return total_boundary_connections; }; 97 | int getNumberElements() const { return number_elements; }; 98 | int getICell() const { return icell; }; 99 | int getJCell() const { return jcell; }; 100 | int getKCell() const { return kcell; }; 101 | 102 | vector getVariableFormat() const { return variable_format; }; 103 | vector> getVariableIndex() const { return variable_index; }; 104 | int getHasPassiveVariables() const { return has_passive_variables; }; 105 | vector getPassiveVariables() const { return passive_variables; }; 106 | int getHasVariableSharing() const { return has_variable_sharing; }; 107 | vector getVariableSharing() const { return passive_variables; }; 108 | int getZoneShareConnectivity() const { return zone_share_connectivity; }; 109 | vector getMinValue() const { return min_value; }; 110 | vector getMaxValue() const { return max_value; }; 111 | int getVariableFormat(int id) const; 112 | vector getVariableIndex(int id) const; 113 | int getVariableIndex(int type, int id) const; 114 | int getPassiveVariables(int id) const; 115 | int getVariableSharing(int id) const; 116 | double getMinValue(int id) const; 117 | double getMaxValue(int id) const; 118 | 119 | vector> getDataFloat() const { return data_float; }; 120 | vector> getDataDouble() const { return data_double; }; 121 | vector> getDataLongInt() const { return data_longint; }; 122 | vector> getDataInt() const { return data_int; }; 123 | vector getDataFloat(int id) const; 124 | vector getDataDouble(int id) const; 125 | vector getDataLongInt(int id) const; 126 | vector getDataInt(int id) const; 127 | vector getZoneConnectity() const { return zone_connectivity; }; 128 | 129 | private: 130 | string zone_name; 131 | int parent_zone; 132 | int strand_id; 133 | double solution_time; 134 | int not_used; 135 | int zone_type; // 0=ORDERED 1=FELINESEG 2=FETRIANGLE 3=FEQUADRILATERAL 136 | // 4=FETETRAHEDRON 5=FEBRICK 6=FEPOLYGON 7=FEPOLYHEDRON 137 | int data_packing; // 0=Block, 1=Point 138 | int var_location; 139 | vector vars_location; 140 | 141 | // face neighbors 142 | int face_neighbors; 143 | int number_face_neighbors; 144 | int face_neighbors_mode; 145 | int fe_face_neighbors; 146 | 147 | // ordered zone 148 | int imax; 149 | int jmax; 150 | int kmax; 151 | 152 | // fe zone 153 | int number_points; 154 | 155 | // if fepolygon or fepolyhedron 156 | int number_faces; 157 | int total_faces; 158 | int boundary_faces; 159 | int total_boundary_connections; 160 | int number_elements; 161 | int icell; // not used set to 0 162 | int jcell; // not used set to 0 163 | int kcell; // not used set to 0 164 | 165 | // auxiliary data name structure 166 | vector auxiliaries; 167 | 168 | // data 169 | // section i 170 | vector variable_format; 171 | vector> variable_index; 172 | int has_passive_variables; 173 | vector passive_variables; 174 | int has_variable_sharing; 175 | vector variable_sharing; 176 | int zone_share_connectivity; 177 | vector min_value; 178 | vector max_value; 179 | 180 | // data vectors 181 | // theses vectors are empty if 182 | // none variable is of one type 183 | vector> data_float; 184 | vector> data_double; 185 | vector>data_longint; 186 | vector> data_int; 187 | 188 | // section ii: specific to order zone 189 | vector face_neighbors_connections; 190 | 191 | // section iii: specific to fe zone 192 | vector zone_connectivity; 193 | }; 194 | 195 | // basic class 196 | class tecplotread 197 | { 198 | public: 199 | tecplotread(string filename); 200 | ~tecplotread(); 201 | // output information about binary file 202 | void basic_information(); 203 | void complete_information(); 204 | void zone_information(int zone_id); 205 | 206 | float getValidationMarker() const { return validation_marker; }; 207 | string getVersion() const { return version; }; 208 | int getByteOrder() const { return byte_order; }; 209 | int getFileType() const { return file_type; }; 210 | string getTitle() const { return title; }; 211 | int getNumberVariables() const { return number_variables; }; 212 | vector getVariableNames() const { return variable_names; }; 213 | 214 | string getVariableName(int id) const { 215 | assert(id >= 0 and id < int(variable_names.size())); 216 | return variable_names[id]; 217 | }; 218 | 219 | int getNumberZones() const { return zones.size(); }; 220 | zone* getZone(int id) const { 221 | assert(id >= 0 and id < int(zones.size())); 222 | return zones[id]; 223 | }; 224 | 225 | private: 226 | string ascii_to_string(); 227 | template void readbin(T& obj); 228 | template void read_zone_data(vector& values, int zone_index, int var_index); 229 | template void read_zone_connectivity(vector& values, int zone_index, int node_per_element); 230 | 231 | // iostream 232 | ifstream file; 233 | 234 | // section marker 235 | float validation_marker; 236 | 237 | // section i 238 | string version; 239 | 240 | // section ii 241 | int byte_order; 242 | 243 | // section iii 244 | int file_type; // 0=FULL 1=GRID 2=SOLUTION 245 | string title; 246 | int number_variables; 247 | vector variable_names; 248 | 249 | // section iv : zone with data 250 | // each zone is added to this 251 | // vector on read 252 | vector zones; 253 | 254 | // TODO 255 | // section v: geometries 256 | // vector geometries; 257 | }; 258 | 259 | // template to define operator << for vector 260 | template < class T > 261 | ostream& operator << (ostream& os, const vector& v) 262 | { 263 | os << "["; 264 | bool first(true); 265 | for (typename vector::const_iterator ii = v.begin(); ii != v.end(); ++ii) 266 | { 267 | if (!first) 268 | { 269 | os << ", " << *ii; 270 | } 271 | else 272 | { 273 | os << *ii; 274 | first = false; 275 | } 276 | } 277 | os << "]"; 278 | 279 | return os; 280 | } 281 | -------------------------------------------------------------------------------- /tecplotread.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Philippe Miron 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program. If not, see . 15 | */ 16 | #include "tecplotread.hpp" 17 | 18 | tecplotread::tecplotread(string filename) : 19 | validation_marker(0.0), 20 | version(""), 21 | byte_order(0), 22 | file_type(0), 23 | title("") 24 | { 25 | 26 | // open the file 27 | file.open(filename.c_str(), ifstream::binary); 28 | 29 | // validate opening of file 30 | assert(file.good()); 31 | 32 | // Header section 33 | // section i 34 | char buffer[9]; 35 | file.read (buffer, 8); 36 | buffer[8] = '\0'; 37 | version = string(buffer); 38 | if (version != "#!TDV112") 39 | cout << "Parser based on version #!TDV112, current version is: " << version << endl; 40 | 41 | // section ii 42 | readbin(byte_order); 43 | 44 | // section iii 45 | readbin(file_type); 46 | title = ascii_to_string(); 47 | readbin(number_variables); 48 | 49 | variable_names.resize(number_variables); 50 | for (int i(0); izone_name = ascii_to_string(); 61 | readbin(z->parent_zone); 62 | readbin(z->strand_id); 63 | readbin(z->solution_time); 64 | readbin(z->not_used); 65 | readbin(z->zone_type); 66 | readbin(z->data_packing); 67 | readbin(z->var_location); 68 | 69 | if (z->var_location == 1) 70 | { 71 | z->vars_location.resize(number_variables); 72 | for (int i(0); ivars_location[i]); 74 | } 75 | 76 | // face neighbors 77 | readbin(z->face_neighbors); 78 | if (z->face_neighbors == 1) 79 | { 80 | readbin(z->number_face_neighbors); 81 | if (z->number_face_neighbors != 0) 82 | { 83 | readbin(z->face_neighbors_mode); 84 | if (z->zone_type >= 1 and z->zone_type <= 7 ) 85 | readbin(z->fe_face_neighbors); 86 | } 87 | } 88 | 89 | // ordered zone 90 | if (z->zone_type == 0) 91 | { 92 | readbin(z->imax); 93 | readbin(z->jmax); 94 | readbin(z->kmax); 95 | if (z->jmax == 1 and z->kmax == 1) // 1D data 96 | z->number_elements = (z->imax-1); 97 | else if (z->kmax == 1) // 2D data 98 | z->number_elements = (z->imax-1) * (z->jmax-1); 99 | else 100 | z->number_elements = (z->imax-1) * (z->jmax-1) * (z->kmax-1); 101 | 102 | z->number_points = z->imax * z->jmax * z->kmax; 103 | } 104 | 105 | // finite element zone 106 | if (z->zone_type >= 1 and z->zone_type <= 7) 107 | { 108 | readbin(z->number_points); 109 | // only for FEPOLYGON or FEPOLYHEDRON 110 | if (z->zone_type == 6 or z->zone_type == 7) 111 | { 112 | readbin(z->number_faces); 113 | readbin(z->total_faces); 114 | readbin(z->boundary_faces); 115 | readbin(z->total_boundary_connections); 116 | } 117 | 118 | readbin(z->number_elements); 119 | readbin(z->icell); // for future used, set to zero 120 | readbin(z->jcell); // for future used, set to zero 121 | readbin(z->kcell); // for future used, set to zero 122 | } 123 | 124 | // todo create an auxiliary structure 125 | // add all the structures to a vector 126 | readbin(validation_marker); 127 | while (validation_marker == 1) 128 | { 129 | auxiliary* temp = new auxiliary; 130 | temp->auxiliary_name = ascii_to_string(); 131 | readbin(temp->auxiliary_format); // only allow 0 132 | temp->auxiliary_value = ascii_to_string(); 133 | z->auxiliaries.emplace_back(temp); 134 | } 135 | 136 | zones.emplace_back(z); 137 | 138 | // read the next marker to check if 139 | // there is more than one zone 140 | readbin(validation_marker); 141 | } // end of zone section 142 | 143 | // section v 144 | if (validation_marker == 399) 145 | { 146 | // read geometries 147 | cout << "Geometry section not implemented. Stopping." << endl; 148 | exit(-1); 149 | } 150 | // end of geometrie 151 | 152 | //////////////////////// 153 | // end of header section 154 | //////////////////////// 155 | 156 | // Data section 157 | assert(validation_marker == 357.0); 158 | for (size_t index(0); indexvariable_format.resize(number_variables); 164 | for (int i(0); ivariable_format[i]); 166 | 167 | readbin(zones[index]->has_passive_variables); 168 | zones[index]->passive_variables.resize(number_variables, 0); 169 | if (zones[index]->has_passive_variables) 170 | { 171 | for (int i(0); ipassive_variables[i]); 173 | } 174 | readbin(zones[index]->has_variable_sharing); 175 | if (zones[index]->has_variable_sharing) 176 | { 177 | zones[index]->variable_sharing.resize(number_variables); 178 | for (int i(0); ivariable_sharing[i]); 180 | } 181 | 182 | readbin(zones[index]->zone_share_connectivity); // if -1 no sharing 183 | zones[index]->min_value.resize(number_variables); 184 | zones[index]->max_value.resize(number_variables); 185 | for (int i(0); imin_value[i]); 188 | readbin(zones[index]->max_value[i]); 189 | } 190 | 191 | // read the data tables 192 | zones[index]->variable_index.resize(4); 193 | for (int i(0); ipassive_variables[i]) 196 | { 197 | switch (zones[index]->variable_format[i]) 198 | { 199 | case 1: 200 | { 201 | vector tempvalues; 202 | read_zone_data(tempvalues, index, i); 203 | zones[index]->data_float.emplace_back(tempvalues); 204 | zones[index]->variable_index[0].emplace_back(i); 205 | break; 206 | } 207 | 208 | case 2: 209 | { 210 | vector tempvalues; 211 | read_zone_data(tempvalues, index, i); 212 | zones[index]->data_double.emplace_back(tempvalues); 213 | zones[index]->variable_index[1].emplace_back(i); 214 | break; 215 | } 216 | 217 | case 3: 218 | { 219 | vector tempvalues; 220 | read_zone_data(tempvalues, index, i); 221 | zones[index]->data_longint.emplace_back(tempvalues); 222 | zones[index]->variable_index[2].emplace_back(i); 223 | break; 224 | } 225 | 226 | case 4: 227 | { 228 | vector tempvalues; 229 | read_zone_data(tempvalues, index, i); 230 | zones[index]->data_int.emplace_back(tempvalues); 231 | zones[index]->variable_index[3].emplace_back(i); 232 | break; 233 | } 234 | 235 | default: 236 | { 237 | cout << "type of data not supported: " << zones[index]->variable_format[i] << endl; 238 | exit(-1); 239 | break; 240 | } 241 | } 242 | } 243 | } 244 | 245 | // TODO: complete this part 246 | // I must say that I don't 100% understand 247 | // this section ... 248 | // specific to ordered zone 249 | /* 250 | if (zones[index]->zone_type == 0) 251 | { 252 | if (zones[index]->zone_share_connectivity == -1 and zones[index]->number_face_neighbors != 0) 253 | { 254 | // Face neighbor connections. 255 | // N = (number of miscellaneous user defined 256 | // face neighbor connections) * P 257 | // (See note 5 below). 258 | } 259 | } 260 | */ 261 | 262 | // specific to fe zone 263 | if (zones[index]->zone_type >= 1 and zones[index]->zone_type <= 7) 264 | { 265 | // not FEPOLYGON or FEPOLYHEDRON 266 | if (zones[index]->zone_type != 6 or zones[index]->zone_type != 7) 267 | { 268 | int l(0); 269 | if (zones[index]->zone_share_connectivity == -1) 270 | { 271 | // Set the number of node per element according 272 | // to the zone type. 273 | // 1=FELINESEG 2=FETRIANGLE 3=FEQUADRILATERAL 274 | // 4=FETETRAHEDRON 5=FEBRICK 275 | switch (zones[index]->zone_type) 276 | { 277 | case 1: 278 | { 279 | l = 2; 280 | break; 281 | } 282 | case 2: 283 | { 284 | l = 3; 285 | break; 286 | } 287 | case 3: 288 | { 289 | l = 4; 290 | break; 291 | } 292 | case 4: 293 | { 294 | l = 4; 295 | break; 296 | } 297 | case 5: 298 | { 299 | l = 8; 300 | break; 301 | } 302 | default: 303 | { 304 | cout << "element type unknown << (" << zones[index]->zone_type << "), can't read connectivity." << endl; 305 | exit(-1); 306 | break; 307 | } 308 | } 309 | read_zone_connectivity(zones[index]->zone_connectivity, index, l); 310 | } 311 | 312 | } 313 | 314 | // TODO: other section to complete 315 | // 6=FEPOLYGON 7=FEPOLYHEDRON 316 | //else 317 | //{ 318 | 319 | //} 320 | } 321 | } 322 | }; 323 | 324 | // method to read a data type from a binary file 325 | template 326 | void tecplotread::readbin(T& obj) { 327 | file.read(reinterpret_cast(addressof(obj)), sizeof(T)); 328 | } 329 | 330 | template 331 | void tecplotread::read_zone_data(vector& values, int zoneindex, int varindex) 332 | { 333 | // all variables located at nodes 334 | if (zones[zoneindex]->var_location == 0) 335 | { 336 | values.resize(zones[zoneindex]->number_points); 337 | } 338 | else 339 | { 340 | // if not we have to look at the location of 341 | // each particular variables 342 | if (zones[zoneindex]->vars_location[varindex] == 0) 343 | { 344 | values.resize(zones[zoneindex]->number_points); 345 | } 346 | else 347 | { 348 | values.resize(zones[zoneindex]->number_elements); 349 | } 350 | } 351 | 352 | for (size_t i(0); i 357 | void tecplotread::read_zone_connectivity(vector& values, int zoneindex, int node_per_element) 358 | { 359 | // resize vector 360 | values.resize(zones[zoneindex]->number_elements * node_per_element); 361 | 362 | for (size_t i(0); izone_name << endl; 405 | cout << "parent_zone: " << zones[i]->parent_zone << endl; 406 | cout << "strand_id: " << zones[i]->strand_id << endl; 407 | cout << "solution_time: " << zones[i]->solution_time << endl; 408 | cout << "not_used: " << zones[i]->not_used << endl; 409 | cout << "zone_type: " << zones[i]->zone_type << endl; 410 | cout << "data_packing: " << zones[i]->data_packing << endl; 411 | cout << "var_location: " << zones[i]->var_location << endl; 412 | cout << "vars_location: " << zones[i]->vars_location << endl; 413 | cout << "face_neighbors: " << zones[i]->face_neighbors << endl; 414 | cout << "number_face_neighbors: " << zones[i]->number_face_neighbors << endl; 415 | cout << "imax: " << zones[i]->imax << endl; 416 | cout << "jmax: " << zones[i]->jmax << endl; 417 | cout << "kmax: " << zones[i]->kmax << endl; 418 | cout << "number_points: " << zones[i]->number_points << endl; 419 | cout << "number_faces: " << zones[i]->number_faces << endl; 420 | cout << "total_faces: " << zones[i]->total_faces << endl; 421 | cout << "boundary_faces: " << zones[i]->boundary_faces << endl; 422 | cout << "total_boundary_connections: " << zones[i]->total_boundary_connections << endl; 423 | cout << "number_elements: " << zones[i]->number_elements << endl; 424 | cout << "icell: " << zones[i]->icell << endl; 425 | cout << "jcell: " << zones[i]->jcell << endl; 426 | cout << "kcell: " << zones[i]->kcell << endl; 427 | cout << "variable_format: " << zones[i]->variable_format << endl; 428 | cout << "has_passive_variables: " << zones[i]->has_passive_variables << endl; 429 | cout << "passive_variable: " << zones[i]->passive_variables << endl; 430 | cout << "has_variable_sharing: " << zones[i]->has_variable_sharing << endl; 431 | cout << "variable_sharing: " << zones[i]->variable_sharing << endl; 432 | cout << "zone_share_connectivity: " << zones[i]->zone_share_connectivity << endl; 433 | cout << "min_value: " << zones[i]->min_value << endl; 434 | cout << "max_value: " << zones[i]->max_value << endl; 435 | cout << "Size of the float vector: " << zones[i]->data_float.size() << endl; 436 | for (size_t j(0); jdata_float.size(); j++) 437 | cout << "\t" << "[" << j << "]: " << variable_names[zones[i]->variable_index[0][j]] << " " << zones[i]->data_float[j].size() << " values." << endl; 438 | cout << "Size of the double vector: " << zones[i]->data_double.size() << endl; 439 | for (size_t j(0); jdata_double.size(); j++) 440 | cout << "\t" << "[" << j << "]: " << variable_names[zones[i]->variable_index[1][j]] << " " << zones[i]->data_double[j].size() << " values." << endl; 441 | cout << "Size of the long int vector: " << zones[i]->data_longint.size() << endl; 442 | for (size_t j(0); jdata_longint.size(); j++) 443 | cout << "\t" << "[" << j << "]: " << variable_names[zones[i]->variable_index[2][j]] << " " << zones[i]->data_longint[j].size() << " values." << endl; 444 | cout << "Size of the int vector: " << zones[i]->data_int.size() << endl; 445 | for (size_t j(0); jdata_int.size(); j++) 446 | cout << "\t" << "[" << j << "]: " << variable_names[zones[i]->variable_index[3][j]] << " " << zones[i]->data_int[j].size() << " values." << endl; 447 | if (zones[i]->zone_share_connectivity == -1) 448 | cout << "Size of connectivity: " << zones[i]->zone_connectivity.size() << endl; 449 | cout << endl; 450 | 451 | } 452 | } 453 | 454 | void tecplotread::zone_information(int zone_id) 455 | { 456 | // Validation 457 | cout << "Information of zones: " << zone_id << endl; 458 | cout << "version: " << version << endl; 459 | cout << "byte_order: " << byte_order << endl; 460 | cout << "file_type: " << file_type << endl; 461 | cout << "title: " << title << endl; 462 | cout << "number_variables: " << number_variables << endl; 463 | cout << "variable_names: " << variable_names << endl; 464 | 465 | // zone stats 466 | cout << "zonename: " << zones[zone_id]->zone_name << endl; 467 | cout << "parent_zone: " << zones[zone_id]->parent_zone << endl; 468 | cout << "strand_id: " << zones[zone_id]->strand_id << endl; 469 | cout << "solution_time: " << zones[zone_id]->solution_time << endl; 470 | cout << "not_used: " << zones[zone_id]->not_used << endl; 471 | cout << "zone_type: " << zones[zone_id]->zone_type << endl; 472 | cout << "data_packing: " << zones[zone_id]->data_packing << endl; 473 | cout << "var_location: " << zones[zone_id]->var_location << endl; 474 | cout << "vars_location: " << zones[zone_id]->vars_location << endl; 475 | cout << "face_neighbors: " << zones[zone_id]->face_neighbors << endl; 476 | cout << "number_face_neighbors: " << zones[zone_id]->number_face_neighbors << endl; 477 | cout << "imax: " << zones[zone_id]->imax << endl; 478 | cout << "jmax: " << zones[zone_id]->jmax << endl; 479 | cout << "kmax: " << zones[zone_id]->kmax << endl; 480 | cout << "number_points: " << zones[zone_id]->number_points << endl; 481 | cout << "number_faces: " << zones[zone_id]->number_faces << endl; 482 | cout << "total_faces: " << zones[zone_id]->total_faces << endl; 483 | cout << "boundary_faces: " << zones[zone_id]->boundary_faces << endl; 484 | cout << "total_boundary_connections: " << zones[zone_id]->total_boundary_connections << endl; 485 | cout << "number_elements: " << zones[zone_id]->number_elements << endl; 486 | cout << "icell: " << zones[zone_id]->icell << endl; 487 | cout << "jcell: " << zones[zone_id]->jcell << endl; 488 | cout << "kcell: " << zones[zone_id]->kcell << endl; 489 | cout << "variable_format: " << zones[zone_id]->variable_format << endl; 490 | cout << "has_passive_variable: " << zones[zone_id]->has_passive_variables << endl; 491 | cout << "passive_variable: " << zones[zone_id]->passive_variables << endl; 492 | cout << "has_variable_sharing: " << zones[zone_id]->has_variable_sharing << endl; 493 | cout << "variable_sharing: " << zones[zone_id]->variable_sharing << endl; 494 | cout << "zone_share_connectivity: " << zones[zone_id]->zone_share_connectivity << endl; 495 | cout << "min_value: " << zones[zone_id]->min_value << endl; 496 | cout << "max_value: " << zones[zone_id]->max_value << endl; 497 | cout << "Size of the float vector: " << zones[zone_id]->data_float.size() << endl; 498 | for (size_t j(0); jdata_float.size(); j++) 499 | cout << "\t" << "[" << j << "]: " << variable_names[zones[zone_id]->variable_index[0][j]] << " " << zones[zone_id]->data_float[j].size() << " values." << endl; 500 | cout << "Size of the double vector: " << zones[zone_id]->data_double.size() << endl; 501 | for (size_t j(0); jdata_double.size(); j++) 502 | cout << "\t" << "[" << j << "]: " << variable_names[zones[zone_id]->variable_index[1][j]] << " " << zones[zone_id]->data_double[j].size() << " values." << endl; 503 | cout << "Size of the long int vector: " << zones[zone_id]->data_longint.size() << endl; 504 | for (size_t j(0); jdata_longint.size(); j++) 505 | cout << "\t" << "[" << j << "]: " << variable_names[zones[zone_id]->variable_index[2][j]] << " " << zones[zone_id]->data_longint[j].size() << " values." << endl; 506 | cout << "Size of the int vector: " << zones[zone_id]->data_int.size() << endl; 507 | for (size_t j(0); jdata_int.size(); j++) 508 | cout << "\t" << "[" << j << "]: " << variable_names[zones[zone_id]->variable_index[3][j]] << " " << zones[zone_id]->data_int[j].size() << " values." << endl; 509 | if (zones[zone_id]->zone_share_connectivity == -1) 510 | cout << "Size of connectivity: " << zones[zone_id]->zone_connectivity.size() << endl; 511 | cout << endl; 512 | } 513 | 514 | tecplotread::~tecplotread() 515 | { 516 | // delete all the created zones 517 | for (size_t i(0); i(&ascii), sizeof(ascii)); 537 | } 538 | 539 | return value; 540 | }; 541 | 542 | zone::zone() : 543 | zone_name(""), 544 | parent_zone(0), 545 | strand_id(0), 546 | solution_time(0.0), 547 | not_used(0), 548 | zone_type(0), 549 | data_packing(0), 550 | var_location(0), 551 | face_neighbors(0), 552 | number_face_neighbors(0), 553 | face_neighbors_mode(0), 554 | fe_face_neighbors(0), 555 | imax(0), 556 | jmax(0), 557 | kmax(0), 558 | number_points(0), 559 | number_faces(0), 560 | total_faces(0), 561 | boundary_faces(0), 562 | total_boundary_connections(0), 563 | number_elements(0), 564 | icell(0), 565 | jcell(0), 566 | kcell(0), 567 | has_passive_variables(0), 568 | has_variable_sharing(0), 569 | zone_share_connectivity(0) 570 | {}; 571 | 572 | int zone::getVariableFormat(int id) const { 573 | assert(id >= 0 and id < int(variable_format.size())); 574 | return variable_format[id]; 575 | }; 576 | 577 | vector zone::getVariableIndex(int id) const { 578 | assert(id >= 0 and id < int(variable_index.size())); 579 | return variable_index[id]; 580 | }; 581 | 582 | int zone::getVariableIndex(int type, int id) const { 583 | assert(type >= 0 and type < int(variable_index.size())); 584 | assert(id >= 0 and id < int(variable_index[type].size())); 585 | return variable_index[type][id]; 586 | }; 587 | 588 | int zone::getPassiveVariables(int id) const { 589 | assert(id >= 0 and id < int(passive_variables.size())); 590 | return passive_variables[id]; 591 | }; 592 | 593 | int zone::getVariableSharing(int id) const { 594 | assert(id >= 0 and id < int(variable_sharing.size())); 595 | return variable_sharing[id]; 596 | }; 597 | 598 | double zone::getMinValue(int id) const { 599 | assert(id >= 0 and id < int(min_value.size())); 600 | return min_value[id]; 601 | }; 602 | 603 | double zone::getMaxValue(int id) const { 604 | assert(id >= 0 and id < int(max_value.size())); 605 | return max_value[id]; 606 | }; 607 | 608 | int zone::getVarsLocation(int id) const { 609 | assert(id >= 0 and id < int(vars_location.size())); 610 | return vars_location[id]; 611 | }; 612 | 613 | vector zone::getDataFloat(int id) const { 614 | assert(id >= 0 and id < int(data_float.size())); 615 | return data_float[id]; 616 | }; 617 | vector zone::getDataDouble(int id) const { 618 | assert(id >= 0 and id < int(data_double.size())); 619 | return data_double[id]; 620 | }; 621 | vector zone::getDataLongInt(int id) const { 622 | assert(id >= 0 and id < int(data_longint.size())); 623 | return data_longint[id]; 624 | }; 625 | vector zone::getDataInt(int id) const { 626 | assert(id >= 0 and id < int(data_int.size())); 627 | return data_int[id]; 628 | }; 629 | 630 | auxiliary::auxiliary() : 631 | auxiliary_name(""), 632 | auxiliary_format(-1), 633 | auxiliary_value("") 634 | {}; 635 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 489 | USA 490 | 491 | Also add information on how to contact you by electronic and paper mail. 492 | 493 | You should also get your employer (if you work as a programmer) or your 494 | school, if any, to sign a "copyright disclaimer" for the library, if 495 | necessary. Here is a sample; alter the names: 496 | 497 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 498 | library `Frob' (a library for tweaking knobs) written by James Random 499 | Hacker. 500 | 501 | , 1 April 1990 502 | Ty Coon, President of Vice 503 | 504 | That's all there is to it! 505 | --------------------------------------------------------------------------------