← Back to team overview

yade-dev team mailing list archive

Re: Yade with CGAL 4.11

 

Thank you guys, the removal of --no-parallel was especially useful :-)

It is still compiling as I write it, but it seems that I have managed
to fix it. In short: they have changed the internal CGAL architecture
to treat weighted points.


The first error indicated that there is no implicit conversion from
type Weighted_point_3 to type Point_3. On that topic first google reveals
https://github.com/CGAL/cgal/issues/1878
https://github.com/CGAL/cgal/pull/2102

First I wanted to perform explicit conversion. This is based on
assumption that in older CGAL 4.9 this conversion was implicit, so it
was performed anyway. I thought that since they were cleaning their
code, they wanted users to be aware that the conversion has to be
done, and perhaps sometimes it was done even though it wasn't
desirable.

To perform those conversions I was trying to use file
<CGAL/Regular_triangulation_traits_adapter.h> in multitude of
different ways, but it turns out that was not they direction to go.
Even though there is that encouraging comment inside this file:

// Wrapper class to make a model of `RegularTriangulationTraits` easily usable
// by the `Regular_triangulation` class. By using this class:
// - Point_d (used by `Triangulation` and the TDS) becomes a weighted point
// - Predicates and functors such as Less_coordinate_d or Orientation_d
//   can be called using weighted points instead of bare points (this is
//   needed because `Weighted_point_d` is not convertible to `Point_d`)
// This way, `Triangulation` works perfectly well with weighted points.

Well, I underestimated the word "perfectly". They meant that. I did
not have to include this file, and use it. It was used automatically.

Since that was not the way to go I suddenly had the idea to compare files:

/tmp/CGAL/CGAL-4.9/examples/Triangulation_3/regular_3.cpp
/tmp/CGAL/CGAL-4.11/examples/Triangulation_3/regular_3.cpp

from both of their release source codes. Then I performed
the same exact changes in lib/triangulation/RegularTriangulation.h as
they have done when modifying their example.
This helped a bit. And actually the solution was written by compiler
many times, inside <CGAL/Regular_triangulation_euclidean_traits_3.h>
in deprectation warning:

#define CGAL_DEPRECATED_MESSAGE_DETAILS \
  "The kernel K can be used directly as traits since weighted points and "\
  "the associated function objects are now part of the concept Kernel."

This meant that I didn't have to use:
typedef CGAL::Regular_triangulation_euclidean_traits_3<K> Traits;
but instead just this:
typedef K Traits;

From this point things got a bit simpler. I still had to change some
small stuff, and read g++ errors with 2403 characters in length :)
But vim & macros helped me a lot in indenting those pesky brackets < > :-)
So they were more readable.


After I finished the stuff above, the compilation errors were much farther
during the compilation. And it turns out that indeed I had to add `.point()`
to nearly every invocation of Weighted_point_3 when a Point_3 was
required, but without the weight. The changes were scattered a bit
through the code.

It still didn't compile successfully while I write this email, but the
fixes are now really boring and automatic. The only problem is that
I have to wait several minutes to reveal next error where I have to
add `.point()`.

Oh, it has compiled now! So I am sending you this diff, which fixes
compilation with cgal 4.11 :)

I suppose, Bruno, you still have to proofread it.

Please just remember that this diff is not against git trunk, but
against the version in debian stretch yade-2017.01a.

I added those #if CGAL_VERSION_NR …… everywhere in order to make sure
that it still works also with previous CGAL.

btw, I also added some ALPHASHAPE define guards ;)

best regards
Janek


Bruno Chareyre said:     (by the date of Fri, 3 Nov 2017 11:02:19 +0100)

> Hi Janek,
> 
> I don't think I'll be able to test this very quickly myself. Based on 
> the compile logs the evident problem is [1].
> Which sounds like a trivial issue. However, it may be the case that they 
> really changed the design of the so-called geometry kernel (as suggested 
> by [2]) and that it needs some changes in the source code (which only me 
> can do, I guess). I'll need to check CGAL's changelogs, I'll update you 
> here if I find something relevant.
> 
> Bruno
> 
> [1] /tmp/cgal/yade-2017.01a/lib/triangulation/Network.ipp:4:10: fatal 
> error: 
> CGAL/constructions/constructions_on_weighted_points_cartesian_3.h: No 
> such file or directory
> 
> [2] /usr/include/CGAL/internal/deprecation_warning.h:83:293: note: 
> #pragma message: Warning: The header 
> `<CGAL/Regular_triangulation_euclidean_traits_3.h>` is deprecated. 
> Additional information: The kernel K can be used directly as traits 
> since weighted points and the associated function objects are now part 
> of the concept Kernel. # pragma message (CGAL_INTERNAL_DEPRECATED_MESSAGE)
> 
> On 11/03/2017 10:21 AM, Janek Kozicki wrote:
> > Hi,
> >
> > I am building with `time dpkg-buildpackage -rfakeroot -b -j32` but it appears that -j32 is deliberately ignored. I understand why, but my PC is powerful enough ;) Can you tell me how to enable it back?
> >
> > It must be somewhere in ./debian/* dir that you have prepared.
> >
> > best regards
> > Janek
> >
> > Janek Kozicki said:     (by the date of Fri, 3 Nov 2017 09:43:25 +0100)
> >
> >> Hi Anton,
> >>
> >> did you try to fix it yourself during past week? (I see that this bug
> >> report is a week old) If yes, do you have maybe some useful advice?
> >>
> >> Am I correct that this FTBFS is about yade in (clean install of)
> >> stretch with CGAL 4.11 pulled from experimental?
> >>
> >> best regards
> >> Janek
> >>
> >>
> >> Anton Gladky said:     (by the date of Thu, 2 Nov 2017 21:22:51 +0100)
> >>
> >>> Hi all,
> >>>
> >>> it looks like Yade is not compatible with the new CGAL 4.11 and
> >>> it blocks the upload of new CGAL into the Debian [1].
> >>>
> >>> It would be good if somebody could try to fix this issue.
> >>>
> >>> [1] https://bugs.debian.org/876524
> >>>
> >>> Thanks
> >>>
> >>> Anton
> >>>
> >>> _______________________________________________
> >>> Mailing list: https://launchpad.net/~yade-dev
> >>> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> >>> Unsubscribe : https://launchpad.net/~yade-dev
> >>> More help   : https://help.launchpad.net/ListHelp
> >>
> >> -- 
> >> Janek Kozicki                               http://janek.kozicki.pl/  |
> >>
> >> _______________________________________________
> >> Mailing list: https://launchpad.net/~yade-dev
> >> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> >> Unsubscribe : https://launchpad.net/~yade-dev
> >> More help   : https://help.launchpad.net/ListHelp
> >
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp


-- 
Janek Kozicki                               http://janek.kozicki.pl/  |
diff --git a/lib/triangulation/FlowBoundingSphere.ipp b/lib/triangulation/FlowBoundingSphere.ipp
index 86d21f3..a1f2e0e 100644
--- a/lib/triangulation/FlowBoundingSphere.ipp
+++ b/lib/triangulation/FlowBoundingSphere.ipp
@@ -110,7 +110,11 @@ void FlowBoundingSphere<Tesselation>::averageRelativeCellVelocity()
 				CVector Surfk = cell->info()-cell->neighbor(i)->info();
 				Real area = sqrt ( Surfk.squared_length() );
 				Surfk = Surfk/area;
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
                         	CVector branch = cell->vertex ( facetVertices[i][0] )->point() - cell->info();
+#else
+                        	CVector branch = cell->vertex ( facetVertices[i][0] )->point().point() - cell->info();
+#endif
                         	posAvFacet = (Point) cell->info() + ( branch*Surfk ) *Surfk;
 				facetFlowRate = (cell->info().kNorm())[i] * (cell->info().shiftedP() - cell->neighbor (i)->info().shiftedP());
 				totFlowRate += facetFlowRate;
@@ -215,7 +219,11 @@ double FlowBoundingSphere<Tesselation>::getPorePressure (double X, double Y, dou
 {
 	if (noCache && T[!currentTes].Max_id()<=0) return 0;//the engine never solved anything
 	RTriangulation& Tri = T[noCache?(!currentTes):currentTes].Triangulation();
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 	CellHandle cell = Tri.locate(Point(X,Y,Z));
+#else
+	CellHandle cell = Tri.locate(CGT::Sphere(X,Y,Z));
+#endif
 	return cell->info().p();
 }
 
@@ -224,7 +232,11 @@ int FlowBoundingSphere<Tesselation>::getCell (double X, double Y, double Z)
 {
 	if (noCache && T[!currentTes].Max_id()<=0) {cout<<"Triangulation does not exist. Sorry."<<endl; return -1;}
 	RTriangulation& Tri = T[noCache?(!currentTes):currentTes].Triangulation();
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 	CellHandle cell = Tri.locate(Point(X,Y,Z));
+#else
+	CellHandle cell = Tri.locate(CGT::Sphere(X,Y,Z));
+#endif
 	return cell->info().id;
 }
 
@@ -245,7 +257,11 @@ void FlowBoundingSphere<Tesselation>::measurePressureProfile(double WallUpy, dou
 	int cell=0;
 	for (int i=0; i<captures; i++){
         for (double Z=min(zMin,zMax); Z<=max(zMin,zMax); Z+=std::abs(Rz)) {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 		permeameter = Tri.locate(Point(X, Y, Z));
+#else
+		permeameter = Tri.locate(CGT::Sphere(X, Y, Z));
+#endif
 		pressure+=permeameter->info().p();
 		cell++;
         }
@@ -264,7 +280,11 @@ double FlowBoundingSphere<Tesselation>::averageSlicePressure(double Y)
   double Rz = (zMax-zMin)/30;
   for (double X=xMin; X<=xMax+Ry/10; X=X+Rx) {
 	for (double Z=zMin; Z<=zMax+Ry/10; Z=Z+Rz) {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 	  P_ave+=Tri.locate(Point(X, Y, Z))->info().p();
+#else
+	  P_ave+=Tri.locate(CGT::Sphere(X, Y, Z))->info().p();
+#endif
 	  n++;
 	}
   }
@@ -433,7 +453,11 @@ template <class Tesselation>
 CVector FlowBoundingSphere<Tesselation>::cellBarycenter(CellHandle& cell)
 {
 	CVector center ( 0,0,0 );
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 	for ( int k=0;k<4;k++ ) center= center + 0.25* (cell->vertex(k)->point()-CGAL::ORIGIN);
+#else
+	for ( int k=0;k<4;k++ ) center= center + 0.25* (cell->vertex(k)->point().point()-CGAL::ORIGIN);
+#endif
 	return center;
 }
 
@@ -446,17 +470,29 @@ void FlowBoundingSphere<Tesselation>::interpolate(Tesselation& Tes, Tesselation&
 		CellHandle& newCell = *cellIt;
 		if (newCell->info().Pcondition || newCell->info().isGhost) continue;
 		CVector center ( 0,0,0 );
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 		if (newCell->info().fictious()==0) for ( int k=0;k<4;k++ ) center= center + 0.25* (Tes.vertex(newCell->vertex(k)->info().id())->point()-CGAL::ORIGIN);
+#else
+		if (newCell->info().fictious()==0) for ( int k=0;k<4;k++ ) center= center + 0.25* (Tes.vertex(newCell->vertex(k)->info().id())->point().point()-CGAL::ORIGIN);
+#endif
 		else {
 			Real boundPos=0; int coord=0;
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 			for ( int k=0;k<4;k++ ) if (!newCell->vertex (k)->info().isFictious) center= center+(1./(4.-newCell->info().fictious()))*(Tes.vertex(newCell->vertex(k)->info().id())->point()-CGAL::ORIGIN);
+#else
+			for ( int k=0;k<4;k++ ) if (!newCell->vertex (k)->info().isFictious) center= center+(1./(4.-newCell->info().fictious()))*(Tes.vertex(newCell->vertex(k)->info().id())->point().point()-CGAL::ORIGIN);
+#endif
 			for ( int k=0;k<4;k++ ) if (newCell->vertex (k)->info().isFictious) {
 					coord=boundary (newCell->vertex(k)->info().id()).coordinate;
 					boundPos=boundary (newCell->vertex(k)->info().id()).p[coord];
 					center=CVector(coord==0?boundPos:center[0],coord==1?boundPos:center[1],coord==2?boundPos:center[2]);
 				}
 		}
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
                 oldCell = Tri.locate(Point(center[0],center[1],center[2]));
+#else
+                oldCell = Tri.locate(CGT::Sphere(center[0],center[1],center[2]));
+#endif
 		newCell->info().getInfo(oldCell->info());
 //                 newCell->info().p() = oldCell->info().shiftedP();
         }
@@ -467,12 +503,23 @@ template <class Tesselation>
 Real FlowBoundingSphere<Tesselation>::checkSphereFacetOverlap(const Sphere& v0, const Sphere& v1, const Sphere& v2)
 {
 	//First, check that v0 projection fall between v1 and v2...
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 	Real dist=(v0-v1)*(v2-v1);
 	if (dist<0) return 0;
 	Real v1v2=(v2-v1).squared_length();
 	if (dist>v1v2) return 0;
+#else
+	Real dist=(v0.point()-v1.point())*(v2.point()-v1.point());
+	if (dist<0) return 0;
+	Real v1v2=(v2.point()-v1.point()).squared_length();
+	if (dist>v1v2) return 0;
+#endif
 	//... then, check distance
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 	Real m=(cross_product(v0-v1,v2-v1)).squared_length()/v1v2;
+#else
+	Real m=(cross_product(v0.point()-v1.point(),v2.point()-v1.point())).squared_length()/v1v2;
+#endif
 	if (m<v0.weight()) {
 		Real d=2*sqrt((v0.weight()-m));
 		Real teta=2*acos(sqrt(m/v0.weight()));
@@ -530,9 +577,15 @@ void FlowBoundingSphere<Tesselation>::computePermeability()
 				Sphere& v1 = W[1]->point();
 				Sphere& v2 = W[2]->point();
 				cell->info().facetSphereCrossSections[j]=CVector(
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 				   W[0]->info().isFictious ? 0 : 0.5*v0.weight()*acos((v1-v0)*(v2-v0)/sqrt((v1-v0).squared_length()*(v2-v0).squared_length())),
 				   W[1]->info().isFictious ? 0 : 0.5*v1.weight()*acos((v0-v1)*(v2-v1)/sqrt((v1-v0).squared_length()*(v2-v1).squared_length())),
 				   W[2]->info().isFictious ? 0 : 0.5*v2.weight()*acos((v0-v2)*(v1-v2)/sqrt((v1-v2).squared_length()*(v2-v0).squared_length())));
+#else
+				   W[0]->info().isFictious ? 0 : 0.5*v0.weight()*acos((v1.point()-v0.point())*(v2.point()-v0.point())/sqrt((v1.point()-v0.point()).squared_length()*(v2.point()-v0.point()).squared_length())),
+				   W[1]->info().isFictious ? 0 : 0.5*v1.weight()*acos((v0.point()-v1.point())*(v2.point()-v1.point())/sqrt((v1.point()-v0.point()).squared_length()*(v2.point()-v1.point()).squared_length())),
+				   W[2]->info().isFictious ? 0 : 0.5*v2.weight()*acos((v0.point()-v2.point())*(v1.point()-v2.point())/sqrt((v1.point()-v2.point()).squared_length()*(v2.point()-v0.point()).squared_length())));
+#endif
 				//FIXME: it should be possible to skip completely blocked cells, currently the problem is it segfault for undefined areas
 // 				if (cell->info().blocked) continue;//We don't need permeability for blocked cells, it will be set to zero anyway
 				pass+=1;
@@ -785,7 +838,12 @@ void FlowBoundingSphere<Tesselation>::initializePressure( double pZero )
         
         IPCells.clear();
         for (unsigned int n=0; n<imposedP.size();n++) {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 		CellHandle cell=Tri.locate(imposedP[n].first);
+#else
+#warning "This needs Bruno's attention https://doc.cgal.org/latest/Kernel_23/classCGAL_1_1Weighted__point__3.html seems like weights are ignored"
+		CellHandle cell=Tri.locate(CGT::Sphere(imposedP[n].first,0));
+#endif
 		//check redundancy
 		for (unsigned int kk=0;kk<IPCells.size();kk++){
 			if (cell==IPCells[kk]) cerr<<"Two imposed pressures fall in the same cell."<<endl;
@@ -797,7 +855,12 @@ void FlowBoundingSphere<Tesselation>::initializePressure( double pZero )
 
 	IFCells.clear();
 	for (unsigned int n=0; n<imposedF.size();n++) {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 		CellHandle cell=Tri.locate(imposedF[n].first);
+#else
+#warning "This needs Bruno's attention"
+		CellHandle cell=Tri.locate(CGT::Sphere(imposedF[n].first,0));
+#endif
 		//check redundancy
 		for (unsigned int kk=0;kk<IPCells.size();kk++){
 			if (cell==IPCells[kk]) cerr<<"Both flux and pressure are imposed in the same cell."<<endl;
diff --git a/lib/triangulation/FlowBoundingSphereLinSolv.ipp b/lib/triangulation/FlowBoundingSphereLinSolv.ipp
index ed88603..6eb78e8 100644
--- a/lib/triangulation/FlowBoundingSphereLinSolv.ipp
+++ b/lib/triangulation/FlowBoundingSphereLinSolv.ipp
@@ -9,7 +9,9 @@
 
 // #define XVIEW
 #include "FlowBoundingSphereLinSolv.hpp"//include after #define XVIEW
-#include "CGAL/constructions/constructions_on_weighted_points_cartesian_3.h"
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
+	#include "CGAL/constructions/constructions_on_weighted_points_cartesian_3.h"
+#endif
 #include <CGAL/Width_3.h>
 #include <iostream>
 #include <fstream>
diff --git a/lib/triangulation/KinematicLocalisationAnalyser.cpp b/lib/triangulation/KinematicLocalisationAnalyser.cpp
index f4e2189..39899fb 100644
--- a/lib/triangulation/KinematicLocalisationAnalyser.cpp
+++ b/lib/triangulation/KinematicLocalisationAnalyser.cpp
@@ -447,7 +447,11 @@ NormalDisplacementDistribution(vector<Edge_iterator>& edges, vector<pair<Real,Re
 			ed_it!=ed_end; ++ed_it) {
 		Vh1= (*ed_it)->first->vertex((*ed_it)->second);
 		Vh2= (*ed_it)->first->vertex((*ed_it)->third);
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 		branch = Vh1->point()- Vh2->point();
+#else
+		branch = Vh1->point().point()- Vh2->point().point();
+#endif
 		NORMALIZE(branch);
 		if (consecutive)
 			U = TS1->grain(Vh1->info().id()).translation -
@@ -741,10 +745,18 @@ CVector KinematicLocalisationAnalyser::Deplacement(Finite_cells_iterator cell, i
 
 void KinematicLocalisationAnalyser::Grad_u(Finite_cells_iterator cell, int facet, CVector &V, Tenseur3& T)
 {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 	CVector S = cross_product((cell->vertex(l_vertices[facet][1])->point())
 							  - (cell->vertex(l_vertices[facet][0])->point()),
 							  (cell->vertex(l_vertices[facet][2])->point()) -
 							  (cell->vertex(l_vertices[facet][1])->point())) /2.f;
+#else
+	CVector S = cross_product((cell->vertex(l_vertices[facet][1])->point().point())
+							  - (cell->vertex(l_vertices[facet][0])->point().point()),
+							  (cell->vertex(l_vertices[facet][2])->point().point()) -
+							  (cell->vertex(l_vertices[facet][1])->point().point())) /2.f;
+#endif
+
 	Somme(T, V, S);
 }
 
diff --git a/lib/triangulation/Network.ipp b/lib/triangulation/Network.ipp
index fb26b3a..6d72012 100644
--- a/lib/triangulation/Network.ipp
+++ b/lib/triangulation/Network.ipp
@@ -1,7 +1,9 @@
 
 #ifdef FLOW_ENGINE
 
-#include "CGAL/constructions/constructions_on_weighted_points_cartesian_3.h"
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
+	#include "CGAL/constructions/constructions_on_weighted_points_cartesian_3.h"
+#endif
 #include <iostream>
 #include <fstream>
 #include <new>
@@ -66,7 +68,11 @@ double Network<Tesselation>::volumePoreVoronoiFraction (CellHandle& cell, int& j
                 VertexHandle& SV2 = W[1];
                 VertexHandle& SV3 = W[2];
 
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
                 cell->info().facetSurfaces[j]=0.5*CGAL::cross_product(SV1->point()-SV3->point(),SV2->point()-SV3->point());
+#else
+                cell->info().facetSurfaces[j]=0.5*CGAL::cross_product(SV1->point().point()-SV3->point().point(),SV2->point().point()-SV3->point().point());
+#endif
 		if (cell->info().facetSurfaces[j][0]==0 && cell->info().facetSurfaces[j][1]==0 && cell->info().facetSurfaces[j][2]==0) cerr<<"NULL FACET SURF"<<endl;
                 if (cell->info().facetSurfaces[j]*(p2-p1) > 0) cell->info().facetSurfaces[j] = -1.0*cell->info().facetSurfaces[j];
                 Real Vtot = abs(ONE_THIRD*cell->info().facetSurfaces[j]*(p1-p2));
@@ -74,8 +80,13 @@ double Network<Tesselation>::volumePoreVoronoiFraction (CellHandle& cell, int& j
 		
                 double Vsolid1=0, Vsolid2=0;
                 for (int i=0;i<3;i++) {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
                 Vsolid1 += sphericalTriangleVolume(v[permut3[i][0]],v[permut3[i][1]],p1,p2);
                 Vsolid2 += sphericalTriangleVolume(v[permut3[i][0]],v[permut3[i][2]],p1,p2);}
+#else
+                Vsolid1 += sphericalTriangleVolume(v[permut3[i][0]],v[permut3[i][1]].point(),p1,p2);
+                Vsolid2 += sphericalTriangleVolume(v[permut3[i][0]],v[permut3[i][2]].point(),p1,p2);}
+#endif
 
 		VSolidTot += Vsolid1 + Vsolid2;
 		vPoral += Vtot - (Vsolid1 + Vsolid2);
@@ -98,7 +109,11 @@ double Network<Tesselation>::volumeSolidPore (const CellHandle& cell)
 {
   double Vsolid=0;
   for (int i=0;i<4;i++) {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 	if ( !cell->vertex(permut4[i][0])->info().isFictious ) Vsolid += sphericalTriangleVolume( cell->vertex(permut4[i][0])->point(), cell->vertex(permut4[i][1])->point(), cell->vertex(permut4[i][2])-> point(), cell->vertex(permut4[i][3])-> point());
+#else
+	if ( !cell->vertex(permut4[i][0])->info().isFictious ) Vsolid += sphericalTriangleVolume( cell->vertex(permut4[i][0])->point(), cell->vertex(permut4[i][1])->point().point(), cell->vertex(permut4[i][2])-> point().point(), cell->vertex(permut4[i][3])-> point().point());
+#endif
   }
   return Vsolid;
 }
@@ -128,8 +143,13 @@ double Network<Tesselation>::volumeSingleFictiousPore(const VertexHandle& SV1, c
         Sphere& SW2 = SV2->point();
         Sphere& SW3 = SV3->point();
 
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
         Real Vsolid1 = sphericalTriangleVolume(SW2, AA, PV1, PV2)+sphericalTriangleVolume(SW2, SW3, PV1, PV2);
         Real Vsolid2 = sphericalTriangleVolume(SW3, BB, PV1, PV2)+sphericalTriangleVolume(SW3, SW2, PV1, PV2);
+#else
+        Real Vsolid1 = sphericalTriangleVolume(SW2, AA, PV1, PV2)+sphericalTriangleVolume(SW2, SW3.point(), PV1, PV2);
+        Real Vsolid2 = sphericalTriangleVolume(SW3, BB, PV1, PV2)+sphericalTriangleVolume(SW3, SW2.point(), PV1, PV2);
+#endif
 	
 	VSolidTot += Vsolid1 + Vsolid2;
 	vPoral += Vtot - (Vsolid1 + Vsolid2);
@@ -151,7 +171,11 @@ double Network<Tesselation>::volumeDoubleFictiousPore(const VertexHandle& SV1, c
         Point AA(A[0],A[1],A[2]);
         Point BB(B[0],B[1],B[2]);
 
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
         facetSurface = CGAL::cross_product(SV3->point()-AA,SV3->point()-BB);
+#else
+        facetSurface = CGAL::cross_product(SV3->point().point()-AA,SV3->point().point()-BB);
+#endif
         if (facetSurface*(PV2-PV1) > 0) facetSurface = -1.0*facetSurface;
         Real Vtot = abs(facetSurface*(PV1-PV2))*ONE_THIRD;
 	Vtotalissimo += Vtot;
@@ -179,7 +203,11 @@ double Network<Tesselation>::fastSphericalTriangleArea(const Sphere& STA1, const
         using namespace CGAL;
         double rayon2 = STA1.weight();
         if (rayon2 == 0.0) return 0.0;
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
         return rayon2 * fastSolidAngle(STA1,STA2,STA3,PTA1);
+#else
+        return rayon2 * fastSolidAngle(STA1.point(),STA2,STA3,PTA1);
+#endif
 }
 
 template<class Tesselation>
@@ -273,6 +301,7 @@ double Network<Tesselation>::surfaceSolidThroat(CellHandle cell, int j, bool sli
                 VertexHandle& SV2 = W[1];
                 VertexHandle& SV3 = W[2];
 
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 		Ssolid1 = fastSphericalTriangleArea(SV1->point(), SV2->point(), p1, p2);
                 Ssolid1n = fastSphericalTriangleArea(SV1->point(), SV3->point(), p1, p2);
                 cell->info().solidSurfaces[j][0]=Ssolid1+Ssolid1n;
@@ -282,6 +311,17 @@ double Network<Tesselation>::surfaceSolidThroat(CellHandle cell, int j, bool sli
                 Ssolid3 = fastSphericalTriangleArea(SV3->point(),SV2->point(),p1, p2);
                 Ssolid3n = fastSphericalTriangleArea(SV3->point(),SV1->point(),p1, p2);
                 cell->info().solidSurfaces[j][2]=Ssolid3+Ssolid3n;
+#else
+		Ssolid1 = fastSphericalTriangleArea(SV1->point(), SV2->point().point(), p1, p2);
+                Ssolid1n = fastSphericalTriangleArea(SV1->point(), SV3->point().point(), p1, p2);
+                cell->info().solidSurfaces[j][0]=Ssolid1+Ssolid1n;
+                Ssolid2 = fastSphericalTriangleArea(SV2->point(),SV1->point().point(),p1, p2);
+                Ssolid2n = fastSphericalTriangleArea(SV2->point(),SV3->point().point(),p1, p2);
+                cell->info().solidSurfaces[j][1]=Ssolid2+Ssolid2n;
+                Ssolid3 = fastSphericalTriangleArea(SV3->point(),SV2->point().point(),p1, p2);
+                Ssolid3n = fastSphericalTriangleArea(SV3->point(),SV1->point().point(),p1, p2);
+                cell->info().solidSurfaces[j][2]=Ssolid3+Ssolid3n;
+#endif
 
     }; break;
     case (1) : {
@@ -292,15 +332,28 @@ double Network<Tesselation>::surfaceSolidThroat(CellHandle cell, int j, bool sli
 		Boundary &bi1 =  boundary(SV1->info().id());
                 Ssolid1 = 0;
 		if (bi1.flowCondition && ! slipBoundary) {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
                         Ssolid1 = abs(0.5*CGAL::cross_product(p1-p2, SV2->point()-SV3->point())[bi1.coordinate]);
+#else
+                        Ssolid1 = abs(0.5*CGAL::cross_product(p1-p2, SV2->point().point()-SV3->point().point())[bi1.coordinate]);
+#endif
                         cell->info().solidSurfaces[j][facetF1]=Ssolid1;
                 }
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
                 Ssolid2 = fastSphericalTriangleArea(SV2->point(),SV1->point(),p1, p2);
                 Ssolid2n = fastSphericalTriangleArea(SV2->point(),SV3->point(),p1, p2);
                 cell->info().solidSurfaces[j][facetRe1]=Ssolid2+Ssolid2n;
                 Ssolid3 = fastSphericalTriangleArea(SV3->point(),SV2->point(),p1, p2);
                 Ssolid3n = fastSphericalTriangleArea(SV3->point(),SV1->point(),p1, p2);
                 cell->info().solidSurfaces[j][facetRe2]=Ssolid3+Ssolid3n;
+#else
+                Ssolid2 = fastSphericalTriangleArea(SV2->point(),SV1->point().point(),p1, p2);
+                Ssolid2n = fastSphericalTriangleArea(SV2->point(),SV3->point().point(),p1, p2);
+                cell->info().solidSurfaces[j][facetRe1]=Ssolid2+Ssolid2n;
+                Ssolid3 = fastSphericalTriangleArea(SV3->point(),SV2->point().point(),p1, p2);
+                Ssolid3n = fastSphericalTriangleArea(SV3->point(),SV1->point().point(),p1, p2);
+                cell->info().solidSurfaces[j][facetRe2]=Ssolid3+Ssolid3n;
+#endif
     }; break;
     case (2) : {
 
@@ -331,7 +384,11 @@ double Network<Tesselation>::surfaceSolidThroat(CellHandle cell, int j, bool sli
                 Ssolid1n = fastSphericalTriangleArea(SV3->point(), BB, p1, p2);
                 cell->info().solidSurfaces[j][facetRe1]=Ssolid1+Ssolid1n;
                 //area vector of triangle (p1,sphere,p2)
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
                 CVector p1p2v1Surface = 0.5*CGAL::cross_product(p1-p2,SV3->point()-p2);
+#else
+                CVector p1p2v1Surface = 0.5*CGAL::cross_product(p1-p2,SV3->point().point()-p2);
+#endif
                 if (bi1.flowCondition && ! slipBoundary) {
                         //projection on boundary 1
                         Ssolid2 = abs(p1p2v1Surface[bi1.coordinate]);
@@ -377,9 +434,15 @@ double Network<Tesselation>::surfaceSolidThroatInPore(CellHandle cell, int j, bo
                 VertexHandle& SV2 = W[1];
                 VertexHandle& SV3 = W[2];
 
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 		Ssolid1 = fastSphericalTriangleArea(SV1->point(), SV2->point(), p1, SV3->point());
                 Ssolid2 = fastSphericalTriangleArea(SV2->point(),SV1->point(),p1, SV3->point());
                 Ssolid3 = fastSphericalTriangleArea(SV3->point(),SV2->point(),p1, SV1->point());
+#else
+		Ssolid1 = fastSphericalTriangleArea(SV1->point(),SV2->point().point(),p1, SV3->point().point());
+                Ssolid2 = fastSphericalTriangleArea(SV2->point(),SV1->point().point(),p1, SV3->point().point());
+                Ssolid3 = fastSphericalTriangleArea(SV3->point(),SV2->point().point(),p1, SV1->point().point());
+#endif
     }; break;
     case (1) : {
 		VertexHandle SV1 = cell->vertex(facetVertices[j][facetF1]);
@@ -388,9 +451,15 @@ double Network<Tesselation>::surfaceSolidThroatInPore(CellHandle cell, int j, bo
 
 		Boundary &bi1 =  boundary(SV1->info().id());
                 Ssolid1 = 0;
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 		if (bi1.flowCondition && ! slipBoundary) Ssolid1 = abs(0.5*CGAL::cross_product(p1-SV2->point(), SV2->point()-SV3->point())[bi1.coordinate]);
                 Ssolid2 = fastSphericalTriangleArea(SV2->point(),SV3->point(),p1, SV2->point()+bi1.normal);
                 Ssolid3 = fastSphericalTriangleArea(SV3->point(),SV2->point(),p1, SV3->point()+bi1.normal);
+#else
+		if (bi1.flowCondition && ! slipBoundary) Ssolid1 = abs(0.5*CGAL::cross_product(p1-SV2->point().point(), SV2->point().point()-SV3->point().point())[bi1.coordinate]);
+                Ssolid2 = fastSphericalTriangleArea(SV2->point(),SV3->point().point(),p1, SV2->point().point()+bi1.normal);
+                Ssolid3 = fastSphericalTriangleArea(SV3->point(),SV2->point().point(),p1, SV3->point().point()+bi1.normal);
+#endif
     }; break;
     case (2) : {
 		double A [3], B[3], C[3];
@@ -413,7 +482,11 @@ double Network<Tesselation>::surfaceSolidThroatInPore(CellHandle cell, int j, bo
                 Sphere C1(CC, 0);
                 //FIXME : we are computing triangle area twice here, because its computed in volume_double_fictious already -> optimize
                 Ssolid1 = 0.5*(fastSphericalTriangleArea(SV3->point(), AA, p1, p2)+ fastSphericalTriangleArea(SV3->point(), BB, p1, p2));
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
                 CVector p1p2v1Surface = 0.5*CGAL::cross_product(p1-p2,SV3->point()-p2);
+#else
+                CVector p1p2v1Surface = 0.5*CGAL::cross_product(p1-p2,SV3->point().point()-p2);
+#endif
                 if (bi1.flowCondition && ! slipBoundary) Ssolid2 = 0.5*abs(p1p2v1Surface[bi1.coordinate]);
                 if (bi2.flowCondition && ! slipBoundary) Ssolid3 = 0.5*abs(p1p2v1Surface[bi2.coordinate]); 
     }; break;
@@ -442,7 +515,11 @@ CVector Network<Tesselation>::surfaceSingleFictiousFacet(VertexHandle fSV1, Vert
 //  const Boundary &bi2 = boundary ( fSV2->info().id() );
         CVector mean_height = (bi1.p[bi1.coordinate]-0.5*(SV3->point()[bi1.coordinate]+SV2->point()[bi1.coordinate]))*bi1.normal;
 
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
         return CGAL::cross_product(mean_height,SV3->point()-SV2->point());
+#else
+        return CGAL::cross_product(mean_height,SV3->point().point()-SV2->point().point());
+#endif
 }
 
 template<class Tesselation>
diff --git a/lib/triangulation/PeriodicFlow.hpp b/lib/triangulation/PeriodicFlow.hpp
index 83ce6d6..8debce6 100644
--- a/lib/triangulation/PeriodicFlow.hpp
+++ b/lib/triangulation/PeriodicFlow.hpp
@@ -61,11 +61,19 @@ void PeriodicFlow<_Tesselation>::interpolate(Tesselation& Tes, Tesselation& NewT
 		CellHandle& newCell = *cellIt;
 		if (newCell->info().Pcondition || newCell->info().isGhost) continue;
 		CVector center ( 0,0,0 );
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 		if (newCell->info().fictious()==0) for ( int k=0;k<4;k++ ) center= center + 0.25* (Tes.vertex(newCell->vertex(k)->info().id())->point()-CGAL::ORIGIN);
+#else
+		if (newCell->info().fictious()==0) for ( int k=0;k<4;k++ ) center= center + 0.25* (Tes.vertex(newCell->vertex(k)->info().id())->point().point()-CGAL::ORIGIN);
+#endif
 		else {
 			Real boundPos=0; int coord=0;
 			for ( int k=0;k<4;k++ ) {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 				if (!newCell->vertex (k)->info().isFictious) center= center+0.3333333333*(Tes.vertex(newCell->vertex(k)->info().id())->point()-CGAL::ORIGIN);
+#else
+				if (!newCell->vertex (k)->info().isFictious) center= center+0.3333333333*(Tes.vertex(newCell->vertex(k)->info().id())->point().point()-CGAL::ORIGIN);
+#endif
 				else {
 					coord=boundary (newCell->vertex(k)->info().id()).coordinate;
 					boundPos=boundary (newCell->vertex(k)->info().id()).p[coord];
@@ -73,7 +81,12 @@ void PeriodicFlow<_Tesselation>::interpolate(Tesselation& Tes, Tesselation& NewT
 			}
 			center=CVector(coord==0?boundPos:center[0],coord==1?boundPos:center[1],coord==2?boundPos:center[2]);
 		}
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
                 oldCell = Tri.locate(Point(center[0],center[1],center[2]));
+#else
+#warning "This needs Bruno's attention https://doc.cgal.org/latest/Kernel_23/classCGAL_1_1Weighted__point__3.html seems like weights are ignored"
+                oldCell = Tri.locate(CGT::Sphere(center[0],center[1],center[2]));
+#endif
 		//FIXME: should use getInfo
                 newCell->info().p() = oldCell->info().shiftedP();
         }
@@ -206,9 +219,15 @@ void PeriodicFlow<_Tesselation>::computePermeability()
 						cell->info().facetSphereCrossSections[j][jj]=0.5*W[jj]->point().weight()*Wm3::FastInvCos1((W[permut3[jj][1]]->point()-W[permut3[jj][0]]->point())*(W[permut3[jj][2]]->point()-W[permut3[jj][0]]->point()));
 #else
 					cell->info().facetSphereCrossSections[j]=CVector(
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 					W[0]->info().isFictious ? 0 : 0.5*v0.weight()*acos((v1-v0)*(v2-v0)/sqrt((v1-v0).squared_length()*(v2-v0).squared_length())),
 					W[1]->info().isFictious ? 0 : 0.5*v1.weight()*acos((v0-v1)*(v2-v1)/sqrt((v1-v0).squared_length()*(v2-v1).squared_length())),
 					W[2]->info().isFictious ? 0 : 0.5*v2.weight()*acos((v0-v2)*(v1-v2)/sqrt((v1-v2).squared_length()*(v2-v0).squared_length())));
+#else
+					W[0]->info().isFictious ? 0 : 0.5*v0.weight()*acos((v1.point()-v0.point())*(v2.point()-v0.point())/sqrt((v1.point()-v0.point()).squared_length()*(v2.point()-v0.point()).squared_length())),
+					W[1]->info().isFictious ? 0 : 0.5*v1.weight()*acos((v0.point()-v1.point())*(v2.point()-v1.point())/sqrt((v1.point()-v0.point()).squared_length()*(v2.point()-v1.point()).squared_length())),
+					W[2]->info().isFictious ? 0 : 0.5*v2.weight()*acos((v0.point()-v2.point())*(v1.point()-v2.point())/sqrt((v1.point()-v2.point()).squared_length()*(v2.point()-v0.point()).squared_length())));
+#endif
 #endif
 					//FIXME: it should be possible to skip completely blocked cells, currently the problem is it segfault for undefined areas
 					//if (cell->info().blocked) continue;//We don't need permeability for blocked cells, it will be set to zero anyway
diff --git a/lib/triangulation/PeriodicFlowLinSolv.ipp b/lib/triangulation/PeriodicFlowLinSolv.ipp
index 46d00b6..fa7ad73 100644
--- a/lib/triangulation/PeriodicFlowLinSolv.ipp
+++ b/lib/triangulation/PeriodicFlowLinSolv.ipp
@@ -8,7 +8,9 @@
 #ifdef FLOW_ENGINE
 
 
-#include "CGAL/constructions/constructions_on_weighted_points_cartesian_3.h"
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
+	#include "CGAL/constructions/constructions_on_weighted_points_cartesian_3.h"
+#endif
 #include <CGAL/Width_3.h>
 #include <iostream>
 #include <fstream>
diff --git a/lib/triangulation/RegularTriangulation.h b/lib/triangulation/RegularTriangulation.h
index 4f895dc..c655e67 100644
--- a/lib/triangulation/RegularTriangulation.h
+++ b/lib/triangulation/RegularTriangulation.h
@@ -11,7 +11,9 @@
 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
 #include <CGAL/Cartesian.h>
 #include <CGAL/Regular_triangulation_3.h>
-#include <CGAL/Regular_triangulation_euclidean_traits_3.h>
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
+	#include <CGAL/Regular_triangulation_euclidean_traits_3.h>
+#endif
 #define ALPHASHAPES
 #ifdef ALPHASHAPES
 	#include <CGAL/Alpha_shape_vertex_base_3.h>
@@ -36,7 +38,12 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
 //A bit faster, but gives crash eventualy
 // typedef CGAL::Cartesian<double> K;
 
-typedef CGAL::Regular_triangulation_euclidean_traits_3<K>   				Traits;
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
+typedef CGAL::Regular_triangulation_euclidean_traits_3<K>				Traits;
+#else
+typedef K										Traits;
+#endif
+
 typedef K::Point_3									Point;
 typedef Traits::Vector_3 								CVector;
 typedef Traits::Segment_3								Segment;
@@ -44,8 +51,13 @@ typedef Traits::Segment_3								Segment;
 /** compilation inside yade: check that Real in yade is the same as Real we will define; otherwise it might make things go wrong badly (perhaps) **/
 BOOST_STATIC_ASSERT(sizeof(Traits::RT)==sizeof(Real));
 #endif
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 typedef Traits::RT									Real; //Dans cartesian, RT = FT
 typedef Traits::Weighted_point								Sphere;
+#else
+typedef Traits::FT									Real; //Dans cartesian, RT = FT
+typedef Traits::Weighted_point_3							Sphere;
+#endif
 typedef Traits::Plane_3									Plane;
 typedef Traits::Triangle_3								Triangle;
 typedef Traits::Tetrahedron_3								Tetrahedron;
@@ -96,8 +108,15 @@ class TriangulationTypes {
 public:
 typedef vertex_info								Vertex_Info;
 typedef cell_info								Cell_Info;
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 typedef CGAL::Triangulation_vertex_base_with_info_3<Vertex_Info, Traits>	Vb_info;
 typedef CGAL::Triangulation_cell_base_with_info_3<Cell_Info, Traits>		Cb_info;
+#else
+typedef CGAL::Regular_triangulation_vertex_base_3<K>				Vb0;
+typedef CGAL::Regular_triangulation_cell_base_3<K>				Rcb;
+typedef CGAL::Triangulation_vertex_base_with_info_3<Vertex_Info, Traits, Vb0>	Vb_info;
+typedef CGAL::Triangulation_cell_base_with_info_3<Cell_Info, Traits, Rcb>	Cb_info;
+#endif
 #ifdef ALPHASHAPES
 typedef CGAL::Alpha_shape_vertex_base_3<Traits,Vb_info> Vb;
 typedef CGAL::Alpha_shape_cell_base_3<Traits,Cb_info>   Fb;
diff --git a/lib/triangulation/Tesselation.h b/lib/triangulation/Tesselation.h
index 722c055..8ebf9bb 100644
--- a/lib/triangulation/Tesselation.h
+++ b/lib/triangulation/Tesselation.h
@@ -11,6 +11,8 @@
 namespace CGT {
 	
 //Since template inheritance does not automatically give access to the members of the base class, this macro can be used to declare all members at once. 
+#ifdef ALPHASHAPES
+
 #define DECLARE_TESSELATION_TYPES(baseType)\
 		typedef typename baseType::RTriangulation		 	RTriangulation;\
 		typedef typename baseType::AlphaShape		 		AlphaShape;\
@@ -35,6 +37,33 @@ namespace CGT {
 		typedef typename baseType::ListPoint				ListPoint;\
 		typedef typename baseType::VCellIterator			VCellIterator;
 
+#else
+
+#define DECLARE_TESSELATION_TYPES(baseType)\
+		typedef typename baseType::RTriangulation		 	RTriangulation;\
+		typedef typename baseType::VertexInfo				VertexInfo;\
+		typedef typename baseType::CellInfo				CellInfo;\
+		typedef typename baseType::VertexIterator			VertexIterator;\
+		typedef typename baseType::VertexHandle				VertexHandle;\
+		typedef typename baseType::FiniteVerticesIterator		FiniteVerticesIterator;\
+		typedef typename baseType::CellIterator				CellIterator;\
+		typedef typename baseType::FiniteCellsIterator			FiniteCellsIterator;\
+		typedef typename baseType::CellCirculator			CellCirculator;\
+		typedef typename baseType::CellHandle				CellHandle;\
+		typedef typename baseType::Facet				Facet;\
+		typedef typename baseType::FacetIterator			FacetIterator;\
+		typedef typename baseType::FacetCirculator			FacetCirculator;\
+		typedef typename baseType::FiniteFacetsIterator			FiniteFacetsIterator;\
+		typedef typename baseType::LocateType				LocateType;\
+		typedef typename baseType::EdgeIterator				EdgeIterator;\
+		typedef typename baseType::FiniteEdgesIterator			FiniteEdgesIterator;\
+		typedef typename baseType::VectorVertex				VectorVertex;\
+		typedef typename baseType::VectorCell				VectorCell;\
+		typedef typename baseType::ListPoint				ListPoint;\
+		typedef typename baseType::VCellIterator			VCellIterator;
+
+#endif
+
 // Classe Tesselation, contient les fonctions permettant de calculer la Tessalisation
 // d'une RTriangulation et de stocker les centres dans chacune de ses cellules
 
@@ -44,7 +73,9 @@ class _Tesselation
 {
 public:
 	typedef typename TT::RTriangulation							RTriangulation;
+#ifdef ALPHASHAPES
 	typedef typename TT::AlphaShape						 		AlphaShape;
+#endif
 	typedef typename TT::Vertex_Info							VertexInfo;
 	typedef typename TT::Cell_Info								CellInfo;
 	typedef typename RTriangulation::Vertex_iterator		 			VertexIterator;
diff --git a/lib/triangulation/Tesselation.ipp b/lib/triangulation/Tesselation.ipp
index a73a45b..177116d 100644
--- a/lib/triangulation/Tesselation.ipp
+++ b/lib/triangulation/Tesselation.ipp
@@ -126,8 +126,13 @@ typename _Tesselation<TT>::RTriangulation & _Tesselation<TT>::Triangulation ( vo
 template<class TT>
 Real _Tesselation<TT>::Volume ( FiniteCellsIterator cell )
 {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 	return ( Tetrahedron ( cell->vertex ( 0 )->point(), cell->vertex ( 1 )->point(),
 						 cell->vertex ( 2 )->point(), cell->vertex ( 3 )->point() ) ).volume();
+#else
+	return ( Tetrahedron ( cell->vertex ( 0 )->point().point(), cell->vertex ( 1 )->point().point(),
+						 cell->vertex ( 2 )->point().point(), cell->vertex ( 3 )->point().point() ) ).volume();
+#endif
 }
 
 template<class TT>
@@ -230,13 +235,21 @@ void _Tesselation<TT>::AssignPartialVolume ( FiniteEdgesIterator& ed_it )
 		{
 			if ( !isFictious1 )
 			{
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 				r = std::abs ( ( Tetrahedron ( ed_it->first->vertex ( ed_it->second )->point(), cell0->info(), cell1->info(), cell2->info() ) ).volume() );
+#else
+				r = std::abs ( ( Tetrahedron ( ed_it->first->vertex ( ed_it->second )->point().point(), cell0->info(), cell1->info(), cell2->info() ) ).volume() );
+#endif
 				( ed_it->first )->vertex ( ed_it->second )->info().v() += r;
 				TotalFiniteVoronoiVolume+=r;
 			}
 			if ( !isFictious2 )
 			{
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 				r = std::abs ( ( Tetrahedron ( ed_it->first->vertex ( ed_it->third )->point(), cell0->info(),  cell1->info(), cell2->info() ) ).volume() );
+#else
+				r = std::abs ( ( Tetrahedron ( ed_it->first->vertex ( ed_it->third )->point().point(), cell0->info(),  cell1->info(), cell2->info() ) ).volume() );
+#endif
 				ed_it->first->vertex ( ed_it->third )->info().v() +=r;
 				TotalFiniteVoronoiVolume+=r;
 			}
diff --git a/pkg/dem/TesselationWrapper.cpp b/pkg/dem/TesselationWrapper.cpp
index 0b3700c..0e44728 100644
--- a/pkg/dem/TesselationWrapper.cpp
+++ b/pkg/dem/TesselationWrapper.cpp
@@ -29,17 +29,29 @@ struct RTraits_for_spatial_sort : public CGT::SimpleTriangulationTypes::RTriangu
 
 	struct Less_x_3 {
 		bool operator()(const Point_3& p,const Point_3& q) const {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 			return Gt::Less_x_3()(* (p.first),* (q.first));
+#else
+			return Gt::Less_x_3()( p.first->point() , q.first->point() );
+#endif
 		}
 	};
 	struct Less_y_3 {
 		bool operator()(const Point_3& p,const Point_3& q) const {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 			return Gt::Less_y_3()(* (p.first),* (q.first));
+#else
+			return Gt::Less_y_3()( p.first->point(), q.first->point());
+#endif
 		}
 	};
 	struct Less_z_3 {
 		bool operator()(const Point_3& p,const Point_3& q) const {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 			return Gt::Less_z_3()(* (p.first),* (q.first));
+#else
+			return Gt::Less_z_3()( p.first->point(), q.first->point());
+#endif
 		}
 	};
 	Less_x_3  less_x_3_object() const {return Less_x_3();}
diff --git a/pkg/pfv/FlowEngine.ipp.in b/pkg/pfv/FlowEngine.ipp.in
index 40b1e15..2fd82f8 100644
--- a/pkg/pfv/FlowEngine.ipp.in
+++ b/pkg/pfv/FlowEngine.ipp.in
@@ -179,7 +179,11 @@ void TemplateFlowEngine_@TEMPLATE_FLOW_NAME@<_CellInfo,_VertexInfo,_Tesselation,
 template< class _CellInfo, class _VertexInfo, class _Tesselation, class solverT >
 void TemplateFlowEngine_@TEMPLATE_FLOW_NAME@<_CellInfo,_VertexInfo,_Tesselation,solverT>::imposeFlux ( Vector3r pos, Real flux){
         solver->imposedF.push_back ( pair<CGT::Point,Real> ( CGT::Point ( pos[0],pos[1],pos[2] ), flux ) );
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 	CellHandle cell=solver->T[solver->currentTes].Triangulation().locate(CGT::Point(pos[0],pos[1],pos[2]));
+#else
+	CellHandle cell=solver->T[solver->currentTes].Triangulation().locate(CGT::Sphere(pos[0],pos[1],pos[2]));
+#endif
 	if (cell->info().isGhost) cerr<<"Imposing pressure in a ghost cell."<<endl;
 	for (unsigned int kk=0;kk<solver->IPCells.size();kk++){
 		if (cell==solver->IPCells[kk]) cerr<<"Both flux and pressure are imposed in the same cell."<<endl;
diff --git a/pkg/pfv/PeriodicFlowEngine.cpp b/pkg/pfv/PeriodicFlowEngine.cpp
index d61c587..d8115a9 100644
--- a/pkg/pfv/PeriodicFlowEngine.cpp
+++ b/pkg/pfv/PeriodicFlowEngine.cpp
@@ -335,12 +335,20 @@ void PeriodicFlowEngine::locateCell ( CellHandle baseCell, unsigned int& index,
 	Vector3i period;
 
 	if (baseCell->info().fictious()==0)
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 		for ( int k=0;k<4;k++ ) center+= 0.25*makeVector3r (baseCell->vertex(k)->point());
+#else
+		for ( int k=0;k<4;k++ ) center+= 0.25*makeVector3r (baseCell->vertex(k)->point().point());
+#endif
 	else {
 		
 		Real boundPos=0; int coord=0;
 		for ( int k=0;k<4;k++ ) {
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 			if ( !baseCell->vertex ( k )->info().isFictious ) center+= 0.3333333333*makeVector3r ( baseCell->vertex ( k )->point() );
+#else
+			if ( !baseCell->vertex ( k )->info().isFictious ) center+= 0.3333333333*makeVector3r ( baseCell->vertex ( k )->point().point() );
+#endif
 			else {
 				coord=flow.boundary ( baseCell->vertex ( k )->info().id() ).coordinate;
 				boundPos=flow.boundary ( baseCell->vertex ( k )->info().id() ).p[coord];}
@@ -354,9 +362,14 @@ void PeriodicFlowEngine::locateCell ( CellHandle baseCell, unsigned int& index,
 			baseInfo.isGhost=false;
 			return;
 		}
+#if CGAL_VERSION_NR < CGAL_VERSION_NUMBER(4,11,0)
 		CellHandle ch= Tri.locate ( CGT::Point ( wdCenter[0],wdCenter[1],wdCenter[2] )
 // 					     ,/*hint*/ v0
 					     );
+#else
+#warning "This needs Bruno's attention https://doc.cgal.org/latest/Kernel_23/classCGAL_1_1Weighted__point__3.html seems like weights are ignored"
+		CellHandle ch= Tri.locate ( CGT::Sphere ( wdCenter[0],wdCenter[1],wdCenter[2] ) );
+#endif
 		baseInfo.period[0]=period[0];
 		baseInfo.period[1]=period[1];
 		baseInfo.period[2]=period[2];

Follow ups

References