Skip to content
Snippets Groups Projects
Commit 781a4221 authored by EXT noe bernabeu's avatar EXT noe bernabeu
Browse files

Merge branch 'dvt' into 'master'

Dvt

See merge request !1
parents 66e87d55 1ed8de6c
No related branches found
No related tags found
1 merge request!1Dvt
...@@ -95,7 +95,7 @@ and the full surface included and available in the selected DEM. ...@@ -95,7 +95,7 @@ and the full surface included and available in the selected DEM.
\begin{figure}[h!] \begin{figure}[h!]
\center \includegraphics[height=8cm]{osm_domain.png} \center \includegraphics[height=8cm]{osm_domain.png}
\caption{OpenStreetMap with the vent location %\includegraphics[height=5mm]{icon_eruption.png} \caption{OpenStreetMap with the vent location %\includegraphics[height=5mm]{icon_eruption_doc.png}
the simulation domain (blue rectangle) and the DEM boundaries (black rectangle)} the simulation domain (blue rectangle) and the DEM boundaries (black rectangle)}
\end{figure} \end{figure}
......
import os
def view_in_vtk():
nb_vtk = os.popen("ls lava-*.vtk -Al | wc -l").read()
pwd = os.popen("pwd").read().rstrip()
list_vtk=[]
for i in range(int(nb_vtk)):
list_vtk.append("\""+pwd+"/lava-"+str(i)+".vtk\"")
my_file = open("tmp/macro_for_vtk.py", "w") #erase
#### import the simple module from the paraview
my_file.write("from paraview.simple import *\n")
#### disable automatic camera reset on 'Show'
my_file.write("paraview.simple._DisableFirstRenderCameraReset()\n")
# create a new 'Legacy VTK Reader'
my_file.write("fh_smoothvtk = LegacyVTKReader(FileNames=[\'"+pwd+"/fh_smooth.vtk\'])\n")
# get active view
my_file.write("renderView1 = GetActiveViewOrCreate(\'RenderView\')\n")
# uncomment following to set a specific view size
# renderView1.ViewSize = [1004, 339]
# get color transfer function/color map for 'scalar'
my_file.write("scalarLUT = GetColorTransferFunction(\'scalar\')\n")
my_file.write("scalarLUT.RGBPoints = [4.1529541015625, 0.231373, 0.298039, 0.752941, 12.829968452453613, 0.865003, 0.865003, 0.865003, 21.506982803344727, 0.705882, 0.0156863, 0.14902]\n")
my_file.write("scalarLUT.ScalarRangeInitialized = 1.0\n")
# show data in view
my_file.write("fh_smoothvtkDisplay = Show(fh_smoothvtk, renderView1)\n")
# trace defaults for the display properties.
my_file.write("fh_smoothvtkDisplay.ColorArrayName = [\'POINTS\', \'scalar\']\n")
my_file.write("fh_smoothvtkDisplay.LookupTable = scalarLUT\n")
my_file.write("fh_smoothvtkDisplay.OSPRayScaleArray = \'scalar\'\n")
my_file.write("fh_smoothvtkDisplay.OSPRayScaleFunction = \'PiecewiseFunction\'\n")
my_file.write("fh_smoothvtkDisplay.GlyphType = \'Arrow\'\n")
my_file.write("fh_smoothvtkDisplay.ScalarOpacityUnitDistance = 1.325402279736169\n")
# reset view to fit data
my_file.write("renderView1.ResetCamera()\n")
#changing interaction mode based on data extents
my_file.write("renderView1.InteractionMode = \'2D\'\n")
my_file.write("renderView1.CameraPosition = [24.98700090032071, 14.987099537625909, 10000.0]\n")
my_file.write("renderView1.CameraFocalPoint = [24.98700090032071, 14.987099537625909, 0.0]\n")
# show color bar/color legend
my_file.write("fh_smoothvtkDisplay.SetScalarBarVisibility(renderView1, True)\n")
# get opacity transfer function/opacity map for 'scalar'
my_file.write("scalarPWF = GetOpacityTransferFunction(\'scalar\')\n")
my_file.write("scalarPWF.Points = [4.1529541015625, 0.0, 0.5, 0.0, 21.506982803344727, 1.0, 0.5, 0.0]\n")
my_file.write("scalarPWF.ScalarRangeInitialized = 1\n")
# create a new 'Warp By Scalar'
my_file.write("warpByScalar1 = WarpByScalar(Input=fh_smoothvtk)\n")
my_file.write("warpByScalar1.Scalars = [\'POINTS\', \'scalar\']\n")
# Properties modified on warpByScalar1
my_file.write("warpByScalar1.ScaleFactor = 2.0\n")
# show data in view
my_file.write("warpByScalar1Display = Show(warpByScalar1, renderView1)\n")
# trace defaults for the display properties.
my_file.write("warpByScalar1Display.ColorArrayName = [\'POINTS\', \'scalar\']\n")
my_file.write("warpByScalar1Display.LookupTable = scalarLUT\n")
my_file.write("warpByScalar1Display.OSPRayScaleArray = \'scalar\'\n")
my_file.write("warpByScalar1Display.OSPRayScaleFunction = \'PiecewiseFunction\'\n")
my_file.write("warpByScalar1Display.GlyphType = \'Arrow\'\n")
my_file.write("warpByScalar1Display.ScalarOpacityUnitDistance = 1.5429092701580482\n")
# hide data in view
my_file.write("Hide(fh_smoothvtk, renderView1)\n")
# show color bar/color legend
my_file.write("warpByScalar1Display.SetScalarBarVisibility(renderView1, True)\n")
# hide color bar/color legend
my_file.write("warpByScalar1Display.SetScalarBarVisibility(renderView1, False)\n")
# create a new 'Legacy VTK Reader'
my_file.write("lava = LegacyVTKReader(FileNames=["+",".join(list_vtk)+"])\n")
# get animation scene
my_file.write("animationScene1 = GetAnimationScene()\n")
# update animation scene based on data timesteps
my_file.write("animationScene1.UpdateAnimationUsingDataTimeSteps()\n")
# get color transfer function/color map for 'time'
my_file.write("timeLUT = GetColorTransferFunction(\'time\')\n")
my_file.write("timeLUT.RGBPoints = [1.1824109554290771, 0.231373, 0.298039, 0.752941, 1.1824168675429747, 0.865003, 0.865003, 0.865003, 1.1824227796568725, 0.705882, 0.0156863, 0.14902]\n")
my_file.write("timeLUT.ScalarRangeInitialized = 1.0\n")
# show data in view
my_file.write("lavaDisplay = Show(lava, renderView1)\n")
# trace defaults for the display properties.
my_file.write("lavaDisplay.ColorArrayName = [\'POINTS\', \'time\']\n")
my_file.write("lavaDisplay.LookupTable = timeLUT\n")
my_file.write("lavaDisplay.OSPRayScaleArray = \'time\'\n")
my_file.write("lavaDisplay.OSPRayScaleFunction = \'PiecewiseFunction\'\n")
my_file.write("lavaDisplay.GlyphType = \'Arrow\'\n")
my_file.write("lavaDisplay.ScalarOpacityUnitDistance = 5.36683156288307\n")
# show color bar/color legend
my_file.write("lavaDisplay.SetScalarBarVisibility(renderView1, True)\n")
# get opacity transfer function/opacity map for 'time'
my_file.write("timePWF = GetOpacityTransferFunction(\'time\')\n")
my_file.write("timePWF.Points = [1.1824109554290771, 0.0, 0.5, 0.0, 1.1824227796568725, 1.0, 0.5, 0.0]\n")
my_file.write("timePWF.ScalarRangeInitialized = 1\n")
# create a new 'Warp By Scalar'
my_file.write("warpByScalar2 = WarpByScalar(Input=lava)\n")
my_file.write("warpByScalar2.Scalars = [\'POINTS\', \'time\']\n")
# Properties modified on warpByScalar2
my_file.write("warpByScalar2.Scalars = [\'POINTS\', \'f+h\']\n")
my_file.write("warpByScalar2.ScaleFactor = 2.01\n")
# show data in view
my_file.write("warpByScalar2Display = Show(warpByScalar2, renderView1)\n")
# trace defaults for the display properties.
my_file.write("warpByScalar2Display.ColorArrayName = [\'POINTS\', \'time\']\n")
my_file.write("warpByScalar2Display.LookupTable = timeLUT\n")
my_file.write("warpByScalar2Display.OSPRayScaleArray = \'time\'\n")
my_file.write("warpByScalar2Display.OSPRayScaleFunction = \'PiecewiseFunction\'\n")
my_file.write("warpByScalar2Display.GlyphType = \'Arrow\'\n")
my_file.write("warpByScalar2Display.ScalarOpacityUnitDistance = 6.245192027420857\n")
# hide data in view
my_file.write("Hide(lava, renderView1)\n")
# show color bar/color legend
my_file.write("warpByScalar2Display.SetScalarBarVisibility(renderView1, True)\n")
# set scalar coloring
my_file.write("ColorBy(warpByScalar2Display, (\'POINTS\', \'h\'))\n")
# rescale color and/or opacity maps used to include current data range
my_file.write("warpByScalar2Display.RescaleTransferFunctionToDataRange(True)\n")
# show color bar/color legend
my_file.write("warpByScalar2Display.SetScalarBarVisibility(renderView1, True)\n")
# get color transfer function/color map for 'h'
my_file.write("hLUT = GetColorTransferFunction(\'h\')\n")
my_file.write("hLUT.RGBPoints = [0.0, 0.231373, 0.298039, 0.752941, 1.5772740880493075e-05, 0.865003, 0.865003, 0.865003, 3.154548176098615e-05, 0.705882, 0.0156863, 0.14902]\n")
my_file.write("hLUT.ScalarRangeInitialized = 1.0\n")
# get opacity transfer function/opacity map for 'h'
my_file.write("hPWF = GetOpacityTransferFunction(\'h\')\n")
my_file.write("hPWF.Points = [0.0, 0.0, 0.5, 0.0, 3.154548176098615e-05, 1.0, 0.5, 0.0]\n")
my_file.write("hPWF.ScalarRangeInitialized = 1\n")
# Properties modified on hLUT
my_file.write("hLUT.EnableOpacityMapping = 1\n")
# Properties modified on hPWF
my_file.write("hPWF.Points = [0.0, 0.0, 0.5, 0.0, 1.3261157619126607e-05, 0.4013157784938812, 0.5, 0.0, 3.154548176098615e-05, 1.0, 0.5, 0.0]\n")
# Properties modified on hPWF
my_file.write("hPWF.Points = [0.0, 0.0, 0.5, 0.0, 1.225652431458002e-05, 0.46052631735801697, 0.5, 0.0, 3.154548176098615e-05, 1.0, 0.5, 0.0]\n")
# Properties modified on hPWF
my_file.write("hPWF.Points = [0.0, 0.0, 0.5, 0.0, 1.0950501746265218e-05, 0.5263158082962036, 0.5, 0.0, 3.154548176098615e-05, 1.0, 0.5, 0.0]\n")
# Properties modified on hPWF
my_file.write("hPWF.Points = [0.0, 0.0, 0.5, 0.0, 9.343088095192797e-06, 0.6052631735801697, 0.5, 0.0, 3.154548176098615e-05, 1.0, 0.5, 0.0]\n")
# Properties modified on hPWF
my_file.write("hPWF.Points = [0.0, 0.0, 0.5, 0.0, 6.228725851542549e-06, 0.7434210777282715, 0.5, 0.0, 3.154548176098615e-05, 1.0, 0.5, 0.0]\n")
# Properties modified on hPWF
my_file.write("hPWF.Points = [0.0, 0.0, 0.5, 0.0, 5.023166067985585e-06, 0.7894737124443054, 0.5, 0.0, 3.154548176098615e-05, 1.0, 0.5, 0.0]\n")
# Properties modified on hPWF
my_file.write("hPWF.Points = [0.0, 0.0, 0.5, 0.0, 1.9088031422143104e-06, 0.9210526347160339, 0.5, 0.0, 3.154548176098615e-05, 1.0, 0.5, 0.0]\n")
# Properties modified on hPWF
my_file.write("hPWF.Points = [0.0, 0.0, 0.5, 0.0, 0.0, 1.0, 0.5, 0.0, 3.154548176098615e-05, 1.0, 0.5, 0.0]\n")
# Apply a preset using its name. Note this may not work as expected when presets have duplicate names.
my_file.write("hLUT.ApplyPreset(\'Black-Body Radiation\', True)\n")
# Apply a preset using its name. Note this may not work as expected when presets have duplicate names.
my_file.write("hLUT.ApplyPreset(\'Black-Body Radiation\', True)\n")
# Rescale transfer function
my_file.write("hLUT.RescaleTransferFunction(0.0, 34.1110343933)\n")
# Rescale transfer function
my_file.write("hPWF.RescaleTransferFunction(0.0, 34.1110343933)\n")
my_file.write("animationScene1.GoToLast()\n")
# set active source
my_file.write("SetActiveSource(lava)\n")
# show color bar/color legend
my_file.write("lavaDisplay.SetScalarBarVisibility(renderView1, True)\n")
my_file.write("animationScene1.GoToLast()\n")
# set active source
my_file.write("SetActiveSource(warpByScalar2)\n")
# Properties modified on animationScene1
my_file.write("animationScene1.PlayMode = \'Real Time\'\n")
# create a new 'Legacy VTK Reader'
my_file.write("id_shape0vtk = LegacyVTKReader(FileNames=[\'"+pwd+"/id_shape-0.vtk\'])\n")
# update animation scene based on data timesteps
my_file.write("animationScene1.UpdateAnimationUsingDataTimeSteps()\n")
# get color transfer function/color map for 'shape'
my_file.write("shapeLUT = GetColorTransferFunction(\'shape\')\n")
my_file.write("shapeLUT.ScalarRangeInitialized = 1.0\n")
# show data in view
my_file.write("id_shape0vtkDisplay = Show(id_shape0vtk, renderView1)\n")
# trace defaults for the display properties.
my_file.write("id_shape0vtkDisplay.ColorArrayName = [\'POINTS\', \'shape\']\n")
my_file.write("id_shape0vtkDisplay.LookupTable = shapeLUT\n")
my_file.write("id_shape0vtkDisplay.OSPRayScaleArray = \'shape\'\n")
my_file.write("id_shape0vtkDisplay.OSPRayScaleFunction = \'PiecewiseFunction\'\n")
my_file.write("id_shape0vtkDisplay.GlyphType = \'Arrow\'\n")
my_file.write("id_shape0vtkDisplay.ScalarOpacityUnitDistance = 1.325402279736169\n")
# show color bar/color legend
my_file.write("id_shape0vtkDisplay.SetScalarBarVisibility(renderView1, True)\n")
# get opacity transfer function/opacity map for 'shape'
my_file.write("shapePWF = GetOpacityTransferFunction(\'shape\')\n")
my_file.write("shapePWF.ScalarRangeInitialized = 1\n")
# create a new 'Warp By Scalar'
my_file.write("warpByScalar3 = WarpByScalar(Input=id_shape0vtk)\n")
my_file.write("warpByScalar3.Scalars = [\'POINTS\', \'shape\']\n")
# Properties modified on warpByScalar3
my_file.write("warpByScalar3.Scalars = [\'POINTS\', \'f\']\n")
my_file.write("warpByScalar3.ScaleFactor = 2.01\n")
# show data in view
my_file.write("warpByScalar3Display = Show(warpByScalar3, renderView1)\n")
# trace defaults for the display properties.
my_file.write("warpByScalar3Display.ColorArrayName = [\'POINTS\', \'shape\']\n")
my_file.write("warpByScalar3Display.LookupTable = shapeLUT\n")
my_file.write("warpByScalar3Display.OSPRayScaleArray = \'shape\'\n")
my_file.write("warpByScalar3Display.OSPRayScaleFunction = \'PiecewiseFunction\'\n")
my_file.write("warpByScalar3Display.GlyphType = \'Arrow\'\n")
my_file.write("warpByScalar3Display.ScalarOpacityUnitDistance = 1.5449347398369073\n")
# hide data in view
my_file.write("Hide(id_shape0vtk, renderView1)\n")
# show color bar/color legend
my_file.write("warpByScalar3Display.SetScalarBarVisibility(renderView1, True)\n")
# create a new 'Contour'
my_file.write("contour1 = Contour(Input=warpByScalar3)\n")
my_file.write("contour1.ContourBy = [\'POINTS\', \'shape\']\n")
my_file.write("contour1.Isosurfaces = [0.5]\n")
my_file.write("contour1.PointMergeMethod = \'Uniform Binning\'\n")
# show data in view
my_file.write("contour1Display = Show(contour1, renderView1)\n")
# trace defaults for the display properties.
my_file.write("contour1Display.ColorArrayName = [None, \'\']\n")
my_file.write("contour1Display.OSPRayScaleArray = \'f\'\n")
my_file.write("contour1Display.OSPRayScaleFunction = \'PiecewiseFunction\'\n")
my_file.write("contour1Display.GlyphType = \'Arrow\'\n")
# hide data in view
my_file.write("Hide(warpByScalar3, renderView1)\n")
#### saving camera placements for all active views
# current camera placement for renderView1
my_file.write("renderView1.InteractionMode = \'2D\'\n")
my_file.write("renderView1.CameraPosition = [24.98700090032071, 14.987099537625909, 10000.0]\n")
my_file.write("renderView1.CameraFocalPoint = [24.98700090032071, 14.987099537625909, 0.0]\n")
my_file.write("renderView1.CameraParallelScale = 29.120461554028807\n")
#### uncomment the following to render all views
# RenderAllViews()
# alternatively, if you want to write images, you can use SaveScreenshot(...).
my_file.close()
os.system("paraview --script=tmp/macro_for_vtk.py &")
\ No newline at end of file
...@@ -67,6 +67,10 @@ struct id_hp: unary_function<Float,Float> { ...@@ -67,6 +67,10 @@ struct id_hp: unary_function<Float,Float> {
field criteria ( field h0, field h1, field h2, field w) { return h0 + h1 + h2 + w; } field criteria ( field h0, field h1, field h2, field w) { return h0 + h1 + h2 + w; }
struct max_one: unary_function<Float,Float> {
Float operator() (const Float& id) const {
return min(id,1.);}
};
/*struct pnpoly { /*struct pnpoly {
Float operator() (const point& X) const { Float operator() (const point& X) const {
size_t i, j, c = 0; size_t i, j, c = 0;
...@@ -120,7 +124,7 @@ void update_flow_rate(field& ws, vector<Float>& Q, Float& total_flow_rate, const ...@@ -120,7 +124,7 @@ void update_flow_rate(field& ws, vector<Float>& Q, Float& total_flow_rate, const
} }
} }
void build_forest(field& id_forest, field& Bi_star_h, field& Dam1_h, const size_t& nb_regions, const vector<size_t>& nb_vertex, const vector<vector<point>>& vertex, const Float& Bi_star, const Float& r_darcy, const string& presence_of_trees){ void build_forest(field& id_forest, field& Bi_star_h, field& Dam1_h, const size_t& nb_regions, const vector<size_t>& nb_vertex, const vector<vector<point>>& vertex, const Float& Bi_star, const Float& r_darcy, const string& presence_of_trees, const vector<point>& xe, const Float& west, const Float& south, const Float& L){
if (presence_of_trees == "region"){ if (presence_of_trees == "region"){
space Xh = id_forest.get_space(); space Xh = id_forest.get_space();
id_forest = field(Xh, 0.); id_forest = field(Xh, 0.);
...@@ -128,10 +132,11 @@ void build_forest(field& id_forest, field& Bi_star_h, field& Dam1_h, const size_ ...@@ -128,10 +132,11 @@ void build_forest(field& id_forest, field& Bi_star_h, field& Dam1_h, const size_
size_t nb_vertex_i = nb_vertex[i]; size_t nb_vertex_i = nb_vertex[i];
vector<point> vertex_i(nb_vertex_i+1); vector<point> vertex_i(nb_vertex_i+1);
for (size_t j=1; j <= nb_vertex_i; j++){ for (size_t j=1; j <= nb_vertex_i; j++){
vertex_i[j]=vertex[i][j]; vertex_i[j]=space_adim(point(vertex[i][j]),point(xe[1]),west,south,L);
} }
id_forest += interpolate(Xh,pnpoly(nb_vertex_i,vertex_i)); id_forest += interpolate(Xh,pnpoly(nb_vertex_i,vertex_i));
} }
id_forest = interpolate(Xh,compose(max_one(),id_forest));
Bi_star_h = Bi_star*id_forest; Bi_star_h = Bi_star*id_forest;
Dam1_h = sqr(r_darcy)*id_forest; Dam1_h = sqr(r_darcy)*id_forest;
} }
...@@ -245,7 +250,7 @@ int main (int argc, char **argv) { ...@@ -245,7 +250,7 @@ int main (int argc, char **argv) {
field Bi_star_h (Xh, 0.); field Bi_star_h (Xh, 0.);
//------------------ Forest --------------------- //------------------ Forest ---------------------
if (presence_of_trees == "region"){ if (presence_of_trees == "region"){
build_forest(id_forest, Bi_star_h, Dam1_h, nb_regions, nb_vertex, vertex, Bi_star, r_darcy, presence_of_trees); build_forest(id_forest, Bi_star_h, Dam1_h, nb_regions, nb_vertex, vertex, Bi_star, r_darcy, presence_of_trees, xe, west, south, L);
odiststream id_forest_h ( "id_forest.branch" ); odiststream id_forest_h ( "id_forest.branch" );
branch vtk_forest ("t","trees","f"); branch vtk_forest ("t","trees","f");
id_forest_h << vtk_forest (0., id_forest, fh); id_forest_h << vtk_forest (0., id_forest, fh);
...@@ -286,7 +291,8 @@ int main (int argc, char **argv) { ...@@ -286,7 +291,8 @@ int main (int argc, char **argv) {
Float norm_L2_error_phi_h = 1.; Float norm_L2_error_phi_h = 1.;
Dam1_h = field (Xh, sqr(r_darcy)); Dam1_h = field (Xh, sqr(r_darcy));
Bi_star_h = field (Xh, Bi_star); Bi_star_h = field (Xh, Bi_star);
build_forest(id_forest, Bi_star_h, Dam1_h, nb_regions, nb_vertex, vertex, Bi_star, r_darcy, presence_of_trees); id_forest = field (Xh, 0.);
build_forest(id_forest, Bi_star_h, Dam1_h, nb_regions, nb_vertex, vertex, Bi_star, r_darcy, presence_of_trees, xe, west, south, L);
field time_h (Xh,timer); field time_h (Xh,timer);
derr << "# kmax = " << k_max << endl derr << "# kmax = " << k_max << endl
<< "# k ad time(s) |dh_dt|L2 " << endl; << "# k ad time(s) |dh_dt|L2 " << endl;
...@@ -349,7 +355,8 @@ int main (int argc, char **argv) { ...@@ -349,7 +355,8 @@ int main (int argc, char **argv) {
error_phi_h = interpolate(Xh,error_phi_h); error_phi_h = interpolate(Xh,error_phi_h);
Dam1_h = field(Xh, sqr(r_darcy)); Dam1_h = field(Xh, sqr(r_darcy));
Bi_star_h = field(Xh, Bi_star); Bi_star_h = field(Xh, Bi_star);
build_forest(id_forest, Bi_star_h, Dam1_h, nb_regions, nb_vertex, vertex, Bi_star, r_darcy, presence_of_trees); id_forest = field (Xh, 0.);
build_forest(id_forest, Bi_star_h, Dam1_h, nb_regions, nb_vertex, vertex, Bi_star, r_darcy, presence_of_trees, xe, west, south, L);
} }
} }
dh_dt = (phi/coeff1) - coeff2*h - coeff3*h_old; dh_dt = (phi/coeff1) - coeff2*h - coeff3*h_old;
......
...@@ -339,7 +339,7 @@ class SideMenu(object): ...@@ -339,7 +339,7 @@ class SideMenu(object):
sideWindow.overrideredirect(0) sideWindow.overrideredirect(0)
sideWindow.resizable(False, False) sideWindow.resizable(False, False)
#sideWindow.geometry("%dx%d+0+0" % (w, h)) #sideWindow.geometry("%dx%d+0+0" % (w, h))
image = PIL.Image.open("utm-zones.png") image = PIL.Image.open(PKGDATADIR+"/utm-zones.png")
image_size = image.size image_size = image.size
image = image.resize((w,int(0.5*w)),PIL.Image.ANTIALIAS) image = image.resize((w,int(0.5*w)),PIL.Image.ANTIALIAS)
photo = PIL.ImageTk.PhotoImage(image) photo = PIL.ImageTk.PhotoImage(image)
......
...@@ -43,7 +43,7 @@ derr << "nb_regions = " << nb_regions << endl; ...@@ -43,7 +43,7 @@ derr << "nb_regions = " << nb_regions << endl;
for (size_t i=1; i<=nb_regions; i++){ for (size_t i=1; i<=nb_regions; i++){
derr << "nb_vertex_"+itos(i)+" = " << nb_vertex[i] << endl; derr << "nb_vertex_"+itos(i)+" = " << nb_vertex[i] << endl;
for (size_t j=1; j<=nb_vertex[i]; j++){ for (size_t j=1; j<=nb_vertex[i]; j++){
derr << "vertex_"+itos(i)+itos(j)+" = (" << point(vertex[i][j])[0] << "," << point(vertex[i][j])[1] << ")" << endl; derr << "vertex_"+itos(i)+"_"+itos(j)+" = (" << point(vertex[i][j])[0] << "," << point(vertex[i][j])[1] << ")" << endl;
} }
} }
derr << "final_shape = " << final_shape << endl; derr << "final_shape = " << final_shape << endl;
...@@ -54,8 +54,8 @@ if (presence_of_trees !="no") { ...@@ -54,8 +54,8 @@ if (presence_of_trees !="no") {
for (size_t j=1; j<=nb_vertex[i]; j++){ for (size_t j=1; j<=nb_vertex[i]; j++){
Float vertex_x; Float vertex_x;
Float vertex_y; Float vertex_y;
din >> catchmark("vertex_x_"+itos(i)+itos(j)) >> vertex_x; din >> catchmark("vertex_x_"+itos(i)+"_"+itos(j)) >> vertex_x;
din >> catchmark("vertex_y_"+itos(i)+itos(j)) >> vertex_y; din >> catchmark("vertex_y_"+itos(i)+"_"+itos(j)) >> vertex_y;
vertex[i][j] = point(vertex_x,vertex_y); vertex[i][j] = point(vertex_x,vertex_y);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment