How to access/output reference element basis functions values

42 views
Skip to first unread message

Sanghyun Lee

unread,
Feb 3, 2024, 11:10:56 AM2/3/24
to deal.II User Group
Hello, 

It's been a while since I asked questions to this group, and I hope you are all doing well
I tried to figure this out and dug into the communications, but failed, so if anyone can help me, I would greatly appreciate it. 

I know the deal.ii has this information and I know I have to use " MappingQ1<dim,dim> mapping; "..

1. Is there any way to get or access to the reference element basis functions? 
e.g \hat{phi}_i  (\hat{x}) where \hat{x} \in \hat{K} 

2. In the other direction, I calculated the reference element basis functions with hand, and I want to use the "transform" (https://www.dealii.org/current/doxygen/deal.II/classMapping.html)

virtual void Mapping< dim, spacedim >::transform
(const ArrayView< const Tensor< 1, dim > > & input,
const MappingKind kind,
const typename Mapping< dim, spacedim >::InternalDataBase & internal,
const ArrayView< Tensor< 1, spacedim > > & output
)

But, I don't think we have public acces to "const typename Mapping< dim, spacedim >::InternalDataBase &  internal," so I am keep failing. 

Any advice/idea or your example would be a great help for me. 

Thanks

Sanghyun Lee
Florida State University

Wolfgang Bangerth

unread,
Feb 4, 2024, 4:05:39 PM2/4/24
to dea...@googlegroups.com
On 2/3/24 09:10, Sanghyun Lee wrote:
>
> 1. Is there any way to get or access to the reference element basis functions?
> e.g \hat{phi}_i  (\hat{x}) where \hat{x} \in \hat{K}

This is what the finite element itself provides. Take a look at
FiniteElement::shape_value()
FiniteElement::shape_grad()
etc.


> 2. In the other direction, I calculated the reference element basis functions
> with hand, and I want to use the "transform"
> (https://www.dealii.org/current/doxygen/deal.II/classMapping.html)
>
> virtual void Mapping< dim, spacedim >::transform
> (const ArrayView< const Tensor< 1, dim > > & input,
> const MappingKind kind,
> const typename Mapping< dim, spacedim >::InternalDataBase & internal,
> const ArrayView< Tensor< 1, spacedim > > & output
> )
>
> But, I don't think we have public acces to "const typename Mapping< dim,
> spacedim >::InternalDataBase & internal," so I am keep failing.

Yes, the Mapping member functions are really only meant to be used as a black
box together with FEValues and related classes. Why do you need this function?
What kind of functions do you want to transform from the reference to the real
cell?

Best
Wolfgang

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


Reply all
Reply to author
Forward
0 new messages