extrude by providing z-coordinates

25 views
Skip to first unread message

Weixiong Zheng

unread,
Apr 4, 2018, 4:40:04 PM4/4/18
to deal.II User Group
Hi,

I found out there is not a function for extruding triangulation by exact position of cell vertices along z-axis. So I wrote a piece of code by modifying
GridGenerator::extrude_triangulation.
The attachment is an example of what it does.

Did for my own needs. Just wonder if I can contribute to deal.II with this super trivial work. Never mind if it's too trivial to put it in deal.II or someone else if already doing similar work.

Best,
Weixiong


Screenshot 2018-04-04 13.37.01.png

Wolfgang Bangerth

unread,
Apr 4, 2018, 4:47:37 PM4/4/18
to dea...@googlegroups.com
Any contribution is much appreciated!

If I understand correctly, you just generalize the second and third
arguments of the existing function

void
extrude_triangulation (const Triangulation<2, 2> &input,
const unsigned int n_slices,
const double height,
Triangulation<3,3> &result);

? I can totally see how that makes sense!

Best
W.


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

Weixiong Zheng

unread,
Apr 4, 2018, 4:57:01 PM4/4/18
to deal.II User Group
Sir,

Yes. It then allows non-uniform slicing along z-axis.

Also, I am wondering if you guys are interested in making triangulation based on a basic one for repeated structure as shown in the attachment. I have to do this for my project but didn't find a function so I did something like copy->shifting->merging->extruding (if 3D). I think it would be cool to have this in deal.II.

You have any instruction on how to make contribution?

Weixiong

在 2018年4月4日星期三 UTC-7下午1:47:37,Wolfgang Bangerth写道:
Screenshot 2018-04-04 13.56.38.png

Wolfgang Bangerth

unread,
Apr 4, 2018, 5:55:44 PM4/4/18
to dea...@googlegroups.com

Weixiong,

> Yes. It then allows non-uniform slicing along z-axis.

Great. Yes, please do submit a pull request for this function! (And let
us know if you need help figuring out how to create pull requests! I
know we have a how-to file somewhere, but I forgot where exactly it is.
Someone?)


> Also, I am wondering if you guys are interested in making triangulation
> based on a basic one for repeated structure as shown in the attachment.
> I have to do this for my project but didn't find a function so I did
> something like copy->shifting->merging->extruding (if 3D). I think it
> would be cool to have this in deal.II.

Yes. I had to laugh at your previous picture which shows that you're
still working with fuel assemblies apparently -- and I wanted to say
"no, no, you'll need 17x17 replications, not 5x5!"

I think it would be neat to have a function of the form replicate(...)
that does exactly what you are suggesting and are already doing in your
code. It would take an existing triangulation and replicate it a number
of times in the x, y, and z-directions.

Weixiong Zheng

unread,
Apr 4, 2018, 6:36:37 PM4/4/18
to deal.II User Group
Sir

The Issue 6158 and 6159 have been opened for the proposed functionalities. Tell you if you have any
thought.

By instruction, it's actually more for the testing. Maybe I will just follow how the other functions are tested.

By the way, I am at UC Berkeley leading an open source group project based on deal.II on GitHub 
called "Bay-Area Radiation Transport (BART)" with MIT license for research/mentoring purpose. The link
is where the repo is "https://github.com/SlaybaughLab/BART". You may add it to where you tell which 
projects are using deal.II if you want.

Weixiong

在 2018年4月4日星期三 UTC-7下午2:55:44,Wolfgang Bangerth写道:

Wolfgang Bangerth

unread,
Apr 5, 2018, 6:48:05 PM4/5/18
to dea...@googlegroups.com

Weixiong,

> By instruction, it's actually more for the testing. Maybe I will just
> follow how the other functions are tested.

Yes -- my took of choice is generally to do
grep -r merge_triangulations tests/*/*cc
to find out which tests use a given function (here,
merge_triangulations()). I then typically clone such a test and modify
it to use the function I'm currently writing.


> By the way, I am at UC Berkeley leading an open source group project
> based on deal.II on GitHub
> called "Bay-Area Radiation Transport (BART)" with MIT license for
> research/mentoring purpose. The link
> is where the repo is "https://github.com/SlaybaughLab/BART". You may add
> it to where you tell which
> projects are using deal.II if you want.

Excellent -- I've done this now!

Thanks

Weixiong Zheng

unread,
Apr 5, 2018, 7:15:05 PM4/5/18
to deal.II User Group
PR has been approved and will be merged sometime. Thanks for fill
the project name into Applications entry.

在 2018年4月5日星期四 UTC-7下午3:48:05,Wolfgang Bangerth写道:
Reply all
Reply to author
Forward
0 new messages