@@ -152,7 +152,7 @@ Plot the result on the path
152152Create the plotter and add fields and meshes. For more information about
153153plotting data on a mesh check the tutorial: :ref: `ref_plotting_data_on_the_mesh `
154154
155- First, define the |DpfPlotter | object [2 ]_ and then add |MeshedRegion |
155+ First, define the |DpfPlotter | object [2 ]_, then add |MeshedRegion |
156156to it using the |add_mesh | method and add the field using the |add_field | method.
157157
158158To display the figure built by the plotter object use the |show_figure | method.
@@ -375,18 +375,18 @@ elements with shape functions.
375375
376376 # Map the points coordinates with the displacement results and get the field
377377 mapped_disp_points = ops.mapping.on_coordinates(fields_container = my_disp,
378- coordinates = dpf.fields_factory.field_from_array(arr = my_points.coordinates.data),
379- create_support = True ,
380- mesh = my_meshed_region
381- ).eval()[0 ]
378+ coordinates = dpf.fields_factory.field_from_array(arr = my_points.coordinates.data),
379+ create_support = True ,
380+ mesh = my_meshed_region
381+ ).eval()[0 ]
382382
383383 Plot displacement field on the points
384384~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
385385
386386Create the plotter and add fields and meshes. For more information about
387387plotting data on a mesh check the tutorial: :ref: `ref_plotting_data_on_the_mesh `
388388
389- First, define the |DpfPlotter | object [2 ]_ and then add |MeshedRegion |
389+ First, define the |DpfPlotter | object [2 ]_, then add |MeshedRegion |
390390to it using the |add_mesh | method and add the field using the |add_field | method.
391391
392392To display the figure built by the plotter object use the |show_figure | method.
@@ -409,10 +409,10 @@ To display the figure built by the plotter object use the |show_figure| method.
409409 :hide-code:
410410
411411 mapped_disp_points = ops.mapping.on_coordinates(fields_container=my_disp,
412- coordinates=dpf.fields_factory.field_from_array(arr=my_points.coordinates.data),
413- create_support=True,
414- mesh=my_meshed_region
415- ).eval()[0]
412+ coordinates=dpf.fields_factory.field_from_array(arr=my_points.coordinates.data),
413+ create_support=True,
414+ mesh=my_meshed_region
415+ ).eval()[0]
416416 my_plotter = dpf.plotter.DpfPlotter()
417417 my_plotter.add_mesh(meshed_region=my_meshed_region,style="surface", show_edges=True, color="w", opacity=0.3)
418418 my_plotter.add_field(field=mapped_disp_points,point_size=20.0, render_points_as_spheres=True)
@@ -433,7 +433,7 @@ Check the `Create points`_ section to understand how we defined the points coord
433433.. code-block :: python
434434
435435 # Create the Line object
436- my_line = geo.Line(coordinates = [[0.0 , 0.06 , 0.0 ], [0.03 , 0.03 , 0.03 ]]
436+ my_line = geo.Line(coordinates = [[0.0 , 0.06 , 0.0 ], [0.03 , 0.03 , 0.03 ]],
437437 n_points = 50
438438 )
439439
@@ -452,7 +452,7 @@ You can plot the |Line| together with the mesh:
452452 .. jupyter-execute ::
453453 :hide-code:
454454
455- my_line = geo.Line(coordinates=[[0.0, 0.06, 0.0], [0.03, 0.03, 0.03]]
455+ my_line = geo.Line(coordinates=[[0.0, 0.06, 0.0], [0.03, 0.03, 0.03]],
456456 n_points=50
457457 )
458458 my_line.plot(mesh=my_meshed_region, cpos=camera_position)
@@ -471,18 +471,19 @@ elements with shape functions.
471471
472472 # Map the line coordinates with the displacement results and get the field
473473 mapped_disp_line = ops.mapping.on_coordinates(fields_container = my_disp,
474- coordinates = my_line.mesh.nodes.coordinates_field,
475- create_support = True ,
476- mesh = my_meshed_region
477- ).eval()[0 ]
474+ coordinates = my_line.mesh.nodes.coordinates_field,
475+ create_support = True ,
476+ mesh = my_meshed_region
477+ ).eval()[0 ]
478478
479479 Plot displacement field on the line
480480~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
481481
482+ Plot displacement field on the |Line | and display mesh in background.
482483Create the plotter and add fields and meshes. For more information about
483484plotting data on a mesh check the tutorial: :ref: `ref_plotting_data_on_the_mesh `
484485
485- First, define the |DpfPlotter | object [2 ]_ and then add |MeshedRegion |
486+ First, define the |DpfPlotter | object [2 ]_, then add |MeshedRegion |
486487to it using the |add_mesh | method and add the field using the |add_field | method.
487488
488489To display the figure built by the plotter object use the |show_figure | method.
@@ -505,13 +506,13 @@ To display the figure built by the plotter object use the |show_figure| method.
505506 :hide-code:
506507
507508 mapped_disp_line = ops.mapping.on_coordinates(fields_container=my_disp,
508- coordinates=my_line.mesh.nodes.coordinates_field) ,
509- create_support=True,
510- mesh=my_meshed_region
511- ).eval()[0]
509+ coordinates=my_line.mesh.nodes.coordinates_field,
510+ create_support=True,
511+ mesh=my_meshed_region
512+ ).eval()[0]
512513 my_plotter = dpf.plotter.DpfPlotter()
513514 my_plotter.add_mesh(meshed_region=my_meshed_region,style="surface", show_edges=True, color="w", opacity=0.3)
514- my_plotter.add_field(field=mapped_disp_line)
515+ my_plotter.add_field(field=mapped_disp_line,meshed_region=my_line.mesh )
515516 my_plotter.show_figure(show_axes=True, cpos=camera_position)
516517
517518Plane
@@ -576,18 +577,19 @@ elements with shape functions.
576577
577578 # Map the line coordinates with the displacement results and get the field
578579 mapped_disp_plane = ops.mapping.on_coordinates(fields_container = my_disp,
579- coordinates = my_plane.mesh.nodes.coordinates_field,
580- create_support = True ,
581- mesh = my_meshed_region
582- ).eval()[0 ]
580+ coordinates = my_plane.mesh.nodes.coordinates_field,
581+ create_support = True ,
582+ mesh = my_meshed_region
583+ ).eval()[0 ]
583584
584585 Plot displacement field on the plane
585586~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
586587
588+ Plot displacement field on the |Plane | and display mesh in background.
587589Create the plotter and add fields and meshes. For more information about
588590plotting data on a mesh check the tutorial: :ref: `ref_plotting_data_on_the_mesh `
589591
590- First, define the |DpfPlotter | object [2 ]_ and then add |MeshedRegion |
592+ First, define the |DpfPlotter | object [2 ]_, then add |MeshedRegion |
591593to it using the |add_mesh | method and add the field using the |add_field | method.
592594
593595To display the figure built by the plotter object use the |show_figure | method.
@@ -600,7 +602,7 @@ To display the figure built by the plotter object use the |show_figure| method.
600602 # We use custom style for the mesh so we can visualise the points
601603 my_plotter.add_mesh(meshed_region = my_meshed_region,style = " surface" , show_edges = True , color = " w" , opacity = 0.3 )
602604 # Add the Field to the DpfPlotter object
603- my_plotter.add_field(field = mapped_disp_plane)
605+ my_plotter.add_field(field = mapped_disp_plane, meshed_region = my_plane.mesh, show_edges = False )
604606 # Display the plot
605607 my_plotter.show_figure(show_axes = True , cpos = camera_position)
606608
@@ -610,13 +612,13 @@ To display the figure built by the plotter object use the |show_figure| method.
610612 :hide-code:
611613
612614 mapped_disp_plane = ops.mapping.on_coordinates(fields_container=my_disp,
613- coordinates=my_plane.mesh.nodes.coordinates_field,
614- create_support=True,
615- mesh=my_meshed_region
616- ).eval()[0]
615+ coordinates=my_plane.mesh.nodes.coordinates_field,
616+ create_support=True,
617+ mesh=my_meshed_region
618+ ).eval()[0]
617619 my_plotter = dpf.plotter.DpfPlotter()
618620 my_plotter.add_mesh(meshed_region=my_meshed_region,style="surface", show_edges=True, color="w", opacity=0.3)
619- my_plotter.add_field(field=mapped_disp_plane)
621+ my_plotter.add_field(field=mapped_disp_plane, meshed_region=my_plane.mesh, show_edges=False )
620622 my_plotter.show_figure(show_axes=True, cpos=camera_position)
621623
622624.. rubric :: Footnotes
0 commit comments