[deal.II] Re: Undefined Referece to `dealii::DataOut_DoFData<dealii::DoFHandler<2, 2>, 2, 2>::get_dataset_names[abi:cxx11]() const'

2018-05-07 Thread phillip mobley
Thank you wolfgang, thank you Bruno. I appreciate your input!

I did look through the settings of the cmake by running make VERBOSE=1. And 
I did notice that the compiler/linker that was running was v6 of gcc. In my 
IDE, it is running v4.9. A quick change to v6 was able to solve my issue

On Thursday, May 3, 2018 at 10:20:12 PM UTC-4, phillip mobley wrote:
>
>
> Hello all,
>
> I am getting an odd error where the program is not able to find a 
> particular reference to one of the packages. 
>
> The error is listed below:
>
> ./Debug/main.cpp.o:(.rodata._ZTVN6dealii7DataOutILi2ENS_10DoFHandlerILi2ELi2E[_ZTVN6dealii7DataOutILi2ENS_10DoFHandlerILi2ELi2E]+0x28):
>  
> undefined reference to `dealii::DataOut_DoFData, 
> 2, 2>::get_dataset_names[abi:cxx11]() const'
>
> ./Debug/main.cpp.o:(.rodata._ZTVN6dealii7DataOutILi2ENS_10DoFHandlerILi2ELi2E[_ZTVN6dealii7DataOutILi2ENS_10DoFHandlerILi2ELi2E]+0x30):
>  
> undefined reference to `dealii::DataOut_DoFData, 
> 2, 2>::get_vector_data_ranges[abi:cxx11]() const'
>
> ./Debug/main.cpp.o:(.rodata._ZTVN6dealii4FE_QILi2ELi2EEE[_ZTVN6dealii4FE_QILi2ELi2EEE]+0x28):
>  
> undefined reference to `dealii::FE_Q<2, 2>::get_name[abi:cxx11]() const'
>
> I installed dealii according to the directions outlined here:
>
> http://dealii.org/8.5.0/readme.html
>
> Now, I do understand that it is recommended to use the cmake files 
> however, I am linking directly to the library that was generated. I am 
> following my own directions located here:
>
>
>1. 
>
>In the compiler settings, you need to make sure that the include paths 
>are to your installation for dealII.Both for the sources and what is 
>bundled. Ex. /home/phillip/dealii851/include and 
>/home/phillip/dealii851/include/deal.II/bundled
>2. 
>
>In the linker settings, have the linker library search path point to 
>the dealii installation director with the lib folder. And, place in the 
>library name in the Libraries option Ex Path -> 
> /home/phillip/dealii851/lib 
>Library -> libdeal_II
>3. 
>
>In order to actually run a program (steps 1 and 2 will allow you to 
>compile the application), you need to copy the library libdeal_II.so.8.5.1 
>from the lib folder in the installation directory of DealII to the 
> /usr/lib 
>folder
>
>
> Long story short, my application requires me to do this. (Maybe I just 
> don't know how to use CMAKE too well). Basically, my application, I ma 
> developing a GUI that will use dealii as the solver. So I am not sure how 
> cmake will interact with the GUI library files that do not use cmake?
>
>
> Anyways, I found that this is an easier procedure. 
>
>
> What is odd is that this code that I am compiling works fine on another 
> machine and I generated my procedure from the working machine. Has anyone 
> received a set of errors similar to this?
>
>
>

-- 
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] deal.II Newsletter #31

2018-05-07 Thread Rene Gassmoeller
Hello everyone!

This is deal.II newsletter #31.
It automatically reports recently merged features and discussions about the 
deal.II finite element library.


## Below you find a list of recently proposed or merged features:

#6513: Finally fix step-59 formula (proposed by kronbichler) 
https://github.com/dealii/dealii/pull/6513

#6512: Attempt to fix the undefined symbol 
VectorImplementation::minimum_parallel_grain_size (proposed by masterleinad) 
https://github.com/dealii/dealii/pull/6512

#6511: Two minor updates to step-59 (proposed by kronbichler; merged) 
https://github.com/dealii/dealii/pull/6511

#6509: [9.0] take over #6475 (proposed by tamiko; merged) 
https://github.com/dealii/dealii/pull/6509

#6508: Fix gmsh/create_tria_02 (proposed by masterleinad; merged) 
https://github.com/dealii/dealii/pull/6508

#6507: [9.0] take over #6487 and #6499 (proposed by tamiko; merged) 
https://github.com/dealii/dealii/pull/6507

#6506: [9.0] take over #6498 (proposed by tamiko; merged) 
https://github.com/dealii/dealii/pull/6506

#6505: [9.0] take over #6496 (proposed by tamiko; merged) 
https://github.com/dealii/dealii/pull/6505

#6504: [9.0] take over #6495 (proposed by tamiko; merged) 
https://github.com/dealii/dealii/pull/6504

#6503: [9.0] take over #6491 (proposed by tamiko; merged) 
https://github.com/dealii/dealii/pull/6503

#6502: [9.0] take over #6489 (proposed by tamiko; merged) 
https://github.com/dealii/dealii/pull/6502

#6501: [9.0] take over #6483 (proposed by tamiko; merged) 
https://github.com/dealii/dealii/pull/6501

#6500: [9.0] take over #6480 (proposed by tamiko; merged) 
https://github.com/dealii/dealii/pull/6500

#6499: Actually fix compute_local_to_global_vertex_index_map. (proposed by 
drwells; merged) https://github.com/dealii/dealii/pull/6499

#6498: CMake: Unset cached results for C++11/14/17 detection if necessary 
(proposed by tamiko; merged) https://github.com/dealii/dealii/pull/6498

#6497: CMake: Remove obsolete code from configure_slepc.cmake (proposed by 
tamiko; merged) https://github.com/dealii/dealii/pull/6497

#6496: Default copy assignement in Tensor for non-Intel compilers (proposed by 
masterleinad; merged) https://github.com/dealii/dealii/pull/6496

#6495: Add a reference to step-10. (proposed by bangerth; merged) 
https://github.com/dealii/dealii/pull/6495

#6494: Force to rerun tests in check_01_compiler_features.cmake (proposed by 
masterleinad) https://github.com/dealii/dealii/pull/6494

#6493: Move parsing of external.conf at the end. (proposed by luca-heltai; 
merged) https://github.com/dealii/dealii/pull/6493

#6492: Move parsing of external.conf at the end. (proposed by luca-heltai; 
merged) https://github.com/dealii/dealii/pull/6492

#6491: Add some more MPI checks. (proposed by drwells; merged) 
https://github.com/dealii/dealii/pull/6491

#6490: Check for constexpr std::max with C++14. (proposed by drwells; merged) 
https://github.com/dealii/dealii/pull/6490

#6489: Fix a test to not write past the end of an array. (proposed by drwells; 
merged) https://github.com/dealii/dealii/pull/6489

#6487: Fix compute_local_to_global_vertex_index_map. (proposed by drwells; 
merged) https://github.com/dealii/dealii/pull/6487

#6486: Fix warning text (proposed by masterleinad; merged) 
https://github.com/dealii/dealii/pull/6486

#6485: [9.0] take over #6486 (proposed by masterleinad; merged) 
https://github.com/dealii/dealii/pull/6485

#6484: Script: Add query_testsuite (proposed by tamiko; merged) 
https://github.com/dealii/dealii/pull/6484

#6483: Fix invalid number of particle properties in a test (proposed by 
gassmoeller; merged) https://github.com/dealii/dealii/pull/6483

#6482: Revert "Default copy assignement in Tensor for non-Intel compilers" 
(proposed by tamiko; merged) https://github.com/dealii/dealii/pull/6482

#6481: Revert "Default copy assignement in Tensor for non-Intel compilers" 
(proposed by tamiko; merged) https://github.com/dealii/dealii/pull/6481

#6480: Fix a GCC8 warning: use std::move_backward instead of std::memmove 
(proposed by drwells; merged) https://github.com/dealii/dealii/pull/6480

#6479: [9.0] take over #6474 (proposed by tamiko; merged) 
https://github.com/dealii/dealii/pull/6479

#6478: [9.0] take over #6476 (proposed by tamiko; merged) 
https://github.com/dealii/dealii/pull/6478

#6477: [9.0] Revert "Replace std::memmove by std::move for std::pair" (proposed 
by tamiko; merged) https://github.com/dealii/dealii/pull/6477

#6476: Add inclusion guards around instantiation that requires OpenCascade. 
(proposed by jppelteret; merged) https://github.com/dealii/dealii/pull/6476

#6475: Fix the remaining gcc-8 warnings (proposed by masterleinad; merged) 
https://github.com/dealii/dealii/pull/6475

#6474: Default copy assignement in Tensor for non-Intel compilers (proposed by 
masterleinad; merged) https://github.com/dealii/dealii/pull/6474

#6472: Triangulation manages offsets. Data attaching classes take handles. 
(proposed by 

[deal.II] Re: Initialising vector solution for mixed formulation problem

2018-05-07 Thread Daniel Arndt
Jane,

[...]
>
> Now, 
> VectorTools::interpolate(dof_handler, exact_solution, solution);
>
> gives me a dimension mismatch error - I'm assuming that this is due to the 
> fact that RT elements can't distinguish between the x and y components. 
>
I would expect that RT elements are not interpolatory and expect a 
corresponding error message. What exactly is the error message you get in 
debug mode?
 

>
> I then tried adding a component mask in various ways to put the velocity 
> and pressure solutions in separately, but I still get the same error. 
> Doing a component mask with solution.block(0) separately also gives me a 
> number of dofs mismatch error.
>
> Is there any way around this? The above interpolation works if i have Fe_Q 
> elements (like in step-22) so I've narrowed it down to the fact that it is 
> because of the function space, but I need the function spaces as they are. 
>
> I can't seem to find another way around this using the interpolation 
> function, and hope that there is actually a simple way around this? 
>
Try to use VectorTools::project 

 
instead.

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.


Re: [deal.II] Re: Rescale dimensions of system before output

2018-05-07 Thread 'Maxi Miller' via deal.II User Group
I.e. I should call the function like
const std::vector locally_owned_vertices = 
get_locally_owned_vertices(triangulation);
GridTools::transform (std::bind(::MinimalSurfaceProblem::
rescale_body_length, this, std::placeholders::_1), triangulation);
triangulation.communicate_locally_moved_vertices(locally_owned_vertices
);


or is that incorrect?

Am Montag, 7. Mai 2018 17:28:32 UTC+2 schrieb Daniel Arndt:
>
> Maxi
>
>
> Furthermore I tested the transform-function, and got the following error:
>> ~/heat_equation_with_pulse_propagation/heat_equation/source/main.cpp:1648
>> :26: error: no matching function for call to ‘transform(std::_Bind_helper
>>  (Step15::MinimalSurfaceProblem<2>::*)(
>> dealii::Point<2, double>), const Step15::MinimalSurfaceProblem<2>*, const 
>> std::_Placeholder<1>&>::type, const dealii::parallel::distributed::
>> Triangulation<2, 2>&)’
>>  GridTools::transform (std::bind(::MinimalSurfaceProblem
>> ::rescale_body_length, this, std::placeholders::_1), triangulation);
>>  
>> ~^
>> In file included from ~/heat_equation_with_pulse_propagation/
>> heat_equation/source/main.cpp:37:0:
>> /opt/dealii/include/deal.II/grid/grid_tools.h:2612:8: note: candidate: 
>> template void dealii::
>> GridTools::transform(const Transformation&, dealii::Triangulation> spacedim2>&)
>>void transform (const Predicate,
>> ^
>> /opt/dealii/include/deal.II/grid/grid_tools.h:2612:8: note:   template 
>> argument deduction/substitution failed:
>> ~/heat_equation_with_pulse_propagation/heat_equation/source/main.cpp:1648
>> :26: note:   types ‘dealii::Triangulation’ and ‘const 
>> dealii::parallel::distributed::Triangulation<2, 2>’ have incompatible cv-
>> qualifiers
>>  GridTools::transform (std::bind(::MinimalSurfaceProblem
>> ::rescale_body_length, this, std::placeholders::_1), triangulation);
>>
>> It appears you are trying to call GridTools::transform from a place where 
> triangulation is const, e.g. in a const member function.
>
>  
>
>> According to the documentation I also should use "transform" not after 
>> refining the mesh:
>> A safe approach is to use this function prior to any refinement in 
>> parallel, if that is possible, but not after you refine the mesh.
>>
> If you are calling 
> void parallel::Triangulation< 1, spacedim 
> >::communicate_locally_moved_vertices( 
> 
> )
> directly after that, you should be fine.
>
> 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.


Re: [deal.II] Re: Rescale dimensions of system before output

2018-05-07 Thread Daniel Arndt
Maxi


Furthermore I tested the transform-function, and got the following error:
> ~/heat_equation_with_pulse_propagation/heat_equation/source/main.cpp:1648:
> 26: error: no matching function for call to ‘transform(std::_Bind_helper<
> false, dealii::Point<2, double> (Step15::MinimalSurfaceProblem<2>::*)(
> dealii::Point<2, double>), const Step15::MinimalSurfaceProblem<2>*, const 
> std::_Placeholder<1>&>::type, const dealii::parallel::distributed::
> Triangulation<2, 2>&)’
>  GridTools::transform (std::bind(::MinimalSurfaceProblem::
> rescale_body_length, this, std::placeholders::_1), triangulation);
>  
> ~^
> In file included from ~/heat_equation_with_pulse_propagation/heat_equation
> /source/main.cpp:37:0:
> /opt/dealii/include/deal.II/grid/grid_tools.h:2612:8: note: candidate: 
> template void dealii::
> GridTools::transform(const Transformation&, dealii::Triangulation spacedim2>&)
>void transform (const Predicate,
> ^
> /opt/dealii/include/deal.II/grid/grid_tools.h:2612:8: note:   template 
> argument deduction/substitution failed:
> ~/heat_equation_with_pulse_propagation/heat_equation/source/main.cpp:1648:
> 26: note:   types ‘dealii::Triangulation’ and ‘const 
> dealii::parallel::distributed::Triangulation<2, 2>’ have incompatible cv-
> qualifiers
>  GridTools::transform (std::bind(::MinimalSurfaceProblem::
> rescale_body_length, this, std::placeholders::_1), triangulation);
>
> It appears you are trying to call GridTools::transform from a place where 
triangulation is const, e.g. in a const member function.

 

> According to the documentation I also should use "transform" not after 
> refining the mesh:
> A safe approach is to use this function prior to any refinement in 
> parallel, if that is possible, but not after you refine the mesh.
>
If you are calling 
void parallel::Triangulation< 1, spacedim 
>::communicate_locally_moved_vertices( 

)
directly after that, you should be fine.

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.


Re: [deal.II] Re: Rescale dimensions of system before output

2018-05-07 Thread 'Maxi Miller' via deal.II User Group
The class has this member function, but it can not copy refined grids, thus 
making it unusable for me.
Furthermore I tested the transform-function, and got the following error:
~/heat_equation_with_pulse_propagation/heat_equation/source/main.cpp:1648:26
: error: no matching function for call to ‘transform(std::_Bind_helper (Step15::MinimalSurfaceProblem<2>::*)(dealii::
Point<2, double>), const Step15::MinimalSurfaceProblem<2>*, const std::
_Placeholder<1>&>::type, const dealii::parallel::distributed::Triangulation<
2, 2>&)’
 GridTools::transform (std::bind(::MinimalSurfaceProblem::
rescale_body_length, this, std::placeholders::_1), triangulation);
 
~^
In file included from ~/heat_equation_with_pulse_propagation/heat_equation/
source/main.cpp:37:0:
/opt/dealii/include/deal.II/grid/grid_tools.h:2612:8: note: candidate: 
template void dealii::GridTools
::transform(const Transformation&, dealii::Triangulation&)
   void transform (const Predicate,
^
/opt/dealii/include/deal.II/grid/grid_tools.h:2612:8: note:   template 
argument deduction/substitution failed:
~/heat_equation_with_pulse_propagation/heat_equation/source/main.cpp:1648:26
: note:   types ‘dealii::Triangulation’ and ‘const dealii::
parallel::distributed::Triangulation<2, 2>’ have incompatible cv-qualifiers
 GridTools::transform (std::bind(::MinimalSurfaceProblem::
rescale_body_length, this, std::placeholders::_1), triangulation);

According to the documentation I also should use "transform" not after 
refining the mesh:
A safe approach is to use this function prior to any refinement in parallel, 
if that is possible, but not after you refine the mesh.
Are there alternative approaches?

Thanks!



Am Freitag, 4. Mai 2018 17:55:48 UTC+2 schrieb Wolfgang Bangerth:
>
> On 05/04/2018 02:34 AM, 'Maxi Miller' via deal.II User Group wrote: 
> > I would like to use a temporary triangulation, in order to keep the 
> > triangulation I am working on untouched. Is there a way to copy the 
> > triangulation (defined as parallel::distributed::Triangulation) to a 
> > temporary triangulation? According to 
> > 
> http://www.dealii.org/developer/doxygen/deal.II/classparallel_1_1distributed_1_1Triangulation.html
>  
> > there is no way to do that directly, is that correct? 
> > Or is it more efficient to scale the original triangulation, write the 
> > data, and re-scale it? 
>
> Rescaling is a cheap operation -- I'd just do that and the scale back 
> when you're done. On the other hand, copying is expensive and difficult, 
> so I'd avoid that if possible. 
>
> (It is possible that p::d::Triangulation has a member function 
> copy_from(), but I don't recall for sure.) 
>
> 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] Re: C1 elements for 4th order derivatives

2018-05-07 Thread Daniel Arndt
Yaakov,

Mixed formulation seems not so fast, can we have other choices in Dealii to 
> solve C1 Problems? e.g. Meshfree?
>
What exactly do you mean by the "Mixed formulation seems not so fast"? Do 
you have an implementation using a mixed formulation that appears to be too 
slow?
If so, it would be helpful if you can tell us which part of your program is 
slow and we might be able to help you.

At the moment, neither C1-elements nor meshfree methods are directly 
available in deal.II.

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.


Re: [deal.II] There is something when I use cmake to configure dealii with hdf5

2018-05-07 Thread cxmail . work
Thank you! Professor W.
I have solved my problem, 

-DHDF5_LIBRARY=/usr/lib/x86_64-linux-gnu/hdf5/serial/lib 

this command should link a static library, not a /lib.

在 2018年4月27日星期五 UTC+8下午10:45:27,Wolfgang Bangerth写道:
>
> On 04/27/2018 01:28 AM, cxmai...@gmail.com  wrote: 
> > @davydden But after I finish configure the dealii: 
> > 
> > | 
> > sudo cmake -DCMAKE_INSTALL_PREFIX=/home/chenxi/DealIInew 
>
> It's generally a bad idea to do anything with 'sudo'. In your case, you 
> are installing into your home directory, so it is not even necessary here. 
>
>
> > But I still got some warnings: 
> > 
> > 
> > | 
> > WARNING:Target"deal_II.g"requests linking to directory 
> > "/usr/lib/x86_64-linux-gnu/hdf5/serial/lib".Targetsmay link only to 
> > libraries.CMakeisdropping the item. 
>
> I don't know where they come from, but these are just warnings. You can 
> ignore them. As long as 
>
> > But it works when I use make install to install dealii 
> ...it works, you should be fine. Can you run any of the tutorial programs? 
>
> 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.


Re: [deal.II] Re: Why fe.shape_value( const unsigned int i, const Point< dim > & p ) return a negative number?

2018-05-07 Thread Zhao Yidong
Thanks a lot! I get the same answer by using quadrature.point(q), and I get 
the similar answer after I transfer the real space point into reference 
space( [0, 1]x[0, 1] ), and then use fe.shape_value(reference_point).

Best
Yidong

在 2018年5月7日星期一 UTC+8下午2:37:22,Wolfgang Bangerth写道:
>
> On 05/07/2018 02:20 PM, Zhao Yidong wrote: 
> > 
> > 2.Iterate on every quadrature point in every cell, store them. (These 
> points 
> > are in real space right?) 
> > | 
> > 
> > for(unsignedq=0;q > 
> > Pointpoint =fe_values.quadrature_point(q); 
> > 
> > | 
> > 
> > 3. Use fe.shape_value() to get shape value at every degree of a cell, 
> > store_point is the point I store in the 2nd step. 
> > | 
> > 
> > doubleshapeValue =fe.shape_value(i,store_point);// shape value 
> > 
> > | 
>
> This is your problem. 'store_point' lives in real space, but 
> 'fe.shape_value' 
> wants a point on the reference cell. You need to call 
>fe.shape_value (quadrature.point(q)); 
>
> 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.


Re: [deal.II] Re: Why fe.shape_value( const unsigned int i, const Point< dim > & p ) return a negative number?

2018-05-07 Thread Wolfgang Bangerth

On 05/07/2018 02:20 PM, Zhao Yidong wrote:


2.Iterate on every quadrature point in every cell, store them. (These points 
are in real space right?)

|

for(unsignedq=0;q

Re: [deal.II] Re: Why fe.shape_value( const unsigned int i, const Point< dim > & p ) return a negative number?

2018-05-07 Thread Zhao Yidong
Thank you very much!

My fe is FE_Q(1) type:

FE_Q(1)

I make comparison like this:
1.Create fe_values like this:

FEValues fe_values(fe, quadrature,

   update_values |

   update_quadrature_points | 

   update_gradients |
   update_JxW_values);

2.Iterate on every quadrature point in every cell, store them. (These 
points are in real space right?)

for (unsigned q=0; qvertex(numberPoint);
Use these nodes, I transfer the real point into a reference point.

2. I use these points in reference space to calculate shape function:

double shapeValue = fe.shape_value(i, reference_point); // shape value
This also gives me different answer with fe_values

I will check can I get the same answer if I transfer the real point into 
reference point(in [0,1]x[0,1]).

(My understanding of gradient is differential, so can I calculate it by 
finite difference?
I can get forward_point = current_point + Point(epsilon, 0, 0)
and backward_point = current_point - Point(-epsilon, 0, 0)
to calculate gradient[0] = (shape_function(forward_point) - 
shape_function(backward_point)) / 2*epsilon,

and the same way for gradient[1], gradient[2] in 3d space ?)

Thanks again!

Best
Yidong










在 2018年5月7日星期一 UTC+8下午1:20:34,Wolfgang Bangerth写道:
>
> On 05/06/2018 09:05 AM, Zhao Yidong wrote: 
> > 
> > Indeed, my problem is this: 
> > 1. I have fe which is a FiniteElement class, and I have fe_values which 
> is a 
> > FEValues class. I also have QGauss quadrature to create fe_values. 
> > 2. I iterate on every quadrature point in a iteration on every cell, 
> store the 
> > quadrature points. 
> > 3. Use fe_values.value(i, q) to calculate shape functions, and 
> > fe.shape_value(i, point) to calculate another shape function, but find 
> they 
> > are different. 
> > 
> > So I want to know what's the difference between this two methods? 
> Because I 
> > want to separate the fe and quadrature points, so can I use 
> fe.shape_value to 
> > calculate the shape functions? 
>
> FiniteElement defines shape functions on the reference element. FEValues 
> describes these shape functions on the real cell. For many elements, you 
> get 
> the same result whether you 
> * evaluate the shape function on the reference cell at a quadrature point 
>also defined on the reference cell (via FiniteElement::shape_value and 
>Quadrature::point) 
> * evaluate the shape function on the real cell at a quadrature point 
>also defined on the real cell (via FEValues::shape_value, with 
> quadrature 
>point locations also available from FEValues). 
>
> But there are also elements for which this is not true. It's not clear to 
> me 
> what exactly you do in your comparison -- can you show a piece of code? 
>
> (You will have to use FEValues anyway at one point if you also want the 
> *gradients* of the shape functions -- these are never the same on 
> reference 
> and real cell.) 
>
> 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.