Query Regarding Direct Import of Dream3D Synthetic Microstructures into Deal.II

177 views
Skip to first unread message

ME20D503 NEWTON

unread,
Feb 28, 2024, 11:21:20 PM2/28/24
to deal.II User Group
Dear all,
I am writing to inquire about the feasibility of directly importing Dream3D synthetic microstructures into Deal.II. If this is indeed possible, could you kindly provide guidance on the required file format?


thanks.

Wolfgang Bangerth

unread,
Feb 29, 2024, 3:06:12 AM2/29/24
to dea...@googlegroups.com
@Newton:
I'm not sure anyone here has heard of that file format (or, indeed, what it
represents) before. What is it? What does it represent? Where is it documented?

In general, people read in all sorts of file formats in their programs. But it
all starts from understanding what the data means and how it is represented.

Best
W.

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


ME20D503 NEWTON

unread,
Feb 29, 2024, 4:08:46 AM2/29/24
to deal.II User Group

Dear Dr. Bangerth,

I am currently working on generating a synthetic microstructure of polycrystalline material using Dream3D, an open-source software (accessible at https://dream3d.bluequartz.net/). My intention is to import this microstructure into Deal.II for further simulations, such as discretization and solving phase field equations.

However, I'm facing some confusion regarding the appropriate file format for exporting from Dream3D to Deal. II. Additionally, I've come across another open-source software, PRISM-PF (https://prisms-center.github.io/phaseField/), which has successfully achieved a similar process and is built upon Deal. II.

I would greatly appreciate any guidance or insights you could provide on this matter.


Thank you.

Wolfgang Bangerth

unread,
Feb 29, 2024, 4:34:32 PM2/29/24
to dea...@googlegroups.com
On 2/29/24 02:08, ME20D503 NEWTON wrote:
> However, I'm facing some confusion regarding the appropriate file format for
> exporting from Dream3D to Deal. II. Additionally, I've come across another
> open-source software, PRISM-PF (https://prisms-center.github.io/phaseField/
> <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fprisms-center.github.io%2FphaseField%2F&data=05%7C02%7CWolfgang.Bangerth%40colostate.edu%7C46793158b282404d8f3b08dc39060bcc%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C638447949240491605%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C60000%7C%7C%7C&sdata=NqzE83il7FWP%2FAwG6sGvfP%2BPUPNxuESv244YD3kpQtE%3D&reserved=0>), which has successfully achieved a similar process and is built upon Deal. II.
>
> I would greatly appreciate any guidance or insights you could provide on this
> matter.

If PRISM-PR does what you want, by all means go with it! As for the Dream3d
format: You need to explain in more detail what "I'm facing some confusion"
means in concrete terms :-)

ME20D503 NEWTON

unread,
Mar 5, 2024, 2:46:21 AM3/5/24
to deal.II User Group
Dear Bangerth, I'm facing difficulties with the following issues, and I would appreciate your input:

I'm working on processing a .vtk file exported from DREAM.3D using PRISMS-PF scripts(https://github.com/prisms-center/phaseField/tree/master/applications/grainGrowth_dream3d) to convert it into a .vtk file format with UNSTRUCTURED_GRID dataset, making it compatible with deal.II.

Here are my specific doubts:

  1. In the final .vtk file format, I don't have information about the element type (linear or quadratic). Is it possible to assign the element type in deal.II after reading the .vtk file?

  2. In the final .vtk file format, there is no information regarding the scale I'm working with. I intend to create a nanoscale sample, but the dimensions I set in DREAM.3D are unitless. Is it possible to scale it down in deal.II after reading the .vtk file?

  3. The final .vtk file includes information like featureId (please see the attached figure). After reading this .vtk file, I want to assign some variables to the featureId. Is it possible to extract the value and assign variables to it in deal.II?

I am attaching all the files.

trial1.vtk a rectilinear grid cell data output from DREAM.3D
microstructure_RL_resampled.vtk point data (using prismPF script)
microstructure_US.vtk UNSTRUCTURED_GRID dataset type(using prismPF script)

Thank you.
microstructure_US.vtk
Final_synthetic_microstructure.jpg
microstructure_RL_resampled.vtk
trial1.vtk

ME20D503 NEWTON

unread,
Mar 5, 2024, 9:34:24 AM3/5/24
to deal.II User Group

Dear Bangerth,

I've successfully solved points 1 and 2.

However, I'm encountering difficulties with point 3. Could you assist me in understanding how to extract the feature IDs from the .vtk file after reading it in dealii, and then perform further operations based on these feature IDs in dealii?

Thank you.

Wolfgang Bangerth

unread,
Mar 7, 2024, 2:08:34 AM3/7/24
to dea...@googlegroups.com
On 3/5/24 00:46, ME20D503 NEWTON wrote:
> 1.
>
> In the final .vtk file format, I don't have information about the element
> type (linear or quadratic). Is it possible to assign the element type in
> deal.II after reading the .vtk file?

I think you already solved that (along with the next problem), but just for
completeness: the .vtk file only contains the *mesh*. You have to choose what
element to use on it. These are independent questions.


> 2.
>
> In the final .vtk file format, there is no information regarding the scale
> I'm working with. I intend to create a nanoscale sample, but the
> dimensions I set in DREAM.3D are unitless. Is it possible to scale it down
> in deal.II after reading the .vtk file?

You will want to use GridTools::scale().


> 3.
>
> The final .vtk file includes information like featureId (please see the
> attached figure). After reading this .vtk file, I want to assign some
> variables to the featureId. Is it possible to extract the value and assign
> variables to it in deal.II?

The featureId in your .vtk file is associated with nodes. I don't think that
we currently have a way in the library to read those in -- you might want to
check what GridIn::read_vtk() can do for you. If that function doesn't do it,
you will have to either extend it, or write your own function to do that.

ME20D503 NEWTON

unread,
Mar 11, 2024, 7:31:25 AM3/11/24
to deal.II User Group

Dear Prof. Bangerth,

Thank you for the reply.

I have successfully managed to read the .vtk file in Deal.II and extract the feature IDs along with their corresponding coordinate points by manually parsing the vtk file (using std::getline(file, line)).

However, I am now encountering another difficulty for which I require your guidance.

>> When I use linear elements, I can visualize my initial structure as desired. However, when I switch to using quadratic elements, five additional nodes are added to each cell. Since I only have information about the feature IDs at the four       corners of the cell, I lack data for these extra five nodes. Is there a method to interpolate the feature IDs for these additional nodes using the four at the corners of the cell?

Please refer to the attached figure for a better understanding of my issue.

Thank you.

linear element.png
quadratic element (wireframe).png
linear element (wireframe).png
quadratic element .png

ME20D503 NEWTON

unread,
Mar 13, 2024, 9:31:28 AM3/13/24
to deal.II User Group
Dear everyone, I would greatly appreciate any assistance you can provide with the following issue.

I am trying to use this function to interpolate the feature ID from FE space 1(linear) to FE space 2(quadratic). (please see the trailing mail for a better understanding of my problem)

interpolate() [4/4]
template<int dim, class InVector , class OutVector , int spacedim>

void VectorTools::interpolate

(

const DoFHandler< dim, spacedim > & 
dof_1,

const DoFHandler< dim, spacedim > & 
dof_2,

const FullMatrix< double > & 
transfer,

const InVector & 
data_1,

OutVector & 
data_2 

)
 

my function which i am using in my code is:

VectorTools::interpolate(dof_handler_dream3d, dof_handler_eta, transfer_matrix ,feature_id1_at_all_dof, solution_xi1);

VectorTools::interpolate(dof_handler_dream3d, dof_handler_eta, transfer_matrix ,feature_id2_at_all_dof, solution_xi2);


but i am getting error like :

[ 66%] Linking CXX executable PhaseField

CMakeFiles/PhaseField.dir/PhaseField.cc.o:PhaseField.cc:function PhaseField::Solid<2>::run(): error: undefined reference to 'void dealii::VectorTools::interpolate<2, std::vector<double, std::allocator<double> >, dealii::Vector<double>, 2>(dealii::DoFHandler<2, 2> const&, dealii::DoFHandler<2, 2> const&, dealii::FullMatrix<double> const&, std::vector<double, std::allocator<double> > const&, dealii::Vector<double>&)'

CMakeFiles/PhaseField.dir/PhaseField.cc.o:PhaseField.cc:function PhaseField::Solid<2>::run(): error: undefined reference to 'void dealii::VectorTools::interpolate<2, std::vector<double, std::allocator<double> >, dealii::Vector<double>, 2>(dealii::DoFHandler<2, 2> const&, dealii::DoFHandler<2, 2> const&, dealii::FullMatrix<double> const&, std::vector<double, std::allocator<double> > const&, dealii::Vector<double>&)'

collect2: error: ld returned 1 exit status

make[3]: *** [CMakeFiles/PhaseField.dir/build.make:228: PhaseField] Error 1

make[2]: *** [CMakeFiles/Makefile2:90: CMakeFiles/PhaseField.dir/all] Error 2

make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/run.dir/rule] Error 2

make: *** [Makefile:137: run] Error 2

"make run" terminated with exit code 2. Build might be incomplete.

17:58:08 Build Failed. 4 errors, 63 warnings. (took 20s.439ms)


Thank you.

ME20D503 NEWTON

unread,
Mar 14, 2024, 1:17:58 PM3/14/24
to deal.II User Group
Thank you Now it's working.

Initially, I defined feature_id1_at_all_dof as std::vector<double>, but later I recognized that it should be defined as dealii::Vector<double>.


thank you.
Reply all
Reply to author
Forward
0 new messages