Hi Wolfgang,

I've been looking at a few sources regarding FE_Enriched:
(A) https://www.dealii.org/current/doxygen/deal.II/classFE__Enriched.html
(B) 
https://github.com/dealii/dealii/blob/master/tests/fe/fe_enriched_step-36b.cc


I've been trying to get my problem class to work with a placeholder 
enrichment function from example (B), but I'm getting tripped up.
I looked at the formatting on Line 146 of fe_enriched.cc:

FE_Enriched<dim, spacedim>::FE_Enriched(
  const FiniteElement<dim, spacedim> &fe_base,
  const FiniteElement<dim, spacedim> &fe_enriched,
  const Function<spacedim> *          enrichment_function)


I have tried to implement this format in the constructor for my problem 
class.  I am trying to set fe_base as FE_Q, and then fe_enriched as another 
FE_Q multiplied
by the enrichment function.

template <int dim, int spacedim>
shElast<dim, spacedim>::shElast(
    const std::string &  initial_mesh_filename,
    const std::string &  output_filename)

    : 

*fe( FE_Q<dim>(1)  ,   FE_Q<dim>(1) ,   enrichment)*
, dof_handler(triangulation)
    , quadrature_formula(fe.degree + 1)
    , initial_mesh_filename(initial_mesh_filename)
    , output_filename(output_filename)
, mapping( FE_Q<dim>(1))

{}

  where I've previously declared:

  Triangulation<dim>             triangulation;  
*  const FE_Enriched<dim>         fe;*
  DoFHandler<dim>                dof_handler;
  const QGauss<dim>              quadrature_formula;
  const MappingFE<dim>           mapping;
*  EnrichmentFunction<dim>        enrichment;*

*When I try to compile my program, I get this error:*

dealii/examples/enrich/enrich9.cc:324:25: error: no matching function for 
call to ‘dealii::FE_Enriched<3, 3>::FE_Enriched(dealii::FE_Q<3, 3>, 
dealii::FE_Q<3, 3>, problem_namespace::EnrichmentFunction<3>&)’
  324 |  , mapping( FE_Q<dim>(1))

*Then I get the following notes about my arguments and failure to find 
conversions:*

In file included from dealii/examples/enrich/enrich9.cc:53:
fe/fe_enriched.h:263:3: note: candidate: ‘dealii::FE_Enriched<dim, 
spacedim>::FE_Enriched(const std::vector<const 
dealii::FiniteElement<dimension_, space_dimension_>*>&, const 
std::vector<unsigned int>&, const 
std::vector<std::vector<std::function<const 
dealii::Function<spacedim>*(const typename dealii::Triangulation<dim, 
spacedim>::cell_iterator&)> > >&) [with int dim = 3; int spacedim = 3; 
typename dealii::Triangulation<dim, spacedim>::cell_iterator = 
dealii::TriaIterator<dealii::CellAccessor<3, 3> >]’
  263 |   FE_Enriched(
      |   ^~~~~~~~~~~

deal.II/fe/fe_enriched.h:264:62: note:   no known conversion for argument 1 
from ‘dealii::FE_Q<3, 3>’ to ‘const std::vector<const 
dealii::FiniteElement<3, 3>*, std::allocator<const dealii::FiniteElement<3, 
3>*> >&’
  264 |     const std::vector<const FiniteElement<dim, spacedim> *> &fes,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~

deal.II/fe/fe_enriched.h:249:3: note: candidate: ‘dealii::FE_Enriched<dim, 
spacedim>::FE_Enriched(const dealii::FiniteElement<dimension_, 
space_dimension_>*, const std::vector<const 
dealii::FiniteElement<dimension_, space_dimension_>*>&, const 
std::vector<std::vector<std::function<const 
dealii::Function<spacedim>*(const typename dealii::Triangulation<dim, 
spacedim>::cell_iterator&)> > >&) [with int dim = 3; int spacedim = 3; 
typename dealii::Triangulation<dim, spacedim>::cell_iterator = 
dealii::TriaIterator<dealii::CellAccessor<3, 3> >]’
  249 |   FE_Enriched(
      |   ^~~~~~~~~~~

deal.II/fe/fe_enriched.h:250:62: note:   no known conversion for argument 1 
from ‘dealii::FE_Q<3, 3>’ to ‘const dealii::FiniteElement<3, 3>*’
  250 |     const FiniteElement<dim, spacedim> *                     
fe_base,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

deal.II/fe/fe_enriched.h:200:3: note: candidate: ‘dealii::FE_Enriched<dim, 
spacedim>::FE_Enriched(const dealii::FiniteElement<dimension_, 
space_dimension_>&) [with int dim = 3; int spacedim = 3]’
  200 |   FE_Enriched(const FiniteElement<dim, spacedim> &fe_base);
      |   ^~~~~~~~~~~

deal.II/fe/fe_enriched.h:200:3: note:   candidate expects 1 argument, 3 
provided

deal.II/fe/fe_enriched.h:186:3: note: candidate: ‘dealii::FE_Enriched<dim, 
spacedim>::FE_Enriched(const dealii::FiniteElement<dimension_, 
space_dimension_>&, const dealii::FiniteElement<dimension_, 
space_dimension_>&, const dealii::Function<spacedim>*) [with int dim = 3; 
int spacedim = 3]’
  186 |   FE_Enriched(const FiniteElement<dim, spacedim> &fe_base,
      |   ^~~~~~~~~~~

deal.II/fe/fe_enriched.h:188:51: note:   no known conversion for argument 3 
from ‘shell::EnrichmentFunction<3>’ to ‘const dealii::Function<3, double>*’
  188 |               const Function<spacedim> *         
 enrichment_function);
      |               
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~







It seems that I'm misunderstanding a few things about how FE_Enriched 
works.  Can you see what I'm doing wrong in constructing the FE_Enriched?  
It looks like there's issues with forms I am using for FE_Q and the 
enrichment function.  Do you have any tips or suggested resources?

Many thanks,
Alex

On Friday, June 9, 2023 at 8:27:37 AM UTC-4 Alex Quinlan wrote:

> Thanks, Wolfgang.  I'll dig into FE_Enriched!
>
> On Thursday, June 8, 2023 at 6:57:44 PM UTC-4 Wolfgang Bangerth wrote:
>
>> On 6/8/23 09:40, Alex Quinlan wrote: 
>> > 
>> > I am looking to modify the FE_Q element to have non-polynomial shape 
>> > functions.  It looks like FE_Q_Base takes an argument of type 
>> > ScalarPolynomialBase<dim> (fe_q_base.cc: line 418). 
>> > 
>> > I am looking at a 2D element and instead of 2D polynomial shape 
>> functions like 
>> > this: 
>> > 
>> > N = (1 - ξ)(1 - η) 
>> > 
>> > I would like to add some additional terms like this: 
>> > 
>> >   N = (1 - ξ)(1 - η) + ζ 
>> > 
>> > where ζ changes at different quadrature points. 
>> > 
>> > It seems that I would need to access the values of ζ before computing 
>> > fe_values, since the shape functions and their derivatives would be 
>> dependent 
>> > on ζ. 
>> > 
>> > Any thoughts on how feasible this would be to implement? 
>>
>> Alex: 
>> if your shape functions are not polynomial, then this is the wrong 
>> approach -- 
>> FE_Q_Base is derived from FE_Poly, which is specifically built to create 
>> polynomial bases. 
>>
>> I'm not sure we have a particularly good starting point for a completely 
>> general choice of ζ(ξ,η), but you might want to take a look at what 
>> FE_Enriched is doing. 
>>
>> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/d5721b3e-263c-4068-a45c-b3579dd0b82cn%40googlegroups.com.

Reply via email to