<div>In the COMSOL software, there is a mesher. I use the mesher in COMSOL for creating mesh. I do not specify the number of meshes. I just increase the mesh density near the electrodes. I do not mention anywhere the number of meshes. But obviously, the number of points in the vtk file is dependent upon the number of mesh created in COMSOL.</div>
<div> </div>
<div>On Fri, Oct 30, 2009 at 10:40 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>></span> wrote:<br></div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">How is the mesh created? Do you specify the number of tetrahedra or<br>are they used for the analysis?<br>
<div>
<div></div>
<div class="h5"><br>On Fri, Oct 30, 2009 at 6:11 PM, Sanket Jain <<a href="mailto:jainsanket1@gmail.com">jainsanket1@gmail.com</a>> wrote:<br>> I did not understand what you meant by conversion. I assume you meant<br>
> converting my geometry and data into vtk file. Below is a description of<br>> what I am doing. Maybe this helps to narrow down the problem.<br>><br>> Actually there is no comsol file format. COMSOL is a software which can be<br>
> linked with MATLAB (Like a toolbox; but its a seperate software). I create<br>> my FEM model in COMSOL and compute the solutions. Since, MATLAB and COMSOL<br>> are connected, I can take the mesh points, connections and solutions<br>
> (scalars) from COMSOL and save them as .vtk file (unstructured grid) using<br>> my custom .m file (attached).<br>><br>> Also, I have another custom method of solving the FEM problem which is also<br>> MATLAB based. So, for 1 problem I have 2 sets of scalars and one set of mesh<br>
> points and connections (geometry). I save vtk file from the scalars from<br>> alternate method using the same . m file<br>><br>> Therefore, I have 2 vtk files (both unstructured grid) with same geometry<br>> but different scalars. But, when I visualise both of them in VTK (and<br>
> paraview), I have these rough surfaces.<br>><br>> I am attaching both these vtk files for your reference. Also, I am attaching<br>> .m file which reads a .mat file (either data_COMSOL or data_CUSTOM) and<br>
> writes these corresponding .vtk files.<br>><br>> Let me know if I have confused you. I will be happy to clarify my<br>> explanation.<br>><br>> Sanket Jain<br>><br>> On Fri, Oct 30, 2009 at 3:51 PM, Sanket Jain <<a href="mailto:jainsanket1@gmail.com">jainsanket1@gmail.com</a>> wrote:<br>
>><br>>> No the comsol file is not open format. You will require COMSOL software to<br>>> view it. Anyways, I will check the scalar values and then if the problem<br>>> still persists, i will update you with my work.<br>
>><br>>> Sanket<br>>><br>>> On Fri, Oct 30, 2009 at 2:11 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>>> wrote:<br>>>><br>>>> So, my guess is that there is something wrong in your conversion. Is<br>
>>> the comsol file format an open format? Is there a description? If so,<br>>>> can you provide the comsol file you are trying to convert?<br>>>><br>>>> Bill<br>>>><br>>>> On Fri, Oct 30, 2009 at 1:22 PM, Sanket Jain <<a href="mailto:jainsanket1@gmail.com">jainsanket1@gmail.com</a>><br>
>>> wrote:<br>>>> > Yes, I generated the isosurface in comsol. It looks smoother than in<br>>>> > VTK. I<br>>>> > have attached an view for the isosurface. It looks similar when I<br>
>>> > rotate the<br>>>> > isosurface for different view.<br>>>> ><br>>>> > Sanket<br>>>> ><br>>>> > On Fri, Oct 30, 2009 at 12:13 PM, Bill Lorensen<br>
>>> > <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>>>> > wrote:<br>>>> >><br>>>> >> The file and data seem OK. I looked at it in paraview and I see the<br>
>>> >> same sort of "rough" isosurfaces that you see. Can you generate an<br>>>> >> isosurface in COMSOL for comparison?<br>>>> >><br>>>> >> Bill<br>>>> >><br>
>>> >> On Fri, Oct 30, 2009 at 12:36 PM, Bill Lorensen<br>>>> >> <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>>>> >> wrote:<br>>>> >> > If the outside of your mesh is a "box", that is all you will see.<br>
>>> >> ><br>>>> >> > I'll take a look.<br>>>> >> ><br>>>> >> > Bill<br>>>> >> ><br>>>> >> > On Fri, Oct 30, 2009 at 12:27 PM, Sanket Jain<br>
>>> >> > <<a href="mailto:jainsanket1@gmail.com">jainsanket1@gmail.com</a>><br>>>> >> > wrote:<br>>>> >> >> When I open the unstructured grid file in paraview, I get a opaque<br>
>>> >> >> border of<br>>>> >> >> my geometry. When I decrease the opacity, I just see a hollow box.<br>>>> >> >> I<br>>>> >> >> cannot<br>
>>> >> >> see my mesh inside the box. I think there is some problem with the<br>>>> >> >> file. But<br>>>> >> >> I compared my file with the format for writing unstructured grid<br>
>>> >> >> and it<br>>>> >> >> looks correct to me. Do you mind having a look at the file<br>>>> >> >> (attached)?<br>>>> >> >> I<br>>>> >> >> know this might be asking for too much help. I really appreciate<br>
>>> >> >> your<br>>>> >> >> efforts to help me.<br>>>> >> >><br>>>> >> >> Sanket<br>>>> >> >><br>>>> >> >> On Fri, Oct 30, 2009 at 11:17 AM, Bill Lorensen<br>
>>> >> >> <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>>>> >> >> wrote:<br>>>> >> >>><br>>>> >> >>> I mean the unstructured grid (the geometry).<br>
>>> >> >>><br>>>> >> >>> On Fri, Oct 30, 2009 at 12:10 PM, Sanket Jain<br>>>> >> >>> <<a href="mailto:jainsanket1@gmail.com">jainsanket1@gmail.com</a>><br>
>>> >> >>> wrote:<br>>>> >> >>> > Ok. I will recheck my matlab program which writes the vtk file<br>>>> >> >>> > and<br>>>> >> >>> > get<br>
>>> >> >>> > back<br>>>> >> >>> > to you.<br>>>> >> >>> ><br>>>> >> >>> > For Paraview, did you mean only the mesh points without the<br>
>>> >> >>> > scalar<br>>>> >> >>> > values? I<br>>>> >> >>> > checked the unstructured grid with scalars on them. They look<br>>>> >> >>> > exactly<br>
>>> >> >>> > the<br>>>> >> >>> > same as in my VTK code.<br>>>> >> >>> ><br>>>> >> >>> > Sanket<br>>>> >> >>> ><br>
>>> >> >>> > On Fri, Oct 30, 2009 at 7:55 AM, Bill Lorensen<br>>>> >> >>> > <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>>>> >> >>> > wrote:<br>
>>> >> >>> >><br>>>> >> >>> >> Perhaps your scalar values are not associated with the proper<br>>>> >> >>> >> points?<br>>>> >> >>> >> Have you looked at the original unstructured grid with<br>
>>> >> >>> >> paraview?<br>>>> >> >>> >><br>>>> >> >>> >> On Thu, Oct 29, 2009 at 10:21 PM, Sanket Jain<br>>>> >> >>> >> <<a href="mailto:jainsanket1@gmail.com">jainsanket1@gmail.com</a>><br>
>>> >> >>> >> wrote:<br>>>> >> >>> >> > Yes, I tried for number of isovalues. But all of them have<br>>>> >> >>> >> > similar<br>
>>> >> >>> >> > characteristics. Is it anything to do with the vtk file being<br>>>> >> >>> >> > in<br>>>> >> >>> >> > unstructured grid rather than polygonal data? For the mesh, I<br>
>>> >> >>> >> > imported<br>>>> >> >>> >> > from<br>>>> >> >>> >> > COMSOL, I cannot use polygonal data.<br>>>> >> >>> >> ><br>
>>> >> >>> >> > Sanket Jain<br>>>> >> >>> >> > On Thu, Oct 29, 2009 at 6:33 PM, Bill Lorensen<br>>>> >> >>> >> > <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>
>>> >> >>> >> > wrote:<br>>>> >> >>> >> >><br>>>> >> >>> >> >> It does look strange. Have you tried changing the isosurface<br>
>>> >> >>> >> >> value?<br>>>> >> >>> >> >><br>>>> >> >>> >> >> On Thu, Oct 29, 2009 at 5:44 PM, Sanket Jain<br>>>> >> >>> >> >> <<a href="mailto:jainsanket1@gmail.com">jainsanket1@gmail.com</a>><br>
>>> >> >>> >> >> wrote:<br>>>> >> >>> >> >> > I have attached a snapshot of my viewer. The isosurface is<br>>>> >> >>> >> >> > predicting<br>
>>> >> >>> >> >> > the<br>>>> >> >>> >> >> > volume activated during monopolar stimulation. So,<br>>>> >> >>> >> >> > theoretically<br>
>>> >> >>> >> >> > you<br>>>> >> >>> >> >> > will<br>>>> >> >>> >> >> > expect a sphere at a particular iso value.<br>
>>> >> >>> >> >> ><br>>>> >> >>> >> >> > I tried using vtkPolyDataNormals. The figure attached is<br>>>> >> >>> >> >> > the<br>
>>> >> >>> >> >> > output<br>>>> >> >>> >> >> > after<br>>>> >> >>> >> >> > including this filter. But I still think this is not<br>
>>> >> >>> >> >> > smooth.<br>>>> >> >>> >> >> ><br>>>> >> >>> >> >> > I verified by opening my vtk file in Paraview (with,<br>
>>> >> >>> >> >> > Compute<br>>>> >> >>> >> >> > Normal<br>>>> >> >>> >> >> > ON).<br>>>> >> >>> >> >> > Even then i get the same kind of response. So, do you<br>
>>> >> >>> >> >> > think<br>>>> >> >>> >> >> > this<br>>>> >> >>> >> >> > is<br>>>> >> >>> >> >> > the<br>
>>> >> >>> >> >> > best<br>>>> >> >>> >> >> > i can get? Or there might be some problem in the vtk file<br>>>> >> >>> >> >> > which is<br>
>>> >> >>> >> >> > exported<br>>>> >> >>> >> >> > from COMSOL (I verified it multiple times).<br>>>> >> >>> >> >> ><br>
>>> >> >>> >> >> > Thank you,<br>>>> >> >>> >> >> ><br>>>> >> >>> >> >> > Sanket<br>>>> >> >>> >> >> ><br>
>>> >> >>> >> >> > On Thu, Oct 29, 2009 at 4:01 PM, Bill Lorensen<br>>>> >> >>> >> >> > <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>
>>> >> >>> >> >> > wrote:<br>>>> >> >>> >> >> >><br>>>> >> >>> >> >> >> Sorry, reading your e-mail in more detail. Are you<br>
>>> >> >>> >> >> >> generating<br>>>> >> >>> >> >> >> the<br>>>> >> >>> >> >> >> isosurfaces in vtk using vtkContourFIiter or some<br>
>>> >> >>> >> >> >> equivalent.<br>>>> >> >>> >> >> >> If<br>>>> >> >>> >> >> >> so,<br>>>> >> >>> >> >> >> you should run the output through vtkPolyDataNormals.<br>
>>> >> >>> >> >> >><br>>>> >> >>> >> >> >> On Thu, Oct 29, 2009 at 4:59 PM, Bill Lorensen<br>>>> >> >>> >> >> >> <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>
>>> >> >>> >> >> >> wrote:<br>>>> >> >>> >> >> >> > What do you mean by rough? Perhaps the faces are flat<br>>>> >> >>> >> >> >> > shaded?<br>
>>> >> >>> >> >> >> > How<br>>>> >> >>> >> >> >> > are<br>>>> >> >>> >> >> >> > you displaying the model in vtk?<br>
>>> >> >>> >> >> >> ><br>>>> >> >>> >> >> >> > Are your isosurfaces composed of only triangles? If so,<br>>>> >> >>> >> >> >> > did<br>
>>> >> >>> >> >> >> > you<br>>>> >> >>> >> >> >> > provide surface normals at each point?<br>>>> >> >>> >> >> >> ><br>
>>> >> >>> >> >> >> > On Thu, Oct 29, 2009 at 4:30 PM, Sanket Jain<br>>>> >> >>> >> >> >> > <<a href="mailto:jainsanket1@gmail.com">jainsanket1@gmail.com</a>><br>
>>> >> >>> >> >> >> > wrote:<br>>>> >> >>> >> >> >> >> Hello Experts,<br>>>> >> >>> >> >> >> >><br>
>>> >> >>> >> >> >> >> I have just started to use VTK to fulfill my<br>>>> >> >>> >> >> >> >> visualization<br>>>> >> >>> >> >> >> >> needs.<br>
>>> >> >>> >> >> >> >> I<br>>>> >> >>> >> >> >> >> am<br>>>> >> >>> >> >> >> >> trying out few fundamental steps which would be<br>
>>> >> >>> >> >> >> >> crucial<br>>>> >> >>> >> >> >> >> for my<br>>>> >> >>> >> >> >> >> future<br>
>>> >> >>> >> >> >> >> development.<br>>>> >> >>> >> >> >> >><br>>>> >> >>> >> >> >> >> I exported an Finite Element Model (FEM) from COMSOL<br>
>>> >> >>> >> >> >> >> and<br>>>> >> >>> >> >> >> >> wrote<br>>>> >> >>> >> >> >> >> it<br>
>>> >> >>> >> >> >> >> as<br>>>> >> >>> >> >> >> >> vtk<br>>>> >> >>> >> >> >> >> unstructured grid in matlab (points, connections and<br>
>>> >> >>> >> >> >> >> data). I<br>>>> >> >>> >> >> >> >> am<br>>>> >> >>> >> >> >> >> just<br>
>>> >> >>> >> >> >> >> trying<br>>>> >> >>> >> >> >> >> to read my vtk file and trying to visualize the<br>>>> >> >>> >> >> >> >> isosurfaces at<br>
>>> >> >>> >> >> >> >> some<br>>>> >> >>> >> >> >> >> value.<br>>>> >> >>> >> >> >> >><br>
>>> >> >>> >> >> >> >> The problem is the isosurfaces are very rough even<br>>>> >> >>> >> >> >> >> when I<br>>>> >> >>> >> >> >> >> increased<br>
>>> >> >>> >> >> >> >> the<br>>>> >> >>> >> >> >> >> mesh<br>>>> >> >>> >> >> >> >> density in my COMSOL model. I tried to perform the<br>
>>> >> >>> >> >> >> >> same<br>>>> >> >>> >> >> >> >> task<br>>>> >> >>> >> >> >> >> in<br>
>>> >> >>> >> >> >> >> paraview and<br>>>> >> >>> >> >> >> >> even there i saw the same problem.<br>>>> >> >>> >> >> >> >><br>
>>> >> >>> >> >> >> >> Do you think that increasing the mesh density should<br>>>> >> >>> >> >> >> >> solve<br>>>> >> >>> >> >> >> >> it?<br>
>>> >> >>> >> >> >> >> I<br>>>> >> >>> >> >> >> >> cannot<br>>>> >> >>> >> >> >> >> increase the mesh density because of computational<br>
>>> >> >>> >> >> >> >> issues.<br>>>> >> >>> >> >> >> >> Any<br>>>> >> >>> >> >> >> >> ideas<br>
>>> >> >>> >> >> >> >> on<br>>>> >> >>> >> >> >> >> this<br>>>> >> >>> >> >> >> >> problem will be appreciated.<br>
>>> >> >>> >> >> >> >><br>>>> >> >>> >> >> >> >> Thank you,<br>>>> >> >>> >> >> >> >><br>
>>> >> >>> >> >> >> >> Sanket Jain<br>>>> >> >>> >> >> >> >><br>>>> >> >>> >> >> >> >> _______________________________________________<br>
>>> >> >>> >> >> >> >> Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>>>> >> >>> >> >> >> >><br>
>>> >> >>> >> >> >> >> Visit other Kitware open-source projects at<br>>>> >> >>> >> >> >> >> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>> >> >>> >> >> >> >><br>>>> >> >>> >> >> >> >> Please keep messages on-topic and check the VTK FAQ<br>>>> >> >>> >> >> >> >> at:<br>
>>> >> >>> >> >> >> >> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>>>> >> >>> >> >> >> >><br>
>>> >> >>> >> >> >> >> Follow this link to subscribe/unsubscribe:<br>>>> >> >>> >> >> >> >> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
>>> >> >>> >> >> >> >><br>>>> >> >>> >> >> >> >><br>>>> >> >>> >> >> >> ><br>>>> >> >>> >> >> ><br>
>>> >> >>> >> >> ><br>>>> >> >>> >> >> ><br>>>> >> >>> >> >> > --<br>>>> >> >>> >> >> > Sanket Jain<br>
>>> >> >>> >> >> ><br>>>> >> >>> >> ><br>>>> >> >>> >> ><br>>>> >> >>> >> ><br>>>> >> >>> >> > --<br>
>>> >> >>> >> > Sanket Jain<br>>>> >> >>> >> ><br>>>> >> >>> ><br>>>> >> >>> ><br>>>> >> >>> ><br>
>>> >> >>> > --<br>>>> >> >>> > Sanket Jain<br>>>> >> >>> ><br>>>> >> >><br>>>> >> >><br>>>> >> >><br>
>>> >> >> --<br>>>> >> >> Sanket Jain<br>>>> >> >><br>>>> >> ><br>>>> ><br>>>> ><br>>>> ><br>>>> > --<br>
>>> > Sanket Jain<br>>>> ><br>>><br>>><br>>><br>>> --<br>>> Sanket Jain<br>><br>><br>><br>> --<br>> Sanket Jain<br>><br></div></div></blockquote></div>
<br><br clear="all"><br>-- <br>Sanket Jain<br>