gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
8 #include "GmshConfig.h"
25 #if defined(HAVE_MESH)
115 Msg::Error(
"GEO point with tag %d already exists", tag);
130 Msg::Error(
"GEO point with tag %d already exists", tag);
143 std::vector<int> points;
144 points.push_back(startTag);
145 points.push_back(endTag);
152 Msg::Error(
"GEO curve with tag %d already exists", tag);
155 if(pointTags.size() < 2) {
161 for(std::size_t i = 0; i < pointTags.size(); i++) {
162 int t = pointTags[i];
176 int endTag,
double nx,
double ny,
double nz)
179 Msg::Error(
"GEO curve with tag %d already exists", tag);
210 int majorTag,
int endTag,
double nx,
211 double ny,
double nz)
214 Msg::Error(
"GEO curve with tag %d already exists", tag);
248 Msg::Error(
"GEO curve with tag %d already exists", tag);
251 if(pointTags.size() < 2) {
252 Msg::Error(
"Spline curve requires at least 2 control points");
257 for(std::size_t i = 0; i < pointTags.size(); i++) {
258 int t = pointTags[i];
274 Msg::Error(
"GEO curve with tag %d already exists", tag);
278 if(pointTags.size() < 2) {
279 Msg::Error(
"Bezier curve requires at least 2 control points");
283 for(std::size_t i = 0; i < pointTags.size(); i++) {
284 int t = pointTags[i];
298 const std::vector<double> &seqknots)
301 Msg::Error(
"GEO curve with tag %d already exists", tag);
304 if(pointTags.size() < 2) {
305 Msg::Error(
"BSpline curve requires at least 2 control points");
310 for(std::size_t i = 0; i < pointTags.size(); i++) {
311 int t = pointTags[i];
316 if(seqknots.empty()) {
320 int order = seqknots.size() - pointTags.size() - 1;
322 for(std::size_t i = 0; i < seqknots.size(); i++) {
323 double d = seqknots[i];
337 const std::vector<int> &curveTags,
338 int numIntervals,
bool bspline)
341 Msg::Error(
"GEO curve with tag %d already exists", tag);
344 if(curveTags.empty()) {
345 Msg::Error(
"Compound spline curve requires at least 1 input curve");
348 if(numIntervals < 0) {
349 Msg::Error(
"Negative number of intervals in compound spline");
355 List_Create((numIntervals + 1) * curveTags.size(), 2,
sizeof(
int));
356 for(std::size_t i = 0; i < curveTags.size(); i++) {
359 Msg::Error(
"Unknown GEO curve with tag %d", curveTags[i]);
362 if(i == 0 &&
c->beg)
List_Add(tmp, &
c->beg->Num);
363 for(
int j = 1; j < numIntervals; j++) {
364 double u = (double)j / (
double)(numIntervals);
366 double lc = (1 - u) *
c->beg->lc + u *
c->end->lc;
388 const std::vector<int> &curveTags,
395 const std::vector<int> &curveTags,
405 Msg::Error(
"GEO curve loop with tag %d already exists", tag);
410 for(std::size_t i = 0; i < curveTags.size(); i++) {
411 int t = curveTags[i];
430 std::vector<std::vector<Vertex *> > &vs)
433 if(e.empty())
return true;
436 for(
size_t i = 0; i < e.size(); i++) {
441 Msg::Warning(
"Skipping GEO curve %d without begin or end point in curve "
448 std::vector<Vertex *> v = {v0, v1};
453 auto it0 =
c.find(v0), it1 =
c.find(v1);
455 c[v0] = std::make_pair(v1, (
Vertex *)
nullptr);
457 if(it0->second.second ==
nullptr) { it0->second.second = v1; }
459 Msg::Debug(
"A list of curves has points that are adjacent to 3 curves");
464 c[v1] = std::make_pair(v0, (
Vertex *)
nullptr);
466 if(it1->second.second ==
nullptr) { it1->second.second = v0; }
468 Msg::Debug(
"Wrong topology for a list of curves");
469 Msg::Debug(
"Point %d is adjacent to more than 2 points %d %d", v1->
Num,
470 it1->second.first->Num, it1->second.second->Num);
477 std::vector<Vertex *> v;
482 for(; it !=
c.end(); ++it) {
483 if(it->second.second ==
nullptr) {
490 auto its =
c.find(start);
493 (its->second.second == start) ? its->second.first : its->second.second;
501 v.push_back(current);
502 auto it =
c.find(current);
503 if(it ==
c.end() || it->first ==
nullptr) {
504 Msg::Error(
"Impossible to find point %d", current->Num);
507 Vertex *v1 = it->second.first;
508 Vertex *v2 = it->second.second;
519 if(current == start) { v.push_back(current); }
520 }
while(current != start && current !=
nullptr);
521 if(v.size() > 2 && v[v.size() - 2] == v[v.size() - 1]) {
522 v.erase(v.begin() + v.size() - 1);
530 std::vector<int> &curveLoopTags)
532 curveLoopTags.clear();
533 std::vector<Curve *> curves;
534 std::multimap<std::pair<Vertex *, Vertex *>,
Curve *> pairs;
535 for(
auto j : curveTags) {
541 if(!
c->beg || !
c->end) {
542 Msg::Error(
"Cannot create curve loops using curve %d without begin or "
547 pairs.insert(std::make_pair(std::make_pair(
c->beg,
c->end),
c));
550 std::vector<std::vector<Vertex *> > vs;
552 Msg::Error(
"Could not sort curves while creating curve loops");
556 for(std::size_t i = 0; i < vs.size(); i++) {
557 if(vs[i].size() < 2 || vs[i][0] != vs[i][vs[i].size() - 1]) {
558 Msg::Warning(
"Skipping invalid loop with %lu points", vs[i].size());
563 for(std::size_t j = 0; j < vs[i].size() - 1; j++) {
564 std::pair<Vertex *, Vertex *> p(vs[i][j], vs[i][j + 1]);
566 auto it = pairs.find(p);
567 if(it != pairs.end()) {
568 num = it->second->Num;
572 std::pair<Vertex *, Vertex *> p2(vs[i][j + 1], vs[i][j]);
574 if(it != pairs.end()) {
575 num = -it->second->Num;
584 curveLoopTags.push_back(tag);
589 return curveLoopTags.empty() ? false :
true;
595 Msg::Error(
"GEO surface with tag %d already exists", tag);
599 if(wireTags.empty()) {
600 Msg::Error(
"Plane surface requires at least one curve loop");
604 for(std::size_t i = 0; i < wireTags.size(); i++) {
620 Msg::Error(
"GEO surface with tag %d already exists", tag);
631 const std::vector<int> &wireTags,
635 Msg::Error(
"GEO surface with tag %d already exists", tag);
639 if(wireTags.empty()) {
640 Msg::Error(
"Surface requires at least one curve loop");
643 int ll = (int)std::abs(wireTags[0]);
655 Msg::Error(
"Wrong definition of surface %d: %d borders instead of 3 or 4",
660 for(std::size_t i = 0; i < wireTags.size(); i++) {
668 if(sphereCenterTag >= 0) {
671 Msg::Error(
"Unknown sphere center point %d", sphereCenterTag);
681 const std::vector<int> &surfaceTags)
684 Msg::Error(
"GEO surface loop with tag %d already exists", tag);
690 for(std::size_t i = 0; i < surfaceTags.size(); i++) {
691 int t = surfaceTags[i];
704 Msg::Error(
"GEO volume with tag %d already exists", tag);
710 for(std::size_t i = 0; i < shellTags.size(); i++) {
711 int t = shellTags[i];
723 const std::vector<std::pair<int, int> > &inDimTags,
724 double x,
double y,
double z,
double dx,
double dy,
725 double dz,
double ax,
double ay,
double az,
727 std::vector<std::pair<int, int> > &outDimTags,
733 for(std::size_t i = 0; i < inDimTags.size(); i++) {
734 int dim = inDimTags[i].first;
735 int tag = inDimTags[i].second;
746 ExtrudeShapes(
TRANSLATE, in, dx, dy, dz, 0., 0., 0., 0., 0., 0., 0., e,
750 ExtrudeShapes(
ROTATE, in, 0., 0., 0., ax, ay, az, x, y,
z,
angle, e, out);
753 ExtrudeShapes(
TRANSLATE_ROTATE, in, dx, dy, dz, ax, ay, az, x, y,
z,
angle,
757 ExtrudeShapes(
BOUNDARY_LAYER, in, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., e,
761 for(
int i = 0; i <
List_Nbr(out); i++) {
764 int dim = s.
Type / 100 - 1;
765 if(dim >= 0 && dim <= 3)
766 outDimTags.push_back(std::make_pair(dim, s.
Num));
775 double dx,
double dy,
double dz,
776 std::vector<std::pair<int, int> > &outDimTags,
779 return _extrude(0, inDimTags, 0., 0., 0., dx, dy, dz, 0., 0., 0., 0.,
784 double x,
double y,
double z,
double ax,
double ay,
785 double az,
double angle,
786 std::vector<std::pair<int, int> > &outDimTags,
789 return _extrude(1, inDimTags, x, y,
z, 0., 0., 0., ax, ay, az,
angle,
794 double x,
double y,
double z,
double dx,
double dy,
795 double dz,
double ax,
double ay,
double az,
797 std::vector<std::pair<int, int> > &outDimTags,
800 return _extrude(2, inDimTags, x, y,
z, dx, dy, dz, ax, ay, az,
angle,
805 const std::vector<std::pair<int, int> > &inDimTags,
806 std::vector<std::pair<int, int> > &outDimTags,
ExtrudeParams *e)
808 return _extrude(3, inDimTags, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
813 const std::vector<std::pair<int, int> > &dimTags,
814 double x,
double y,
double z,
double dx,
815 double dy,
double dz,
double a,
double b,
819 for(std::size_t i = 0; i < dimTags.size(); i++) {
820 int dim = dimTags[i].first;
821 int tag = dimTags[i].second;
833 case 1: ok =
RotateShapes(dx, dy, dz, x, y,
z, a, list);
break;
843 double dx,
double dy,
double dz)
845 return _transform(0, dimTags, 0, 0, 0, dx, dy, dz, 0, 0, 0, 0);
849 double x,
double y,
double z,
double ax,
double ay,
850 double az,
double angle)
852 return _transform(1, dimTags, x, y,
z, ax, ay, az,
angle, 0, 0, 0);
856 double x,
double y,
double z,
double a,
double b,
859 return _transform(2, dimTags, x, y,
z, 0, 0, 0, a, b,
c, 0);
863 double a,
double b,
double c,
double d)
865 return _transform(3, dimTags, 0, 0, 0, 0, 0, 0, a, b,
c, d);
869 std::vector<int> &curveTags)
872 for(std::size_t i = 0; i < pointTags.size(); i++) {
873 int t = pointTags[i];
878 for(
int i = 0; i <
List_Nbr(curves); i++) {
881 curveTags.push_back(
c->Num);
890 const std::vector<int> &curveTags,
int surfaceTag,
891 std::vector<int> &pointTags)
895 for(std::size_t i = 0; i < curveTags.size(); i++) {
896 double d = curveTags[i];
900 for(
int i = 0; i <
List_Nbr(shapes); i++) {
905 Msg::Error(
"Degenerated curve-surface intersection not implemented");
914 std::vector<std::pair<int, int> > &outDimTags)
917 for(std::size_t i = 0; i < inDimTags.size(); i++) {
918 int dim = inDimTags[i].first;
919 int tag = inDimTags[i].second;
928 outDimTags.push_back(std::make_pair(0, newv->
Num));
939 outDimTags.push_back(std::make_pair(1, newc->
Num));
950 outDimTags.push_back(std::make_pair(2, news->
Num));
961 outDimTags.push_back(std::make_pair(3, newv->
Num));
987 for(std::size_t i = 0; i < dimTags.size(); i++)
988 remove(dimTags[i].first, dimTags[i].second, recursive);
1001 const std::vector<int> &
tags)
1022 default:
return false;
1027 Msg::Error(
"Physical %s %d already exists", str.c_str(), tag);
1030 else if(!p && op == 2) {
1035 else if(!p && op > 0) {
1036 Msg::Error(
"Physical %s %d does not exist", str.c_str(), tag);
1041 for(std::size_t i = 0; i <
tags.size(); i++) {
1050 for(std::size_t i = 0; i <
tags.size(); i++) {
1056 for(std::size_t i = 0; i <
tags.size(); i++) {
1070 Msg::Error(
"Unsupported operation on physical %s %d", str.c_str(), tag);
1085 if(
tags.size() < 2)
return true;
1092 double x = target->
Pos.
X, y = target->
Pos.
Y,
z = target->
Pos.
Z;
1093 for(std::size_t i = 1; i <
tags.size(); i++) {
1099 source->
Typ = target->
Typ;
1120 Msg::Error(
"Setting mesh size only available on GEO points");
1130 if(dim != 1)
return;
1132 if(
c)
c->degenerated =
true;
1141 for(
int i = 0; i <
List_Nbr(tmp); i++) {
1145 c->nbPointsTransfinite = (nPoints > 2) ? nPoints : 2;
1146 c->typeTransfinite = type;
1147 c->coeffTransfinite = coef;
1155 c->nbPointsTransfinite = (nPoints > 2) ? nPoints : 2;
1156 c->typeTransfinite = type;
1157 c->coeffTransfinite = coef;
1164 const std::vector<int> &cornerTags)
1168 for(
int i = 0; i <
List_Nbr(tmp); i++) {
1183 if(cornerTags.empty() || cornerTags.size() == 3 ||
1184 cornerTags.size() == 4) {
1185 for(std::size_t j = 0; j < cornerTags.size(); j++) {
1190 Msg::Error(
"Unknown GEO point %d", cornerTags[j]);
1194 Msg::Error(
"Transfinite surface requires 3 or 4 corner points");
1202 const std::vector<int> &cornerTags)
1206 for(
int i = 0; i <
List_Nbr(tmp); i++) {
1219 if(cornerTags.empty() || cornerTags.size() == 6 ||
1220 cornerTags.size() == 8) {
1221 for(std::size_t i = 0; i < cornerTags.size(); i++) {
1226 Msg::Error(
"Unknown GEO point %d", cornerTags[i]);
1238 for(
int i = 0; i <
List_Nbr(tmp); i++) {
1257 for(
int i = 0; i <
List_Nbr(tmp); i++) {
1276 for(
int i = 0; i <
List_Nbr(tmp); i++) {
1295 for(
int i = 0; i <
List_Nbr(tmp); i++) {
1314 for(
int i = 0; i <
List_Nbr(tmp); i++) {
1317 c->ReverseMesh = val ? 1 : 0;
1323 if(
c)
c->ReverseMesh = val ? 1 : 0;
1329 for(
int i = 0; i <
List_Nbr(tmp); i++) {
1363 const std::pair<int, int> &b)
1365 if(a.first != b.first)
1366 return a.first > b.first;
1367 return a.second < b.second;
1372 Msg::Debug(
"Syncing GEO_Internals with GModel");
1384 std::vector<std::pair<int, int> > toRemove;
1390 toRemove.push_back(std::make_pair(0, gv->
tag()));
1398 toRemove.push_back(std::make_pair(1, ge->
tag()));
1406 toRemove.push_back(std::make_pair(2, gf->
tag()));
1414 toRemove.push_back(std::make_pair(3, gr->
tag()));
1417 std::sort(toRemove.begin(), toRemove.end(),
sortEntities);
1418 Msg::Debug(
"Sync will try to remove %d model entities", toRemove.size());
1420 std::vector<GEntity*> removed;
1421 model->
remove(toRemove, removed);
1422 Msg::Debug(
"Destroying %lu model entities during first pass", removed.size());
1423 for(std::size_t i = 0; i < removed.size(); i++)
delete removed[i];
1427 for(
int i = 0; i <
List_Nbr(points); i++) {
1446 for(
int i = 0; i <
List_Nbr(curves); i++) {
1451 GVertex *beg =
nullptr, *end =
nullptr;
1456 if(!e && beg && end) {
1461 e =
new gmshEdge(model,
c,
nullptr,
nullptr);
1467 ((
gmshEdge *)e)->resetNativePtr(
c, beg, end);
1469 ((
gmshEdge *)e)->resetNativePtr(
c,
nullptr,
nullptr);
1481 for(
int i = 0; i <
List_Nbr(surfaces); i++) {
1492 if(resetMeshAttributes) {
f->resetMeshAttributes(); }
1500 for(
int i = 0; i <
List_Nbr(volumes); i++) {
1524 model->
remove(toRemove, removed);
1525 Msg::Debug(
"Destroying %lu model entities during second pass", removed.size());
1526 for(std::size_t i = 0; i < removed.size(); i++)
delete removed[i];
1541 const char *name =
"";
1570 Msg::Warning(
"Skipping unknown %s %d in physical %s %d",
1571 name, tag, name, p->
Num);
1579 int dim = it->first;
1580 std::vector<int> compound = it->second;
1581 std::vector<GEntity *> ents;
1582 for(std::size_t i = 0; i < compound.size(); i++) {
1583 int tag = compound[i];
1585 const char *name =
"";
1587 case 1: ent = model->
getEdgeByTag(tag); name =
"curve";
break;
1588 case 2: ent = model->
getFaceByTag(tag); name =
"surface";
break;
1589 case 3: ent = model->
getRegionByTag(tag); name =
"volume";
break;
1591 Msg::Error(
"Compound mesh constraint with dimension %d", dim);
1595 ents.push_back(ent);
1598 Msg::Warning(
"Skipping unknown %d %d in compound", name, tag);
1601 for(std::size_t i = 0; i < ents.size(); i++) { ents[i]->compound = ents; }
1633 Msg::Error(
"Unknown sphere center point %d", centerTag);
1638 Msg::Error(
"Unknown sphere point %d", pointTag);
1653 Msg::Error(
"Unknown polar sphere center point %d", centerTag);
1658 Msg::Error(
"Unknown polar sphere point %d", pointTag);
1678 #if defined(HAVE_MESH)
1680 class writeFieldOptionGEO {
1686 writeFieldOptionGEO(FILE *fp,
Field *_field)
1688 geo = fp ? fp : stdout;
1691 void operator()(std::pair<std::string, FieldOption *> it)
1694 it.second->getTextRepresentation(v);
1695 fprintf(geo,
"Field[%i].%s = %s;\n", field->
id, it.first.c_str(),
1700 class writeFieldGEO {
1705 writeFieldGEO(FILE *fp) { geo = fp ? fp : stdout; }
1706 void operator()(std::pair<const int, Field *> it)
1708 fprintf(geo,
"Field[%i] = %s;\n", it.first, it.second->getName());
1709 std::for_each(it.second->options.begin(), it.second->options.end(),
1710 writeFieldOptionGEO(geo, it.second));
1726 std::map<int, std::string> &o,
1727 std::map<std::pair<int, int>, std::string> &n)
1730 geo = fp ? fp : stdout;
1732 void operator()(std::pair<
const int, std::vector<GEntity *> > &g)
1734 std::string oldName, newName;
1741 fprintf(
geo,
"%s = %d;\n", oldName.c_str(), g.first);
1746 case 0: fprintf(
geo,
"Physical Point");
break;
1747 case 1: fprintf(
geo,
"Physical Curve");
break;
1748 case 2: fprintf(
geo,
"Physical Surface");
break;
1749 case 3: fprintf(
geo,
"Physical Volume");
break;
1753 fprintf(
geo,
"(%s) = {", oldName.c_str());
1754 else if(newName.size())
1755 fprintf(
geo,
"(\"%s\") = {", newName.c_str());
1757 fprintf(
geo,
"(%d) = {", g.first);
1758 for(std::size_t i = 0; i < g.second.size(); i++) {
1759 if(i) fprintf(
geo,
", ");
1760 fprintf(
geo,
"%d", g.second[i]->tag());
1762 fprintf(
geo,
"};\n");
1775 std::list<GRegion *> regions(gf->
regions());
1776 for(
auto itr = regions.begin(); itr != regions.end(); itr++) {
1786 for(
auto itf =
faces.begin(); itf !=
faces.end(); itf++) {
1795 std::vector<GEdge *>
const &
edges = gv->
edges();
1796 for(
auto ite =
edges.begin(); ite !=
edges.end(); ite++) {
1805 FILE *fp =
Fopen(name.c_str(),
"w");
1807 Msg::Error(
"Could not open file '%s'", name.c_str());
1811 std::map<double, std::string> meshSizeParameters;
1814 double val = (*it)->prescribedMeshSizeAtVertex();
1815 if(meshSizeParameters.find(val) == meshSizeParameters.end()) {
1816 std::ostringstream paramName;
1817 paramName <<
"cl__" << ++cpt;
1818 fprintf(fp,
"%s = %.16g;\n", paramName.str().c_str(), val);
1819 meshSizeParameters.insert(std::make_pair(val, paramName.str()));
1824 double val = (*it)->prescribedMeshSizeAtVertex();
1826 (*it)->writeGEO(fp, meshSizeParameters[val]);
1829 if(!onlyPhysicals || !
skipEdge(*it)) (*it)->writeGEO(fp);
1832 if(!onlyPhysicals || !
skipFace(*it)) (*it)->writeGEO(fp);
1835 if(!onlyPhysicals || !
skipRegion(*it)) (*it)->writeGEO(fp);
1838 std::map<int, std::string> labels;
1839 #if defined(HAVE_PARSER)
1842 for(std::size_t i = 0; i < it->second.value.size(); i++)
1843 labels[(
int)it->second.value[i]] = it->first;
1846 std::map<int, std::vector<GEntity *> > groups[4];
1848 for(
int i = 0; i < 4; i++)
1850 groups[i].begin(), groups[i].end(),
1853 #if defined(HAVE_MESH)
1855 if(
getFields()->getBackgroundField() > 0)
1856 fprintf(fp,
"Background Field = %i;\n",
getFields()->getBackgroundField());
1866 FILE *fp =
Fopen(name.c_str(),
"w");
1868 Msg::Error(
"Could not open file '%s'", name.c_str());
1872 fprintf(fp,
"import gmsh\n");
1873 fprintf(fp,
"gmsh.initialize()\n");
1875 std::map<double, std::string> meshSizeParameters;
1878 double val = (*it)->prescribedMeshSizeAtVertex();
1879 if(meshSizeParameters.find(val) == meshSizeParameters.end()) {
1880 std::ostringstream paramName;
1881 paramName <<
"cl__" << ++cpt;
1882 fprintf(fp,
"%s = %.16g\n", paramName.str().c_str(), val);
1883 meshSizeParameters.insert(std::make_pair(val, paramName.str()));
1888 double val = (*it)->prescribedMeshSizeAtVertex();
1890 (*it)->writePY(fp, meshSizeParameters[val]);
1893 if(!onlyPhysicals || !
skipEdge(*it)) (*it)->writePY(fp);
1896 if(!onlyPhysicals || !
skipFace(*it)) (*it)->writePY(fp);
1899 if(!onlyPhysicals || !
skipRegion(*it)) (*it)->writePY(fp);
1902 fprintf(fp,
"gmsh.model.geo.synchronize()\n");
1903 fprintf(fp,
"gmsh.fltk.run()\n");
1904 fprintf(fp,
"gmsh.finalize()\n");
1917 (*it)->prescribedMeshSizeAtVertex(), 1.0);
1925 nullptr, -1, -1, 0., 1., ok);
1927 GVertex *gvb = (*it)->getBeginVertex();
1939 Msg::Warning(
"Discrete curve %d has no begin point", (*it)->tag());
1941 GVertex *gve = (*it)->getEndVertex();
1953 Msg::Warning(
"Discrete curve %d has no end point", (*it)->tag());
1964 std::vector<GEdge *>
const &
edges = (*it)->edges();
1966 for(
auto ite =
edges.begin(); ite !=
edges.end(); ite++) {
1970 Msg::Error(
"Unknown GEO curve %d", (*ite)->tag());
1981 std::vector<GFace *>
faces = (*it)->faces();
1983 for(
auto itf =
faces.begin(); itf !=
faces.end(); itf++) {
1987 Msg::Error(
"Unknown GEO surface %d", (*itf)->tag());
#define MSH_SEGM_DISCRETE
void removeAllDuplicates()
static std::map< SPoint2, unsigned int > tags
bool addBSpline(int &tag, const std::vector< int > &pointTags, const std::vector< double > &seqknots=std::vector< double >())
Volume * CreateVolume(int Num, int Typ)
int gmsh_sign(T const &value)
int getMaxTag(int dim) const
static bool SortCurvesConsecutive(const std::vector< Curve * > &e, std::vector< std::vector< Vertex * > > &vs)
void List_Action(List_T *liste, void(*action)(void *data, void *dummy))
bool SymmetryShapes(double A, double B, double C, double D, List_T *shapes)
bool boundaryLayer(const std::vector< std::pair< int, int > > &inDimTags, std::vector< std::pair< int, int > > &outDimTags, ExtrudeParams *e=0)
bool extrude(const std::vector< std::pair< int, int > > &inDimTags, double dx, double dy, double dz, std::vector< std::pair< int, int > > &outDimTags, ExtrudeParams *e=0)
Curve * CreateReversedCurve(Curve *c)
void DeleteVolume(int iv, bool recursive)
bool sortEntities(const std::pair< int, int > &a, const std::pair< int, int > &b)
#define MSH_PHYSICAL_SURFACE
SurfaceLoop * FindSurfaceLoop(int inum)
virtual void resetMeshAttributes()
bool rotate(const std::vector< std::pair< int, int > > &dimTags, double x, double y, double z, double ax, double ay, double az, double angle)
int writeGEO(const std::string &name, bool printLabels=true, bool onlyPhysicals=false)
void setMaxTag(int dim, int val)
double angle(const SVector3 &a, const SVector3 &b)
virtual void resetMeshAttributes()
void setTransfiniteVolumeQuadTri(int tag)
void setTransfiniteLine(int tag, int nPoints, int type, double coef)
void setMeshSizeFromBoundary(int dim, int tag, int val)
bool modifyPhysicalGroup(int dim, int tag, int op, const std::vector< int > &tags)
#define MSH_PHYSICAL_LINE
static void Debug(const char *fmt,...)
void setTransfiniteSurface(int tag, int arrangement, const std::vector< int > &cornerTags)
static double c(int i, int j, fullMatrix< double > &CA, const std::vector< SPoint3 > &P, const std::vector< SPoint3 > &Q)
int CompareEdgeLoop(const void *a, const void *b)
void FreePhysicalGroup(void *a, void *b)
bool addCompoundBSpline(int &tag, const std::vector< int > &curveTags, int numPoints)
Curve * DuplicateCurve(Curve *c)
void setRecombine(int dim, int tag, double angle)
bool SplitCurve(int line_id, List_T *vertices_id, List_T *curves)
static void Warning(const char *fmt,...)
int List_Suppress(List_T *liste, void *data, int(*fcmp)(const void *a, const void *b))
static void Error(const char *fmt,...)
int fcmp_int(const void *a, const void *b)
std::vector< int > physicals
void List_Reset(List_T *liste)
void f(int n, double u, double *val)
void FreeVolume(void *a, void *b)
int List_Nbr(List_T *liste)
GFace * getFaceByTag(int n) const
int CompareVertex(const void *a, const void *b)
List_T * Tree2List(Tree_T *pTree)
void FreeVertex(void *a, void *b)
List_T * List_Create(int n, int incr, int size)
List_T * DelPhysicalGroups
bool addSurfaceFilling(int &tag, const std::vector< int > &wireTags, int sphereCenterTag=-1)
bool SortEdgesInLoop(int num, List_T *edges, bool reorient)
virtual std::vector< GEdge * > const & edges() const
virtual ModelType getNativeType() const
Vertex * CreateVertex(int Num, double X, double Y, double Z, double lc, double u)
void deleteGEOInternals()
GEdge * getEdgeByTag(int n) const
PhysicalGroup * CreatePhysicalGroup(int Num, int typ, List_T *intlist)
std::size_t getNumMeshElements(int dim=-1) const
bool addEllipseArc(int &tag, int startTag, int centerTag, int majorTag, int endTag, double nx=0., double ny=0., double nz=0.)
bool addLine(int &tag, int startTag, int endTag)
void removePhysicalGroups()
Volume * FindVolume(int inum)
void SetBoundingBox(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
std::list< GRegion * > regions() const
#define MSH_VOLUME_DISCRETE
static void ReplaceAllDuplicates(std::vector< std::map< int, int > > &report)
writePhysicalGroupGEO(FILE *fp, int i, bool labels, std::map< int, std::string > &o, std::map< std::pair< int, int >, std::string > &n)
static bool skipVertex(GVertex *gv)
Vertex InterpolateCurve(Curve *c, double u, int const derivee)
bool addVolume(int &tag, const std::vector< int > &shellTags)
std::map< std::pair< int, int >, std::string > _physicalNames
FILE * Fopen(const char *f, const char *mode)
Surface * CreateSurface(int Num, int Typ)
void List_Add(List_T *liste, void *data)
void setTooSmall(bool const b)
int writePY(const std::string &name, bool printLabels=true, bool onlyPhysicals=false)
void getPhysicalGroups(std::map< int, std::vector< GEntity * > > groups[4]) const
static std::vector< SPoint3 > normalsCoherence
bool addSpline(int &tag, const std::vector< int > &pointTags)
void DeleteSurface(int is, bool recursive)
void DeletePhysicalSurface(int num)
std::map< int, std::string > & oldLabels
static Curve * FindCurve(int inum, Tree_T *t)
static bool skipRegion(GRegion *gr)
bool addDiscreteSurface(int &tag)
int CompareSurfaceLoop(const void *a, const void *b)
std::map< std::string, gmsh_yysymbol > gmsh_yysymbols
PhysicalGroup * FindPhysicalGroup(int num, int type)
void Tree_Action(Tree_T *tree, void(*action)(void *data, void *dummy))
int CompareSurface(const void *a, const void *b)
bool TranslateShapes(double X, double Y, double Z, List_T *shapes)
void * Tree_Add(Tree_T *tree, void *data)
std::size_t getNumVertices() const
void DeleteCurve(int ip, bool recursive)
EdgeLoop * FindEdgeLoop(int inum)
#define MSH_PHYSICAL_VOLUME
bool _transform(int mode, const std::vector< std::pair< int, int > > &dimTags, double x, double y, double z, double dx, double dy, double dz, double a, double b, double c, double d)
bool symmetry(const std::vector< std::pair< int, int > > &dimTags, double a, double b, double c, double d)
static gmshSurface * NewSphere(int _iSphere, double _x, double _y, double _z, double _r)
bool splitCurve(int tag, const std::vector< int > &pointTags, std::vector< int > &curveTags)
void setCompoundMesh(int dim, const std::vector< int > &tags)
void setDegenerated(int dim, int tag)
void setMeshAlgorithm(int dim, int tag, int val)
#define MSH_SURF_DISCRETE
std::map< std::pair< int, int >, std::string > & newLabels
bool getVertex(int tag, double &x, double &y, double &z)
void List_Delete(List_T *liste)
void FreeCurve(void *a, void *b)
void createGEOInternals()
#define TRANSFINITE_QUADTRI_1
std::size_t getNumRegions() const
bool addVertex(int &tag, double x, double y, double z, double lc)
FieldManager * getFields()
std::size_t getNumFaces() const
static bool skipEdge(GEdge *ge)
bool dilate(const std::vector< std::pair< int, int > > &dimTags, double x, double y, double z, double a, double b, double c)
bool RotateShapes(double Ax, double Ay, double Az, double Px, double Py, double Pz, double alpha, List_T *shapes)
gmshSurface * newGeometrySphere(int tag, int centerTag, int pointTag)
int exportDiscreteGEOInternals()
contextGeometryOptions geom
void DeletePhysicalPoint(int num)
void Tree_Delete(Tree_T *tree)
bool operator()(const Vertex *v1, const Vertex *v2) const
bool addCurveLoops(const std::vector< int > &curveTags, std::vector< int > &curveLoopTags)
std::size_t getNumEdges() const
virtual std::vector< GFace * > faces() const
bool IntersectCurvesWithSurface(List_T *curve_ids, int surface_id, List_T *shapes)
#define MSH_PHYSICAL_POINT
void EndSurface(Surface *s)
bool _addCompoundSpline(int &tag, const std::vector< int > &curveTags, int numPoints, bool bspline)
EdgeLoop * CreateEdgeLoop(int Num, List_T *intlist)
bool translate(const std::vector< std::pair< int, int > > &dimTags, double dx, double dy, double dz)
bool addCircleArc(int &tag, int startTag, int centerTag, int endTag, double nx=0., double ny=0., double nz=0.)
SurfaceLoop * CreateSurfaceLoop(int Num, List_T *intlist)
bool intersectCurvesWithSurface(const std::vector< int > &curveTags, int surfaceTag, std::vector< int > &pointTags)
bool mergeVertices(const std::vector< int > &tags)
bool DilatShapes(double X, double Y, double Z, double A, double B, double C, List_T *shapes)
void DeletePhysicalVolume(int num)
void setReverseMesh(int dim, int tag, bool val=1)
bool revolve(const std::vector< std::pair< int, int > > &inDimTags, double x, double y, double z, double ax, double ay, double az, double angle, std::vector< std::pair< int, int > > &outDimTags, ExtrudeParams *e=0)
bool copy(const std::vector< std::pair< int, int > > &inDimTags, std::vector< std::pair< int, int > > &outDimTags)
bool twist(const std::vector< std::pair< int, int > > &inDimTags, double x, double y, double z, double dx, double dy, double dz, double ax, double ay, double az, double angle, std::vector< std::pair< int, int > > &outDimTags, ExtrudeParams *e=0)
std::set< GFace *, GEntityPtrLessThan > faces
int Tree_Nbr(Tree_T *tree)
void FreeEdgeLoop(void *a, void *b)
virtual void resetMeshAttributes()
bool addCompoundSpline(int &tag, const std::vector< int > &curveTags, int numPoints)
bool addPlaneSurface(int &tag, const std::vector< int > &wireTags)
bool remove(int dim, int tag, bool recursive=false)
void setSmoothing(int tag, int val)
void DeletePhysicalLine(int num)
bool addSurfaceLoop(int &tag, const std::vector< int > &surfaceTags)
void FreeSurface(void *a, void *b)
Vertex * DuplicateVertex(Vertex *v)
void setMeshSize(int dim, int tag, double size)
bool _extrude(int mode, const std::vector< std::pair< int, int > > &inDimTags, double x, double y, double z, double dx, double dy, double dz, double ax, double ay, double az, double angle, std::vector< std::pair< int, int > > &outDimTags, ExtrudeParams *e=0)
void ExtrudeShapes(int type, List_T *list_in, double T0, double T1, double T2, double A0, double A1, double A2, double X0, double X1, double X2, double alpha, ExtrudeParams *e, List_T *list_out)
Curve * CreateCurve(int Num, int Typ, int Order, List_T *Liste, List_T *Knots, int p1, int p2, double u1, double u2, bool &ok)
Surface * DuplicateSurface(Surface *s)
bool SetVolumeSurfaces(Volume *v, List_T *loops)
void DeletePoint(int ip, bool recursive)
GRegion * getRegionByTag(int n) const
void FreeSurfaceLoop(void *a, void *b)
static Vertex * FindPoint(int inum, Tree_T *t)
void resetPhysicalGroups()
Tree_T * Tree_Create(int size, int(*fcmp)(const void *a, const void *b))
void synchronize(GModel *model, bool resetMeshAttributes=true)
int CompareVolume(const void *a, const void *b)
static bool skipFace(GFace *gf)
GVertex * getVertexByTag(int n) const
GEO_Internals * _geo_internals
std::set< GEdge *, GEntityPtrLessThan > edges
void setTransfiniteVolume(int tag, const std::vector< int > &cornerTags)
void operator()(std::pair< const int, std::vector< GEntity * > > &g)
void List_Read(List_T *liste, int index, void *data)
static Surface * FindSurface(int inum, Tree_T *t)
int CompareCurve(const void *a, const void *b)
gmshSurface * newGeometryPolarSphere(int tag, int centerTag, int pointTag)
bool addCurveLoop(int &tag, const std::vector< int > &curveTags, bool reorient=false)
std::multimap< int, std::vector< int > > _meshCompounds
bool addBezier(int &tag, const std::vector< int > &pointTags)
Volume * DuplicateVolume(Volume *v)
static gmshSurface * NewPolarSphere(int _iSphere, double _x, double _y, double _z, double _r)
bool SetSurfaceGeneratrices(Surface *s, List_T *loops)