mirror of
https://github.com/NGSolve/netgen.git
synced 2025-02-03 16:50:34 +05:00
Merge branch 'gitlab_mpi_builds' into metis_pic
This commit is contained in:
commit
59c4ec78d3
@ -87,6 +87,16 @@ build_ubuntu:
|
|||||||
- docker commit `cat netgen_${CI_BUILD_REF_NAME}_${UBUNTU_VERSION}.id` netgen_${CI_BUILD_REF_NAME}_installed:${UBUNTU_VERSION}
|
- docker commit `cat netgen_${CI_BUILD_REF_NAME}_${UBUNTU_VERSION}.id` netgen_${CI_BUILD_REF_NAME}_installed:${UBUNTU_VERSION}
|
||||||
- rm netgen_${CI_BUILD_REF_NAME}_${UBUNTU_VERSION}.id
|
- rm netgen_${CI_BUILD_REF_NAME}_${UBUNTU_VERSION}.id
|
||||||
|
|
||||||
|
build_ubuntu_mpi:
|
||||||
|
<<: *ubuntu
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- docker build -t netgen_mpi_${CI_BUILD_REF_NAME}:${UBUNTU_VERSION} -f tests/dockerfile_mpi .
|
||||||
|
- rm -f netgen_mpi_${CI_BUILD_REF_NAME}_$UBUNTU_VERSION.id_mpi
|
||||||
|
- docker run --cidfile netgen_mpi_${CI_BUILD_REF_NAME}_${UBUNTU_VERSION}.id -e CCACHE_DIR=/ccache -v /mnt/ccache:/ccache netgen_mpi_${CI_BUILD_REF_NAME}:${UBUNTU_VERSION} bash /root/src/netgen/tests/build_mpi.sh
|
||||||
|
- docker commit `cat netgen_mpi_${CI_BUILD_REF_NAME}_${UBUNTU_VERSION}.id` netgen_mpi_${CI_BUILD_REF_NAME}_installed:${UBUNTU_VERSION}
|
||||||
|
- rm netgen_mpi_${CI_BUILD_REF_NAME}_${UBUNTU_VERSION}.id
|
||||||
|
|
||||||
test_ubuntu:
|
test_ubuntu:
|
||||||
<<: *ubuntu
|
<<: *ubuntu
|
||||||
stage: test
|
stage: test
|
||||||
@ -98,6 +108,17 @@ test_ubuntu:
|
|||||||
netgen_${CI_BUILD_REF_NAME}_installed:${UBUNTU_VERSION}
|
netgen_${CI_BUILD_REF_NAME}_installed:${UBUNTU_VERSION}
|
||||||
bash -c 'cd /root/build/netgen && make test_netgen ARGS="-V"'
|
bash -c 'cd /root/build/netgen && make test_netgen ARGS="-V"'
|
||||||
|
|
||||||
|
test_ubuntu_mpi:
|
||||||
|
<<: *ubuntu
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- >-
|
||||||
|
docker run
|
||||||
|
-e NETGENDIR=/opt/netgen/bin
|
||||||
|
-e PYTHONPATH=/opt/netgen/lib/python3/dist-packages
|
||||||
|
netgen_mpi_${CI_BUILD_REF_NAME}_installed:${UBUNTU_VERSION}
|
||||||
|
bash -c 'cd /root/build/netgen && make test_netgen ARGS="-V"'
|
||||||
|
|
||||||
# cpp guideline checks
|
# cpp guideline checks
|
||||||
test_guidelines:
|
test_guidelines:
|
||||||
<<: *ubuntu
|
<<: *ubuntu
|
||||||
@ -125,6 +146,7 @@ cleanup_ubuntu:
|
|||||||
when: always
|
when: always
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
|
|
||||||
############################################
|
############################################
|
||||||
# MacOSX
|
# MacOSX
|
||||||
############################################
|
############################################
|
||||||
|
@ -12,7 +12,9 @@ if(APPLE)
|
|||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
|
|
||||||
target_link_libraries(csg PUBLIC mesh ${PYTHON_LIBRARIES})
|
target_link_libraries(csg PUBLIC mesh ${PYTHON_LIBRARIES})
|
||||||
install( TARGETS csg ${NG_INSTALL_DIR})
|
if(NOT WIN32)
|
||||||
|
install( TARGETS csg ${NG_INSTALL_DIR})
|
||||||
|
endif(NOT WIN32)
|
||||||
|
|
||||||
target_link_libraries(csg PUBLIC ngcore)
|
target_link_libraries(csg PUBLIC ngcore)
|
||||||
|
|
||||||
|
@ -5,7 +5,9 @@ if(APPLE)
|
|||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
|
|
||||||
target_link_libraries(geom2d mesh ${PYTHON_LIBRARIES})
|
target_link_libraries(geom2d mesh ${PYTHON_LIBRARIES})
|
||||||
install( TARGETS geom2d ${NG_INSTALL_DIR})
|
if(NOT WIN32)
|
||||||
|
install( TARGETS geom2d ${NG_INSTALL_DIR})
|
||||||
|
endif(NOT WIN32)
|
||||||
|
|
||||||
target_link_libraries(geom2d ngcore)
|
target_link_libraries(geom2d ngcore)
|
||||||
|
|
||||||
|
@ -9,7 +9,9 @@ add_library(interface ${NG_LIB_TYPE}
|
|||||||
|
|
||||||
target_link_libraries(interface mesh csg geom2d)
|
target_link_libraries(interface mesh csg geom2d)
|
||||||
target_link_libraries(interface visual)
|
target_link_libraries(interface visual)
|
||||||
install( TARGETS interface ${NG_INSTALL_DIR})
|
if(NOT WIN32)
|
||||||
|
install( TARGETS interface ${NG_INSTALL_DIR})
|
||||||
|
endif(NOT WIN32)
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
writeuser.hpp
|
writeuser.hpp
|
||||||
|
@ -260,6 +260,7 @@ namespace netgen
|
|||||||
|
|
||||||
Point3d pmin, pmax;
|
Point3d pmin, pmax;
|
||||||
mesh.ComputeNVertices();
|
mesh.ComputeNVertices();
|
||||||
|
mesh.RebuildSurfaceElementLists();
|
||||||
mesh.GetBox (pmin, pmax);
|
mesh.GetBox (pmin, pmax);
|
||||||
cout << "bounding-box = " << pmin << "-" << pmax << endl;
|
cout << "bounding-box = " << pmin << "-" << pmax << endl;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,9 @@ endif(APPLE)
|
|||||||
target_link_libraries( mesh PUBLIC ngcore PRIVATE gprim la gen )
|
target_link_libraries( mesh PUBLIC ngcore PRIVATE gprim la gen )
|
||||||
|
|
||||||
target_link_libraries( mesh PUBLIC ${ZLIB_LIBRARIES} ${MPI_CXX_LIBRARIES} ${PYTHON_LIBRARIES} ${METIS_LIBRARY})
|
target_link_libraries( mesh PUBLIC ${ZLIB_LIBRARIES} ${MPI_CXX_LIBRARIES} ${PYTHON_LIBRARIES} ${METIS_LIBRARY})
|
||||||
install( TARGETS mesh ${NG_INSTALL_DIR})
|
if(NOT WIN32)
|
||||||
|
install( TARGETS mesh ${NG_INSTALL_DIR})
|
||||||
|
endif(NOT WIN32)
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
adfront2.hpp adfront3.hpp basegeom.hpp bcfunctions.hpp bisect.hpp
|
adfront2.hpp adfront3.hpp basegeom.hpp bcfunctions.hpp bisect.hpp
|
||||||
|
@ -409,6 +409,15 @@ namespace netgen
|
|||||||
|
|
||||||
static Array<shared_ptr<RecPol>> jacpols2;
|
static Array<shared_ptr<RecPol>> jacpols2;
|
||||||
|
|
||||||
|
void CurvedElements::buildJacPols()
|
||||||
|
{
|
||||||
|
if (!jacpols2.Size())
|
||||||
|
{
|
||||||
|
jacpols2.SetSize (100);
|
||||||
|
for (int i = 0; i < 100; i++)
|
||||||
|
jacpols2[i] = make_shared<JacobiRecPol> (100, i, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// compute face bubbles up to order n, 0 < y, y-x < 1, x+y < 1
|
// compute face bubbles up to order n, 0 < y, y-x < 1, x+y < 1
|
||||||
template <class Tx, class Ty, class Ts>
|
template <class Tx, class Ty, class Ts>
|
||||||
@ -540,7 +549,6 @@ namespace netgen
|
|||||||
|
|
||||||
CurvedElements :: ~CurvedElements()
|
CurvedElements :: ~CurvedElements()
|
||||||
{
|
{
|
||||||
jacpols2.SetSize(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -719,13 +727,7 @@ namespace netgen
|
|||||||
|
|
||||||
ComputeGaussRule (aorder+4, xi, weight); // on (0,1)
|
ComputeGaussRule (aorder+4, xi, weight); // on (0,1)
|
||||||
|
|
||||||
if (!jacpols2.Size())
|
buildJacPols();
|
||||||
{
|
|
||||||
jacpols2.SetSize (100);
|
|
||||||
for (int i = 0; i < 100; i++)
|
|
||||||
jacpols2[i] = make_shared<JacobiRecPol> (100, i, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
PrintMessage (3, "Curving edges");
|
PrintMessage (3, "Curving edges");
|
||||||
|
|
||||||
if (mesh.GetDimension() == 3 || rational)
|
if (mesh.GetDimension() == 3 || rational)
|
||||||
@ -2239,6 +2241,20 @@ namespace netgen
|
|||||||
|
|
||||||
switch (el.GetType())
|
switch (el.GetType())
|
||||||
{
|
{
|
||||||
|
case TRIG6:
|
||||||
|
{
|
||||||
|
AutoDiff<2,T> lam3 = 1-x-y;
|
||||||
|
AutoDiff<2,T> lami[6] = { x * (2*x-1), y * (2*y-1), lam3 * (2*lam3-1),
|
||||||
|
4 * y * lam3, 4 * x * lam3, 4 * x * y };
|
||||||
|
for (int j = 0; j < 6; j++)
|
||||||
|
{
|
||||||
|
Point<3> p = mesh[el[j]];
|
||||||
|
for (int k = 0; k < DIM_SPACE; k++)
|
||||||
|
mapped_x[k] += p(k) * lami[j];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case TRIG:
|
case TRIG:
|
||||||
{
|
{
|
||||||
// if (info.order >= 2) return false; // not yet supported
|
// if (info.order >= 2) return false; // not yet supported
|
||||||
|
@ -33,6 +33,7 @@ class CurvedElements
|
|||||||
bool rational;
|
bool rational;
|
||||||
|
|
||||||
bool ishighorder;
|
bool ishighorder;
|
||||||
|
void buildJacPols();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DLL_HEADER CurvedElements (const Mesh & amesh);
|
DLL_HEADER CurvedElements (const Mesh & amesh);
|
||||||
@ -50,6 +51,8 @@ public:
|
|||||||
|
|
||||||
virtual void DoArchive(Archive& ar)
|
virtual void DoArchive(Archive& ar)
|
||||||
{
|
{
|
||||||
|
if(ar.Input())
|
||||||
|
buildJacPols();
|
||||||
ar & edgeorder & faceorder & edgecoeffsindex & facecoeffsindex & edgecoeffs & facecoeffs
|
ar & edgeorder & faceorder & edgecoeffsindex & facecoeffsindex & edgecoeffs & facecoeffs
|
||||||
& edgeweight & order & rational & ishighorder;
|
& edgeweight & order & rational & ishighorder;
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,7 @@ namespace netgen
|
|||||||
|
|
||||||
Mesh & Mesh :: operator= (const Mesh & mesh2)
|
Mesh & Mesh :: operator= (const Mesh & mesh2)
|
||||||
{
|
{
|
||||||
|
dimension = mesh2.dimension;
|
||||||
points = mesh2.points;
|
points = mesh2.points;
|
||||||
// eltyps = mesh2.eltyps;
|
// eltyps = mesh2.eltyps;
|
||||||
segments = mesh2.segments;
|
segments = mesh2.segments;
|
||||||
@ -1320,6 +1321,7 @@ namespace netgen
|
|||||||
archive & segments;
|
archive & segments;
|
||||||
archive & facedecoding;
|
archive & facedecoding;
|
||||||
archive & materials & bcnames & cd2names & cd3names;
|
archive & materials & bcnames & cd2names & cd3names;
|
||||||
|
archive & numvertices;
|
||||||
|
|
||||||
archive & *ident;
|
archive & *ident;
|
||||||
|
|
||||||
@ -4995,6 +4997,10 @@ namespace netgen
|
|||||||
// netgen::Point<3> pmin = p - Vec<3> (pointtol, pointtol, pointtol);
|
// netgen::Point<3> pmin = p - Vec<3> (pointtol, pointtol, pointtol);
|
||||||
// netgen::Point<3> pmax = p + Vec<3> (pointtol, pointtol, pointtol);
|
// netgen::Point<3> pmax = p + Vec<3> (pointtol, pointtol, pointtol);
|
||||||
|
|
||||||
|
if ( (dimension == 2 && !GetNSE()) ||
|
||||||
|
(dimension == 3 && !GetNE() && !GetNSE()) )
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (dimension == 2 || (dimension==3 && !GetNE() && GetNSE()))
|
if (dimension == 2 || (dimension==3 && !GetNE() && GetNSE()))
|
||||||
{
|
{
|
||||||
int ne;
|
int ne;
|
||||||
|
@ -1140,6 +1140,7 @@ namespace netgen
|
|||||||
default: break;
|
default: break;
|
||||||
cerr << "Element::SetType unknown type " << int(typ) << endl;
|
cerr << "Element::SetType unknown type " << int(typ) << endl;
|
||||||
}
|
}
|
||||||
|
is_curved = (np > 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -765,11 +765,12 @@ namespace netgen
|
|||||||
void DoArchive (Archive & ar)
|
void DoArchive (Archive & ar)
|
||||||
{
|
{
|
||||||
short _np, _typ;
|
short _np, _typ;
|
||||||
|
bool _curved;
|
||||||
if (ar.Output())
|
if (ar.Output())
|
||||||
{ _np = np; _typ = typ; }
|
{ _np = np; _typ = typ; _curved = is_curved; }
|
||||||
ar & _np & _typ & index;
|
ar & _np & _typ & index & _curved;
|
||||||
if (ar.Input())
|
if (ar.Input())
|
||||||
{ np = _np; typ = ELEMENT_TYPE(_typ); }
|
{ np = _np; typ = ELEMENT_TYPE(_typ); is_curved = _curved; }
|
||||||
for (size_t i = 0; i < np; i++)
|
for (size_t i = 0; i < np; i++)
|
||||||
ar & pnum[i];
|
ar & pnum[i];
|
||||||
}
|
}
|
||||||
|
@ -745,6 +745,38 @@ namespace netgen
|
|||||||
|
|
||||||
MPI_Barrier(comm);
|
MPI_Barrier(comm);
|
||||||
|
|
||||||
|
PrintMessage( 3, "Clean up local memory");
|
||||||
|
|
||||||
|
auto & self = const_cast<Mesh&>(*this);
|
||||||
|
self.points = T_POINTS(0);
|
||||||
|
self.surfelements = T_SURFELEMENTS(0);
|
||||||
|
self.volelements = T_VOLELEMENTS(0);
|
||||||
|
self.segments = Array<Segment, 0, size_t>(0);
|
||||||
|
self.lockedpoints = Array<PointIndex>(0);
|
||||||
|
auto cleanup_ptr = [](auto & ptr) {
|
||||||
|
if (ptr != nullptr) {
|
||||||
|
delete ptr;
|
||||||
|
ptr = nullptr;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
cleanup_ptr(self.boundaryedges);
|
||||||
|
cleanup_ptr(self.boundaryedges);
|
||||||
|
cleanup_ptr(self.segmentht);
|
||||||
|
cleanup_ptr(self.surfelementht);
|
||||||
|
self.openelements = Array<Element2d>(0);
|
||||||
|
self.opensegments = Array<Segment>(0);
|
||||||
|
self.numvertices = 0;
|
||||||
|
self.mlbetweennodes = Array<PointIndices<2>,PointIndex::BASE> (0);
|
||||||
|
self.mlparentelement = Array<int>(0);
|
||||||
|
self.mlparentsurfaceelement = Array<int>(0);
|
||||||
|
self.topology.Update();
|
||||||
|
self.curvedelems = new CurvedElements (self);
|
||||||
|
self.clusters = new AnisotropicClusters (self);
|
||||||
|
self.ident = new Identifications (self);
|
||||||
|
self.BuildElementSearchTree();
|
||||||
|
|
||||||
|
// const_cast<Mesh&>(*this).DeleteMesh();
|
||||||
|
|
||||||
PrintMessage( 3, "send mesh complete");
|
PrintMessage( 3, "send mesh complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
extern bool netgen_executable_started;
|
extern bool netgen_executable_started;
|
||||||
extern shared_ptr<NetgenGeometry> ng_geometry;
|
extern shared_ptr<NetgenGeometry> ng_geometry;
|
||||||
|
extern void Optimize2d (Mesh & mesh, MeshingParameters & mp);
|
||||||
|
|
||||||
#ifdef PARALLEL
|
#ifdef PARALLEL
|
||||||
/** we need allreduce in python-wrapped communicators **/
|
/** we need allreduce in python-wrapped communicators **/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -865,14 +867,21 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
|||||||
},
|
},
|
||||||
py::arg("mp")=NGDummyArgument(),py::call_guard<py::gil_scoped_release>())
|
py::arg("mp")=NGDummyArgument(),py::call_guard<py::gil_scoped_release>())
|
||||||
|
|
||||||
.def ("OptimizeVolumeMesh", FunctionPointer
|
.def ("OptimizeVolumeMesh", [](Mesh & self)
|
||||||
([](Mesh & self)
|
|
||||||
{
|
{
|
||||||
MeshingParameters mp;
|
MeshingParameters mp;
|
||||||
mp.optsteps3d = 5;
|
mp.optsteps3d = 5;
|
||||||
OptimizeVolume (mp, self);
|
OptimizeVolume (mp, self);
|
||||||
}),py::call_guard<py::gil_scoped_release>())
|
},py::call_guard<py::gil_scoped_release>())
|
||||||
|
|
||||||
|
.def ("OptimizeMesh2d", [](Mesh & self)
|
||||||
|
{
|
||||||
|
self.CalcLocalH(0.5);
|
||||||
|
MeshingParameters mp;
|
||||||
|
mp.optsteps2d = 5;
|
||||||
|
Optimize2d (self, mp);
|
||||||
|
},py::call_guard<py::gil_scoped_release>())
|
||||||
|
|
||||||
.def ("Refine", FunctionPointer
|
.def ("Refine", FunctionPointer
|
||||||
([](Mesh & self)
|
([](Mesh & self)
|
||||||
{
|
{
|
||||||
@ -975,12 +984,17 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
|||||||
},
|
},
|
||||||
py::arg("name"), py::arg("set")=true)
|
py::arg("name"), py::arg("set")=true)
|
||||||
|
|
||||||
.def ("Scale", FunctionPointer([](Mesh & self, double factor)
|
.def ("Scale", [](Mesh & self, double factor)
|
||||||
{
|
{
|
||||||
for(auto i = 0; i<self.GetNP();i++)
|
for(auto i = 0; i<self.GetNP();i++)
|
||||||
self.Point(i).Scale(factor);
|
self.Point(i).Scale(factor);
|
||||||
}))
|
})
|
||||||
|
.def ("Copy", [](Mesh & self)
|
||||||
|
{
|
||||||
|
auto m2 = make_shared<Mesh> ();
|
||||||
|
*m2 = self;
|
||||||
|
return m2;
|
||||||
|
})
|
||||||
;
|
;
|
||||||
|
|
||||||
m.def("ImportMesh", [](const string& filename)
|
m.def("ImportMesh", [](const string& filename)
|
||||||
|
@ -4005,8 +4005,8 @@ namespace netgen
|
|||||||
Array<int> compress(n3);
|
Array<int> compress(n3);
|
||||||
|
|
||||||
NgProfiler::StartTimer (timer_vals);
|
NgProfiler::StartTimer (timer_vals);
|
||||||
Array<double,PointIndex::BASE> vertval(mesh->GetNV());
|
Array<double,PointIndex::BASE> vertval(mesh->GetNP());
|
||||||
Array<bool,PointIndex::BASE> posval(mesh->GetNV());
|
Array<bool,PointIndex::BASE> posval(mesh->GetNP());
|
||||||
for (PointIndex pi = vertval.Begin(); pi < vertval.End(); pi++)
|
for (PointIndex pi = vertval.Begin(); pi < vertval.End(); pi++)
|
||||||
{
|
{
|
||||||
Point<3> vert = (*mesh)[pi];
|
Point<3> vert = (*mesh)[pi];
|
||||||
|
6
tests/build_mpi.sh
Normal file
6
tests/build_mpi.sh
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
cd
|
||||||
|
mkdir -p build/netgen
|
||||||
|
cd build/netgen
|
||||||
|
cmake ../../src/netgen -DUSE_CCACHE=ON -DUSE_MPI=ON
|
||||||
|
make -j12
|
||||||
|
make install
|
5
tests/dockerfile_mpi
Normal file
5
tests/dockerfile_mpi
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM ubuntu:18.04
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
MAINTAINER Matthias Hochsteger <matthias.hochsteger@tuwien.ac.at>
|
||||||
|
RUN apt-get update && apt-get -y install python3 libpython3-dev libxmu-dev tk-dev tcl-dev cmake git g++ libglu1-mesa-dev ccache python3-pytest python3-numpy python3-tk clang-tidy python3-distutils clang libopenmpi-dev openmpi-bin gfortran
|
||||||
|
ADD . /root/src/netgen
|
Loading…
Reference in New Issue
Block a user