gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
14 FILE *fp =
Fopen(name.c_str(),
"rb");
16 Msg::Error(
"Unable to open file '%s'", name.c_str());
22 if(!fgets(str,
sizeof(str), fp)) {
26 if(!strncmp(&str[1],
"NOD", 3) || !strncmp(&str[1],
"NOE", 3)) {
34 while(str[0] !=
'$') {
35 if(!fgets(str,
sizeof(str), fp) || feof(fp))
break;
41 if(!strncmp(&str[1],
"MeshFormat", 10)) {
42 if(!fgets(str,
sizeof(str), fp)) {
48 if(sscanf(str,
"%lf %d %d", &version, &format, &size) != 3) {
53 if(version < 3.0) {
return _readMSH2(name); }
54 else if(version < 4.0) {
57 else if(version < 5.0) {
61 Msg::Error(
"Unknown MSH file version %g", version);
67 if(!fgets(str,
sizeof(str), fp) || feof(fp))
break;
68 }
while(str[0] !=
'$');
77 bool saveAll,
bool saveParametric,
double scalingFactor,
78 int elementStartNum,
int saveSinglePartition,
bool append)
81 Msg::Warning(
"Saving a partitioned mesh in a format older than 4.0 may "
82 "cause information loss");
86 return _writeMSH2(name, version, binary, saveAll, saveParametric,
87 scalingFactor, elementStartNum, saveSinglePartition,
90 else if(version < 4.0) {
91 return _writeMSH3(name, version, binary, saveAll, saveParametric,
92 scalingFactor, elementStartNum, saveSinglePartition,
95 else if(version < 5.0) {
96 return _writeMSH4(name, version, binary, saveAll, saveParametric,
97 scalingFactor, append);
100 Msg::Error(
"Unknown MSH file version %g", version);
105 bool binary,
bool saveAll,
bool saveParametric,
106 double scalingFactor)
109 Msg::Warning(
"Saving a partitioned mesh in a format older than 4.0 may "
110 "cause information loss");
117 else if(version < 4.0) {
119 saveParametric, scalingFactor);
121 else if(version < 5.0) {
123 saveParametric, scalingFactor);
126 Msg::Error(
"Unknown MSH file version %g", version);
int _readMSH3(const std::string &name)
int _writePartitionedMSH3(const std::string &baseName, double version, bool binary, bool saveAll, bool saveParametric, double scalingFactor)
static void Warning(const char *fmt,...)
static void Error(const char *fmt,...)
int _readMSH2(const std::string &name)
int _writePartitionedMSH4(const std::string &baseName, double version, bool binary, bool saveAll, bool saveParametric, double scalingFactor)
std::size_t getNumPartitions() const
FILE * Fopen(const char *f, const char *mode)
int readMSH(const std::string &name)
int _writeMSH4(const std::string &name, double version, bool binary, bool saveAll, bool saveParametric, double scalingFactor, bool append, int partitionToSave=0, std::map< GEntity *, SBoundingBox3d > *entityBounds=nullptr)
int _writePartitionedMSH2(const std::string &baseName, bool binary, bool saveAll, bool saveParametric, double scalingFactor)
int _writeMSH3(const std::string &name, double version, bool binary, bool saveAll, bool saveParametric, double scalingFactor, int elementStartNum, int saveSinglePartition, bool append)
int writeMSH(const std::string &name, double version=2.2, bool binary=false, bool saveAll=false, bool saveParametric=false, double scalingFactor=1.0, int elementStartNum=0, int saveSinglePartition=0, bool append=false)
int _writeMSH2(const std::string &name, double version, bool binary, bool saveAll, bool saveParametric, double scalingFactor, int elementStartNum, int saveSinglePartition, bool append, bool renumberVertices)
int _readMSH4(const std::string &name)
int writePartitionedMSH(const std::string &baseName, double version=2.2, bool binary=false, bool saveAll=false, bool saveParametric=false, double scalingFactor=1.0)