mesh

125 views
Skip to first unread message

王艺康

unread,
Oct 28, 2024, 10:53:07 PM10/28/24
to deal.II User Group
Hello everyone!
I set up a coarse mesh and then use step-54, to refine the coarse mesh for projection onto a complex stl model, I'd like to enquire about the feasibility of doing this!

Wang心脏stl.jpg

Wolfgang Bangerth

unread,
Oct 28, 2024, 10:56:15 PM10/28/24
to dea...@googlegroups.com
On 10/28/24 20:53, 王艺康 wrote:
>
> I set up a coarse mesh and then use step-54, to refine the coarse mesh for
> projection onto a complex stl model, I'd like to enquire about the feasibility
> of doing this!

You say that you set up the mesh and use step-54. What happens when you run
the code? In other words, I'm not quite sure what your concrete question is :-)

Best
Wolfgang

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


王艺康

unread,
Nov 1, 2024, 11:18:40 PM11/1/24
to deal.II User Group
I apologize for not making my problem clear.
I have an stl file describing a complex model, I extracted some points of this complex model and drew a coarse mesh with gmsh, then ran step-54, but the mesh refinement does not follow the surface of the stl file. The refinement is only inside the coarse mesh.

Wolfgang Bangerth

unread,
Nov 2, 2024, 5:42:02 PM11/2/24
to dea...@googlegroups.com
On 11/1/24 21:18, 王艺康 wrote:
>
> I have an stl file describing a complex model, I extracted some points of this
> complex model and drew a coarse mesh with gmsh, then ran step-54, but the mesh
> refinement does not follow the surface of the stl file. The refinement is only
> inside the coarse mesh.

Yes, if you only read the gmsh output, you have lost information about the
underlying geometry (which was originally provided by the STL file). You need
to use a manifold to the triangulation that uses the STL file as the
underlying geometry. Most of what the TriangulationOnCAD::read_domain()
function of step-54 does is setting up a manifold with the help of
OpenCASCADE. You have to do the same, where you need to get a CAD geometry
from the STL file.

Best
W.

王艺康

unread,
Nov 2, 2024, 11:11:56 PM11/2/24
to deal.II User Group

Yes I did, I read the file using TopoDS_Shape bow_surface = OpenCASCADE::read_SLT ( cad_file_name ); 

and I read the file usingOpenCASCADE::extract_compound_shapes (Bowed Surfaces, Compounds, Composite Solids, Solids, Shells, Lines ) was extracted, and then the coarse mesh was imported, but the refinement was not refined by looking for the stl file.(I followed the steps in step-54 to the letter).

Wolfgang Bangerth

unread,
Nov 3, 2024, 9:54:35 PM11/3/24
to dea...@googlegroups.com
On 11/2/24 21:11, 王艺康 wrote:
> Yes I did, I read the file using TopoDS_Shape
> <https://dealii.org/developer/doxygen/deal.II/classTensor.html> bow_surface <https://dealii.org/developer/doxygen/deal.II/classTensor.html> = OpenCASCADE::read_SLT <https://dealii.org/developer/doxygen/deal.II/namespaceOpenCASCADE.html#affe07b496f4edf844d5f4e8d7a540295> ( _cad_file_name_ <https://dealii.org/developer/doxygen/deal.II/classTensor.html> );
>
> and I read the file usingOpenCASCADE::extract_compound_shapes
> <https://dealii.org/developer/doxygen/deal.II/namespaceOpenCASCADE.html#a1e49f50433c835c841eed35f40862560> (Bowed Surfaces <https://dealii.org/developer/doxygen/deal.II/classTensor.html>, Compounds <https://dealii.org/developer/doxygen/deal.II/classTensor.html>, Composite Solids <https://dealii.org/developer/doxygen/deal.II/classTensor.html>, Solids <https://dealii.org/developer/doxygen/deal.II/classTensor.html>, Shells <https://dealii.org/developer/doxygen/deal.II/classTensor.html>, Lines <https://dealii.org/developer/doxygen/deal.II/classTensor.html> ) was extracted, and then the coarse mesh was imported, but the refinement was not refined by looking for the stl file.(I followed the steps in step-54 to the letter).
>

OK, so if the steps you are taking are not working, then show us what it is
you are doing. We cannot *guess* what your problem is if you don't show us
what it is you are trying.

Can you post the code you are using, along with all input files?

Best
WB

王艺康

unread,
Nov 4, 2024, 12:52:35 AM11/4/24
to deal.II User Group
I have a complex model surface file stl (two-dimensional cell located in three-dimensional space), I extracted some of the points in the stl file and plotted a coarse mesh (3d) with gmsh, I want to encrypt the coarse mesh (based on the surface of the stl file) using step-54. I pray that this will achieve an accurate description of the complex model
粗网格.jpg

stl.jpg

王艺康

unread,
Nov 4, 2024, 5:00:51 AM11/4/24
to deal.II User Group
In step-54 a mesh is a two-dimensional cell located in three-dimensional space that provides the corresponding line and surface manifolds based on the input iges file. But in my case the stl file has only face sheet information, I give the manifolds from the stl file to the face an error occurs, giving to the cell will not refine the surface according to the stl file

Wolfgang Bangerth

unread,
Nov 4, 2024, 10:55:14 AM11/4/24
to dea...@googlegroups.com

On 11/4/24 03:00, 王艺康 wrote:
> **
>
> In step-54 a mesh is a two-dimensional cell located in three-dimensional
> space that provides the corresponding line and surface manifolds based
> on the input iges file. But in my case the stl file has only face sheet
> information, I give the manifolds from the stl file to the face an error
> occurs, giving to the cell will not refine the surface according to the
> stl file

I don't know what else to suggest other than repeat what I said before:

"if the steps you are taking are not working, then show us what it is
you are doing. We cannot *guess* what your problem is if you don't
show us what it is you are trying."

In particular, there is literally nothing we can suggest when you say
"an error occurs" without telling us what the error is, where it comes
from, and what you tried to address it. There are currently 14208 places
in deal.II that can create errors. You need to tell us more about the
error you get if you want us to be able to help you with it.

Best
WB

Luca Heltai

unread,
Nov 4, 2024, 11:49:54 AM11/4/24
to Deal.II Users
Are you sure that the units of measure are all congruent? OpenCASCADE uses millimeters by default, but gmsh, for example, uses meters. If this is the case, then you have to specify (when you create the manifold from opencascade) what are the scalings to apply before you attach it to a face (you can only attach opencascade manifolds based on stl files to faces in 3d, or to cells and faces in Triangulation<2,3>, as in step-54).

L.

> On 4 Nov 2024, at 11:00, 王艺康 <yikangw...@gmail.com> wrote:
>
> In step-54 a mesh is a two-dimensional cell located in three-dimensional space that provides the corresponding line and surface manifolds based on the input iges file. But in my case the stl file has only face sheet information, I give the manifolds from the stl file to the face an error occurs, giving to the cell will not refine the surface according to the stl file
>
> On Monday, November 4, 2024 at 1:52:35 PM UTC+8 王艺康 wrote:
> I have a complex model surface file stl (two-dimensional cell located in three-dimensional space), I extracted some of the points in the stl file and plotted a coarse mesh (3d) with gmsh, I want to encrypt the coarse mesh (based on the surface of the stl file) using step-54. I pray that this will achieve an accurate description of the complex model
>
>
>
> On Monday, November 4, 2024 at 10:54:35 AM UTC+8 Wolfgang Bangerth wrote:
> On 11/2/24 21:11, 王艺康 wrote:
> > Yes I did, I read the file using TopoDS_Shape
> > <https://dealii.org/developer/doxygen/deal.II/classTensor.html> bow_surface <https://dealii.org/developer/doxygen/deal.II/classTensor.html> = OpenCASCADE::read_SLT <https://dealii.org/developer/doxygen/deal.II/namespaceOpenCASCADE.html#affe07b496f4edf844d5f4e8d7a540295> ( _cad_file_name_ <https://dealii.org/developer/doxygen/deal.II/classTensor.html> );
> >
> > and I read the file usingOpenCASCADE::extract_compound_shapes
> > <https://dealii.org/developer/doxygen/deal.II/namespaceOpenCASCADE.html#a1e49f50433c835c841eed35f40862560> (Bowed Surfaces <https://dealii.org/developer/doxygen/deal.II/classTensor.html>, Compounds <https://dealii.org/developer/doxygen/deal.II/classTensor.html>, Composite Solids <https://dealii.org/developer/doxygen/deal.II/classTensor.html>, Solids <https://dealii.org/developer/doxygen/deal.II/classTensor.html>, Shells <https://dealii.org/developer/doxygen/deal.II/classTensor.html>, Lines <https://dealii.org/developer/doxygen/deal.II/classTensor.html> ) was extracted, and then the coarse mesh was imported, but the refinement was not refined by looking for the stl file.(I followed the steps in step-54 to the letter).
> >
>
> OK, so if the steps you are taking are not working, then show us what it is
> you are doing. We cannot *guess* what your problem is if you don't show us
> what it is you are trying.
>
> Can you post the code you are using, along with all input files?
>
> Best
> WB
>
>
> --
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>
>
>
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/dealii/24d85738-203f-4273-a60c-994b682ab905n%40googlegroups.com.

王艺康

unread,
Nov 5, 2024, 1:46:03 AM11/5/24
to deal.II User Group
I am very sorry that I did not make my mistake clear.
I will send you my code and input file (which is a 2D mesh attempt in 3D space), I suspect that I didn't attach the flow shape of the complex model to the coarse mesh but I have no proof of that!
test-54.cc
lv-in-face.msh
lv-in-face.igs

Wolfgang Bangerth

unread,
Nov 15, 2024, 5:42:12 PM11/15/24
to dea...@googlegroups.com
On 11/4/24 23:46, 王艺康 wrote:
> I am very sorry that I did not make my mistake clear.
> I will send you my code and input file (which is a 2D mesh attempt in 3D
> space), I suspect that I didn't attach the flow shape of the complex model to
> the coarse mesh but I have no proof of that!

I tried out your code, but I can't compile it. I get the following errors:

/home/bangerth/p/deal.II/1/install/examples/step-1/step-1.cc:115:29: error: no
matching function for call to
‘dealii::OpenCASCADE::ArclengthProjectionLineManifold<2,
3>::ArclengthProjectionLineManifold(std::vector<TopoDS_Wire>&, const double&)’
115 | wires, tolerance);

and

/home/bangerth/p/deal.II/1/install/examples/step-1/step-1.cc:120:29: error: no
matching function for call to ‘dealii::OpenCASCADE::NURBSPatchManifold<2,
3>::NURBSPatchManifold(std::vector<TopoDS_Face>&, const double&)’
120 | faces, tolerance);

What version of deal.II are you using? What happens if you try the latest
release, 9.6?

Best
W.
Reply all
Reply to author
Forward
0 new messages