Commit 71fde173 by Christophe Geuzaine

gmshModelGeo API ok

parent 1d62c3a3
Pipeline #741 failed with stage
in 104 minutes 29 seconds
......@@ -590,37 +590,48 @@ int gmshModelGeoTwist(const std::vector<std::pair<int, int> > &inDimTags,
int gmshModelGeoTranslate(const std::vector<std::pair<int, int> > &dimTags,
double dx, double dy, double dz)
{
return !GModel::current()->getGEOInternals()->translate(dimTags, dx, dy, dz);
}
int gmshModelGeoRotate(const std::vector<std::pair<int, int> > &dimTags,
double x, double y, double z, double ax, double ay, double az,
double angle)
{
return !GModel::current()->getGEOInternals()->rotate
(dimTags, x, y, z, ax, ay, az, angle);
}
int gmshModelGeoDilate(const std::vector<std::pair<int, int> > &dimTags,
double x, double y, double z,
double a, double b, double c)
{
return !GModel::current()->getGEOInternals()->dilate
(dimTags, x, y, z, a, b, c);
}
int gmshModelGeoSymmetry(const std::vector<std::pair<int, int> > &dimTags,
double a, double b, double c, double d)
{
return !GModel::current()->getGEOInternals()->symmetry
(dimTags, a, b, c, d);
}
int gmshModelGeoCopy(const std::vector<std::pair<int, int> > &inDimTags,
std::vector<std::pair<int, int> > &outDimTags)
{
return !GModel::current()->getGEOInternals()->copy(inDimTags, outDimTags);
}
int gmshModelGeoRemove(const std::vector<std::pair<int, int> > &dimTags,
bool recursive)
{
return !GModel::current()->getGEOInternals()->remove(dimTags, recursive);
}
int gmshModelGeoRemoveAllDuplicates()
{
GModel::current()->getGEOInternals()->removeAllDuplicates();
return 0;
}
int gmshModelGeoSynchronize()
......@@ -628,3 +639,7 @@ int gmshModelGeoSynchronize()
GModel::current()->getGEOInternals()->synchronize(GModel::current());
return 0;
}
// gmshModelOCC
......@@ -136,13 +136,6 @@ GMSH_API gmshModelGeoRemoveAllDuplicates();
GMSH_API gmshModelGeoSynchronize();
// gmshModelOCC
GMSH_API gmshModelOCCAddVertex(int &tag, double x, double y, double z, double lc);
GMSH_API gmshModelOCCAddLine(int &tag, int startVertexTag, int endVertexTag);
GMSH_API gmshModelOCCExtrude(const std::vector<std::pair<int, int> > &inDimTag,
double dx, double dy, double dz,
std::vector<std::pair<int, int> > &outDimTags);
GMSH_API gmshModelOCCRemoveAllDuplicates();
GMSH_API gmshModelOCCSynchronize();
// gmshSolver
......
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
# TODO: Gmsh will should create a cmake file when installing the lib, so all the
# external dependencies can be obtained automatically
set(CMAKE_CXX_STANDARD 11)
find_library(GMSH_LIB gmsh)
if(NOT GMSH_LIB)
message(FATAL_ERROR "Could not find libgmsh")
......
......@@ -10,31 +10,32 @@ int main(int argc, char **argv)
gmshModelCreate("t1");
double lc = 1e-2;
int tag;
tag = 1; gmshModelGeoAddVertex(tag, 0, 0, 0, lc);
tag = 2; gmshModelGeoAddVertex(tag, .1, 0, 0, lc);
tag = 3; gmshModelGeoAddVertex(tag, .1, .3, 0, lc);
tag = 4; gmshModelGeoAddVertex(tag, 0, .3, 0, lc);
tag = 1; gmshModelGeoAddLine(tag, 1, 2);
tag = 2; gmshModelGeoAddLine(tag, 3, 2);
tag = 3; gmshModelGeoAddLine(tag, 3, 4);
tag = 4; gmshModelGeoAddLine(tag, 4, 1);
std::vector<int> l;
l.push_back(4); l.push_back(1); l.push_back(-2); l.push_back(3);
tag = 1; gmshModelGeoAddLineLoop(tag, l);
std::vector<int> ll;
ll.push_back(1);
tag = 1; gmshModelGeoAddPlaneSurface(tag, ll);
std::vector<int> p;
p.push_back(1); p.push_back(2);
gmshModelAddPhysicalGroup(0, 1, p);
gmshModelAddPhysicalGroup(1, 2, p);
p.clear(); p.push_back(1);
gmshModelAddPhysicalGroup(2, 6, p);
std::vector<int> t = {1, 2, 3, 4};
gmshModelGeoAddVertex(t[0], 0, 0, 0, lc);
gmshModelGeoAddVertex(t[1], .1, 0, 0, lc);
gmshModelGeoAddVertex(t[2], .1, .3, 0, lc);
gmshModelGeoAddVertex(t[3], 0, .3, 0, lc);
gmshModelGeoAddLine(t[0], 1, 2);
gmshModelGeoAddLine(t[1], 3, 2);
gmshModelGeoAddLine(t[2], 3, 4);
gmshModelGeoAddLine(t[3], 4, 1);
std::vector<int> l = {4, 1, -2, 3};
gmshModelGeoAddLineLoop(t[0], l);
std::vector<int> ll = {1};
gmshModelGeoAddPlaneSurface(t[0], ll);
std::vector<int> p1 = {1, 2};
gmshModelAddPhysicalGroup(0, 1, p1);
std::vector<int> p2 = {1, 2};
gmshModelAddPhysicalGroup(1, 2, p2);
std::vector<int> p3 = {1};
gmshModelAddPhysicalGroup(2, 6, p3);
gmshModelSetPhysicalName(2, 6, "My surface");
gmshModelGeoSynchronize();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment