Re: [deal.II] ZeroBoundaryCondition when FESystem is used

2017-03-02 Thread Jean-Paul Pelteret
Dear Kyusik,
 

> /user2/hanks318/dealii/dealii_pre/examples/step-20/step-20.cc:575: error: 
> no matching function for call to 
> ‘project_boundary_values(dealii::DoFHandler<2, 2>&, dealii::ZeroFunction<2, 
> double>, dealii::QGauss<1>&, std::map std::less, std::allocator double> > >&, dealii::ComponentMask&)’
>

I think that the problem is that for the VectorTools:: 
project_boundary_values 

 function 
the argument that specifies the function to be projected is not a Function 
itself, but rather a FunctionMap 
. 
You'll notice that this is necessary because you no longer specify the 
boundary id for the Dirichlet Function to be applied to as a parameter to 
the projection function.

I hope that this helps you solve the issue.

Regards,
Jean-Paul

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] write_vtk fail when using hp functionality

2017-03-02 Thread Weixiong Zheng
I will try after CSE17.

Best,
Weixiong

在 2017年2月27日星期一 UTC-5下午9:12:44,Wolfgang Bangerth写道:
>
> On 02/27/2017 12:24 PM, Weixiong Zheng wrote: 
> > Dear all, 
> > 
> > Might be a trivial questions to you guys. I get a scalar problem using 
> hp 
> > class. When I tried to output the results using 
> > 
> > | 
> >   std::vectorsolution_names; 
> > | 
> > 
> >   solution_names.push_back ("phi"); 
> > 
> > 
> > 
> >   std::vector 
> > 
> >   data_component_interpretation(1, 
> > DataComponentInterpretation::component_is_scalar); 
> > 
> > 
> > 
> >   DataOut > data_out; 
> > 
> > 
> > 
> >   data_out.attach_dof_handler (dof_handler); 
> > 
> >   data_out.add_data_vector (scalar_flux, 
> > 
> > solution_names, 
> > 
> > DataOut 
> >::type_dof_data, 
> > 
> > data_component_interpretation); 
> > 
> > 
> > 
> >   data_out.build_patches (); 
> > 
> >   std::string name = "solution.vtk"; 
> > 
> >   std::ofstream output (names.c_str()); 
> > 
> >   data_out.write_vtk (output); 
> > 
> >   std::cout << "see see 3" << std::endl; 
> > 
> > 
> > I got the following error: 
> > 
> > CDLS-DSA(49490,0x7c0cb000) malloc: *** error for object 
> 0x7f7f87707c98: 
> > incorrect checksum for freed object - object was probably modified after 
> being 
> > freed. 
> > 
> > *** set a breakpoint in malloc_error_break to debug 
>
> Weixiong, 
> Can you run this in a debugger, set the breakpoint at the function 
> suggested 
> here, and see if you can get a backtrace? Alternatively, can you create a 
> small, self-contained testcase that shows the problem? 
>
> Best 
>   W. 
>
>
> -- 
>  
> 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Publications based on deal.II

2017-03-02 Thread Wolfgang Bangerth


All,

as you may know, we try to list all publications based on deal.II at
 http://dealii.org/publications.html
We use this list to justify the effort we spend on writing this software, both
to our universities as well as the funding agencies that support its
development.

In anticipation of the next release, we would like to update this page. If you
have (or know of) a publication that uses deal.II for numerical results and
that isn't already listed, please let us know so we can put it on there. For
this purpose, publications also include MSc, Diploma or PhD theses, or
anything else that may seem appropriate.

Thanks!
  Wolfgang

--

Wolfgang Bangerth  email: bange...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: Access specific element within a distributed triangulation

2017-03-02 Thread Daniel Arndt
Seyed,

Thank you. Does your approach also apply to MPICH? Since I am using MPICH, 
> I wonder, if this command can be used there also.
> This struct variable, is there an example within deal.II steps? Or do you 
> have an example in C++ I can learn from. 
>
Since MPICH is (at least) MPI-1.1 conforming, you should be able to use 
that approach. MPI supports Fortran and C. Therefore, the example I 
referenced before is probably quite close to what you can get within C++.
 

> To be honest I am not yet very familiar with MPI itself, barely 
> understanding deal.II parallelism ;)
>
It's certainly hard to understand MPI in deal.II without knowing how MPI in 
principle works ;-).

I have also another idea: How about I find the maximum value regardless of 
> the position and processor core. Then just loop again over all cells and 
> compare the maximum value with the existing value within each cell. Would 
> this be a very inefficient approach or is looping over cells usually 
> computationally cheap in deal.II.
>
What you can do instead, is to first find the maximum values for each 
process, then compute the maximum of these values across all processes and 
finally compare the local maximum with the global maximum. There is no 
reason to loop again through all cells.
This should not be much more expensive than using MPI_MAXLOC directly.

Best,
Daniel

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: Access specific element within a distributed triangulation

2017-03-02 Thread 'Seyed Ali Mohseni' via deal.II User Group
Dear Daniel,

Thank you. Does your approach also apply to MPICH? Since I am using MPICH, 
I wonder, if this command can be used there also.
This struct variable, is there an example within deal.II steps? Or do you 
have an example in C++ I can learn from. 

To be honest I am not yet very familiar with MPI itself, barely 
understanding deal.II parallelism ;)

I have also another idea: How about I find the maximum value regardless of 
the position and processor core. Then just loop again over all cells and 
compare the maximum value with the existing value within each cell. Would 
this be a very inefficient approach or is looping over cells usually 
computationally cheap in deal.II.

Kind regards,
Seyed Ali 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Saving solution on sphere in lat/long coordinates

2017-03-02 Thread Timo Heister
A simple hack I have used is a filter inside paraview (see attached
transform.py use "programmable filter"). I have used it for volume
data, but I would expect it to work for your problem too.

Alternatively, if you compute lat/long as a solution variable (either
in the deal.II code or using the paraview "calculator"), you can use
"warp by vector" inside paraview to move your vertices to the desired
location.

Both options won't handle poles well, though.

On Thu, Mar 2, 2017 at 4:09 AM, Praveen C  wrote:
> Dear all
>
> I solve a PDE on sphere and use
>
> parallel::distributed::Triangulation<2,3>   triangulation;
>
>
> I would like to save the solution in latitude/longitude coordinates for
> visualization, so that I can make a 2-d plot, rather than view it on the
> sphere 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_cfdlab_status_793799466545360896_photo_1&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=6_qybEERFtXDfVizh7WGEN902feGJiTZu4SvfjzYsYA&s=vj9qXBGnwBxKaawxeCkII2lqLZI6nEk8F6Zt0-lV9AI&e=
>  
>
> Do you have any ideas how I can do this in deal.II ?
>
> Thanks
> praveen
>
> --
> The deal.II project is located at 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dealii.org_&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=6_qybEERFtXDfVizh7WGEN902feGJiTZu4SvfjzYsYA&s=BqiJbS6vaxNm9-2k9TAAEAmDaW-xniIKWAeVR3gyiUI&e=
>  
> For mailing list/forum options, see
> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_forum_dealii-3Fhl-3Den&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=6_qybEERFtXDfVizh7WGEN902feGJiTZu4SvfjzYsYA&s=YNsVrYaXP6SYIlBQuduCh8K1mUrZzs1NcGaaXKfOjxE&e=
>  
> ---
> 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+unsubscr...@googlegroups.com.
> For more options, visit 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=6_qybEERFtXDfVizh7WGEN902feGJiTZu4SvfjzYsYA&s=o-8WNwifzEQQbEzpKIEjcq7St9EKC3bhWDK37vsCiJ0&e=
>  .



-- 
Timo Heister
http://www.math.clemson.edu/~heister/

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# filter->programmable filter, then paste the following code into it

import math

pdi = self.GetInput()
pdo = self.GetOutput()

newPoints = vtk.vtkPoints()
numPoints = pdi.GetNumberOfPoints()

for i in range(0, numPoints):
	coord = pdi.GetPoint(i)
	x, y, z = coord[:3]
	r = sqrt(x*x+y*y+z*z)
	t = math.atan2(y,x)
	b = math.acos(z/r)
	newPoints.InsertPoint(i, r/1e6, t, b)

pdo.SetPoints(newPoints)
pdo.GetPointData().AddArray(pdi.GetPointData().GetArray(0))
pdo.GetPointData().AddArray(pdi.GetPointData().GetArray(1))
pdo.GetPointData().AddArray(pdi.GetPointData().GetArray(2))


[deal.II] Re: Access specific element within a distributed triangulation

2017-03-02 Thread Daniel Arndt
Seyed,

What I understood so far is, that the Utilities::MPI::max() function 
> computes the maximum between all processors for each row of my vector. This 
> means if I have a vector of 20 entries, each entry has 8 values distributed 
> on 8 cores for instance. As a result, I get 20 maximum values again, but 
> this time they are maximal and processor independent. 
>
Correct.
 

> Hence, my question now is how am I able to check where the maximum value 
> comes from? Is it possible to output the processor number of the maximum 
> value for each row?
>
If you look at the implementation of Utilities::MPI::max() [2], you see 
that this is essentially a wrapper around MPI_Allreduce called in [3].
What you want is currently not implemented in deal.II, but MPI_MAXLOC is 
exactly doing this. Example 3 in [1] shows how to use this, i.e.
 - copy your std::vector into a struct containing a value and the MPI 
process number
 - call MPI_Allreduce( in_struct, out_struct, vector.size(), 
MPI_DOUBLE_INT, MPI_MAXLOC, mpi_communicator);
 - the maximum value and the number of the first process with that value 
for each entry of your vector is stored in out_struct

My aim is to find the node where the maximum value exists. This is somehow 
> cumbersome in parallel mode since I have to store information about the 
> current CPU core, cell ID and node number. Then somehow use my previously 
> shown distance function in C++ and check the position of the maximum value 
> with regard to the geometry structure I stored.
>
If you save the cells/positions containing the maximum values for each 
process before comparing these across processes, you should be fine with 
this approach.
 
Best,
Daniel 

[1] https://www.open-mpi.org/doc/v2.0/man3/MPI_Reduce.3.php
[2] https://www.dealii.org/8.4.0/doxygen/deal.II/mpi_8h_source.html#l00708
[3] https://www.dealii.org/8.4.0/doxygen/deal.II/mpi_8h_source.html#l00544 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: Access specific element within a distributed triangulation

2017-03-02 Thread 'Seyed Ali Mohseni' via deal.II User Group
Dear Prof. Bangerth and Jean-Paul,

What I understood so far is, that the Utilities::MPI::max() function 
computes the maximum between all processors for each row of my vector. This 
means if I have a vector of 20 entries, each entry has 8 values distributed 
on 8 cores for instance. As a result, I get 20 maximum values again, but 
this time they are maximal and processor independent. 

Hence, my question now is how am I able to check where the maximum value 
comes from? Is it possible to output the processor number of the maximum 
value for each row?
My aim is to find the node where the maximum value exists. This is somehow 
cumbersome in parallel mode since I have to store information about the 
current CPU core, cell ID and node number. Then somehow use my previously 
shown distance function in C++ and check the position of the maximum value 
with regard to the geometry structure I stored.

Is there a more elegant way to solve my problem than what I suggested in 
deal.II?

Thank you for your kind assistance so far :)
And hopefully you overlook my style of approaching things in this rather 
silly and questionable way.

Kind regards,
Seyed Ali

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Saving solution on sphere in lat/long coordinates

2017-03-02 Thread Praveen C
Dear all

I solve a PDE on sphere and use

parallel::distributed::Triangulation<2,3>   triangulation;

I would like to save the solution in latitude/longitude coordinates for
visualization, so that I can make a 2-d plot, rather than view it on the
sphere https://twitter.com/cfdlab/status/793799466545360896/photo/1

Do you have any ideas how I can do this in deal.II ?

Thanks
praveen

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.