[deal.II] Re: Error calculating shape gradient

2020-06-10 Thread A.Z Ihsan
Great, it works now. 

THanks Simon. 

BR, 
Ihsan

On Wednesday, June 10, 2020 at 12:50:30 PM UTC+2, Simon Sticko wrote:
>
> Hi,
> Yes. Here, you add a number of scalar elements of different degree:
>
> > for (unsigned int deg=1; deg <= max_fe_degree; ++deg)
> > {
> > fe_collection.push_back(FE_Q(deg));
> > quadrature_collection.push_back(QGauss(deg+1));
> > face_quadrature_collection.push_back(QGauss(deg+1));
> > }
>
> which makes sense for a scalar problem, like the Poisson equation.
>
> But if you solve for displacement in a material the solution has dim 
> components:
>
> u = (u_x, u_y, u_z)
>
> so you want to use a FESystem element with dim components:
>
> fe_collection.push_back(FESystem(FE_Q(deg), dim));
>
> Best,
> Simon
>
>
> On Wednesday, June 10, 2020 at 12:03:57 PM UTC+2, A.Z Ihsan wrote:
>>
>> Hi Simon, 
>>
>> i followed the tutorial step-27 about hp-fem, using the similar 
>> constructor with dim = 3
>> for (unsigned int deg=1; deg <= max_fe_degree; ++deg)
>>   {
>> fe_collection.push_back(FE_Q(deg));
>> quadrature_collection.push_back(QGauss(deg+1));
>> face_quadrature_collection.push_back(QGauss(deg+1));
>>   }
>>
>> I tried to look into the fe_collection.n_components(), it yields 1.
>> is that what you meant?
>>
>> BR, 
>> Ihsan
>>
>> On Wednesday, June 10, 2020 at 9:07:58 AM UTC+2, Simon Sticko wrote:
>>>
>>> Hi,
>>> from the error message you can see that the element you are using only 
>>> has 1 component. You get an error because you are trying to access 
>>> component 1, which doesn't exist. Since your element should have dim 
>>> components, there is likely something wrong with how you create your 
>>> element. It should probably be similar as in step-8.
>>>
>>> Best,
>>> Simon
>>>
>>>
>>> On Wednesday, June 10, 2020 at 8:29:03 AM UTC+2, A.Z Ihsan wrote:
>>>>
>>>> Hi all, 
>>>>
>>>> i am getting this error while calculating the local cell matrix for my 
>>>> hp fem application
>>>>
>>>> dealii::Tensor<1, spacedim> dealii::FEValuesBase>>>>> spacedim>::shape_grad_component(unsigned int, unsigned int, unsigned 
>>>>>> int) 
>>>>>> const [with int dim = 3; int spacedim = 3]
>>>>>
>>>>> The violated condition was: 
>>>>>
>>>>> component < fe->n_components()
>>>>>
>>>>> Additional information: 
>>>>>
>>>>> Index 1 is not in the half-open range [0,1).
>>>>>
>>>>> Stacktrace:
>>>>>
>>>>> ---
>>>>>
>>>>> #0  ../build/local: dealii::FEValuesBase<3, 
>>>>>> 3>::shape_grad_component(unsigned int, unsigned int, unsigned int) const
>>>>>
>>>>> #1  ../build/local: dealii::SymmetricTensor<2, 3, double> 
>>>>>> LinearElasticity::get_strain<3>(dealii::FEValues<3, 3> const&, unsigned 
>>>>>> int, unsigned int)
>>>>>
>>>>> #2  ../build/local: LinearElasticity::HPSolver<3, 
>>>>>> dealii::Vector 
>>>>>> >::assemble_cell_matrix(dealii::TriaActiveIterator>>>>> > 
>>>>>> 3>, false> > const&, dealii::FullMatrix&, 
>>>>>> dealii::hp::FEValues<3, 
>>>>>> 3>&)
>>>>>
>>>>> #3  ../build/local: 
>>>>>> LinearElasticity::HPSerialSolver<3>::assemble_linear_system(LinearElasticity::HPSerialSolver<3>::LinearSystem&)
>>>>>
>>>>> #4  ../build/local: 
>>>>>> LinearElasticity::HPSerialSolver<3>::solve_problem()
>>>>>
>>>>>  
>>>>>
>>>>>
>>>> The idea is similar to the tutorial step-27, but here i use the 
>>>> symmetric tensor for returning strain. Can someone explain to me what the 
>>>> error is and how to resolve it? 
>>>>
>>>> BR, 
>>>> Ihsan
>>>>
>>>

-- 
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/ef61e2f6-6275-4d17-b71c-c9f81caa1c99o%40googlegroups.com.


[deal.II] Re: Error calculating shape gradient

2020-06-10 Thread A.Z Ihsan
Hi Simon, 

i followed the tutorial step-27 about hp-fem, using the similar constructor 
with dim = 3
for (unsigned int deg=1; deg <= max_fe_degree; ++deg)
  {
fe_collection.push_back(FE_Q(deg));
quadrature_collection.push_back(QGauss(deg+1));
face_quadrature_collection.push_back(QGauss(deg+1));
  }

I tried to look into the fe_collection.n_components(), it yields 1.
is that what you meant?

BR, 
Ihsan

On Wednesday, June 10, 2020 at 9:07:58 AM UTC+2, Simon Sticko wrote:
>
> Hi,
> from the error message you can see that the element you are using only has 
> 1 component. You get an error because you are trying to access component 1, 
> which doesn't exist. Since your element should have dim components, there 
> is likely something wrong with how you create your element. It should 
> probably be similar as in step-8.
>
> Best,
> Simon
>
>
> On Wednesday, June 10, 2020 at 8:29:03 AM UTC+2, A.Z Ihsan wrote:
>>
>> Hi all, 
>>
>> i am getting this error while calculating the local cell matrix for my hp 
>> fem application
>>
>> dealii::Tensor<1, spacedim> dealii::FEValuesBase>>> spacedim>::shape_grad_component(unsigned int, unsigned int, unsigned int) 
>>>> const [with int dim = 3; int spacedim = 3]
>>>
>>> The violated condition was: 
>>>
>>> component < fe->n_components()
>>>
>>> Additional information: 
>>>
>>> Index 1 is not in the half-open range [0,1).
>>>
>>> Stacktrace:
>>>
>>> ---
>>>
>>> #0  ../build/local: dealii::FEValuesBase<3, 
>>>> 3>::shape_grad_component(unsigned int, unsigned int, unsigned int) const
>>>
>>> #1  ../build/local: dealii::SymmetricTensor<2, 3, double> 
>>>> LinearElasticity::get_strain<3>(dealii::FEValues<3, 3> const&, unsigned 
>>>> int, unsigned int)
>>>
>>> #2  ../build/local: LinearElasticity::HPSolver<3, dealii::Vector 
>>>> >::assemble_cell_matrix(dealii::TriaActiveIterator>>> > 
>>>> 3>, false> > const&, dealii::FullMatrix&, dealii::hp::FEValues<3, 
>>>> 3>&)
>>>
>>> #3  ../build/local: 
>>>> LinearElasticity::HPSerialSolver<3>::assemble_linear_system(LinearElasticity::HPSerialSolver<3>::LinearSystem&)
>>>
>>> #4  ../build/local: LinearElasticity::HPSerialSolver<3>::solve_problem()
>>>
>>>  
>>>
>>>
>> The idea is similar to the tutorial step-27, but here i use the symmetric 
>> tensor for returning strain. Can someone explain to me what the error is 
>> and how to resolve it? 
>>
>> BR, 
>> Ihsan
>>
>

-- 
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/a53a7d49-9216-4423-ae1b-efde89aa8caeo%40googlegroups.com.


[deal.II] Error calculating shape gradient

2020-06-10 Thread A.Z Ihsan
Hi all, 

i am getting this error while calculating the local cell matrix for my hp 
fem application

dealii::Tensor<1, spacedim> dealii::FEValuesBase> spacedim>::shape_grad_component(unsigned int, unsigned int, unsigned int) 
>> const [with int dim = 3; int spacedim = 3]
>
> The violated condition was: 
>
> component < fe->n_components()
>
> Additional information: 
>
> Index 1 is not in the half-open range [0,1).
>
> Stacktrace:
>
> ---
>
> #0  ../build/local: dealii::FEValuesBase<3, 
>> 3>::shape_grad_component(unsigned int, unsigned int, unsigned int) const
>
> #1  ../build/local: dealii::SymmetricTensor<2, 3, double> 
>> LinearElasticity::get_strain<3>(dealii::FEValues<3, 3> const&, unsigned 
>> int, unsigned int)
>
> #2  ../build/local: LinearElasticity::HPSolver<3, dealii::Vector 
>> >::assemble_cell_matrix(dealii::TriaActiveIterator> > 
>> 3>, false> > const&, dealii::FullMatrix&, dealii::hp::FEValues<3, 
>> 3>&)
>
> #3  ../build/local: 
>> LinearElasticity::HPSerialSolver<3>::assemble_linear_system(LinearElasticity::HPSerialSolver<3>::LinearSystem&)
>
> #4  ../build/local: LinearElasticity::HPSerialSolver<3>::solve_problem()
>
>  
>
>
The idea is similar to the tutorial step-27, but here i use the symmetric 
tensor for returning strain. Can someone explain to me what the error is 
and how to resolve it? 

BR, 
Ihsan

-- 
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/83d6f2cc-b746-4cb0-bf43-7b0e1d86f3bbo%40googlegroups.com.


[deal.II] Re: hp fem error assigning Fourier

2020-06-08 Thread A.Z Ihsan
Hi Peter, 

yes, it is solved now. Thanks Peter. 

In deal.ii 9.2.0 the implementation detail of FESeries::Fourier constructor 
can take the first argument  of std::vector, meanwhile in 
deal.ii 9.1 only unsigned int.

BR, 
Ihsan

On Monday, June 8, 2020 at 10:10:18 AM UTC+2, peterrum wrote:
>
> Dear Ihsan,
>
> is the issue solved now? I have compiled your code with the current 
> version of deal.II and it works.
>
> Peter 
>
> On Monday, 8 June 2020 09:56:21 UTC+2, A.Z Ihsan wrote:
>>
>> Oops, i was wrong. I followed the deal.ii 9.2.0 tutorial meanwhile in my 
>> local deal.ii version is 9.1.
>> There is a couple different implementation in terms of FESeries::Fourier.
>>
>> On Friday, June 5, 2020 at 12:25:47 PM UTC+2, A.Z Ihsan wrote:
>>>
>>> Hi Peter, 
>>> thank you for the answer. Actually i did put the fe_series.h. 
>>> I forgot to mention that the problem arise when i use template 
>>> specialization by the end the implementation
>>>
>>> #include 
>>> #include 
>>> #include 
>>> #include 
>>>
>>> using namespace dealii;
>>>
>>> namespace hpfe{
>>> template 
>>> class HPSolver
>>> {
>>> public:
>>>  HPSolver(
>>>  const unsigned int max_fe_degree);
>>>  //virtual ~HPSolver();
>>>
>>> const hp::FECollection& get_fe_collection();
>>>  const hp::QCollection& get_face_quadrature_collection();   
>>>  
>>> protected:
>>>  hp::FECollection fe_collection;
>>>  hp::QCollection quadrature_collection;
>>>  hp::QCollection face_quadrature_collection;
>>>  hp::QCollection  fourier_q_collection;
>>>  std::unique_ptr> fourier;
>>>  std::vector ln_k;
>>>  Table>fourier_coefficients;
>>> };
>>>
>>> template 
>>> HPSolver::HPSolver(
>>>  const unsigned int max_degree)
>>> {
>>>  for (unsigned int degree=2; degree <= max_degree; ++degree)
>>>{
>>>  fe_collection.push_back(FE_Q(degree));
>>>  quadrature_collection.push_back(QGauss(degree+1));
>>>  face_quadrature_collection.push_back(QGauss(degree+1));
>>>}
>>>  const unsigned int N = max_degree;
>>>  QGauss<1>  base_quadrature(2);
>>>  QIterated quadrature(base_quadrature, N);
>>>  for (unsigned int i = 0; i < fe_collection.size(); i++)
>>>fourier_q_collection.push_back(quadrature);
>>>  std::vector n_coefficients_per_direction(fe_collection.
>>> size(), N);
>>>  fourier = std::make_unique>(n_coefficients_per_
>>> direction, fe_collection, fourier_q_collection);
>>>  //resize(fourier_coefficients, N);
>>> }
>>> }
>>> template class hpfe::HPSolver<3, Vector> ;
>>>
>>> can you try once more?
>>>
>>> BR, 
>>> ihsan
>>>
>>>
>>>> On Friday, 5 June 2020 10:40:29 UTC+2, A.Z Ihsan wrote:
>>>>>
>>>>>
>>>>> Hi All, 
>>>>>
>>>>> I am trying to implement hp-fem into my problem according to the 
>>>>> step-27. But, i have an error when i am trying to compile, 
>>>>>
>>>>> error: no matching function for call to 'dealii::FESeries::Fourier<3, 
>>>>>> 3>::Fourier(std::vector&, dealii::hp::FECollection<3, 3>&, 
>>>>>> dealii::hp::QCollection<3>&)'
>>>>>>  { return unique_ptr<_Tp>(new 
>>>>>> _Tp(std::forward<_Args>(__args)...)); }
>>>>>
>>>>>
>>>>> i believe there is a mistake in assigning fourier, but i copied the 
>>>>> step-27 exactly. 
>>>>> Here is the code snippet... could someone help me?
>>>>>
>>>>> template 
>>>>> class HPSolver
>>>>> {
>>>>> public:
>>>>> HPSolver(
>>>>> const unsigned int max_fe_degree);
>>>>> virtual ~HPSolver();
>>>>>
>>>>> const hp::FECollection& get_fe_collection();
>>>>> const hp::QCollection& get_face_quadrature_collection();   
>>>>>  
>>>>> protected:
>>>>> hp::FECollection fe_collection;
>>>>> hp::QCollection quadrature_collection;
>>>>> hp::QCollection face_quadrature_collection;
>>>>> hp::QCollect

[deal.II] Re: hp fem error assigning Fourier

2020-06-08 Thread A.Z Ihsan
Oops, i was wrong. I followed the deal.ii 9.2.0 tutorial meanwhile in my 
local deal.ii version is 9.1.
There is a couple different implementation in terms of FESeries::Fourier.

On Friday, June 5, 2020 at 12:25:47 PM UTC+2, A.Z Ihsan wrote:
>
> Hi Peter, 
> thank you for the answer. Actually i did put the fe_series.h. 
> I forgot to mention that the problem arise when i use template 
> specialization by the end the implementation
>
> #include 
> #include 
> #include 
> #include 
>
> using namespace dealii;
>
> namespace hpfe{
> template 
> class HPSolver
> {
> public:
>  HPSolver(
>  const unsigned int max_fe_degree);
>  //virtual ~HPSolver();
>
> const hp::FECollection& get_fe_collection();
>  const hp::QCollection& get_face_quadrature_collection();   
>  
> protected:
>  hp::FECollection fe_collection;
>  hp::QCollection quadrature_collection;
>  hp::QCollection face_quadrature_collection;
>  hp::QCollection  fourier_q_collection;
>  std::unique_ptr> fourier;
>  std::vector ln_k;
>  Table>fourier_coefficients;
> };
>
> template 
> HPSolver::HPSolver(
>  const unsigned int max_degree)
> {
>  for (unsigned int degree=2; degree <= max_degree; ++degree)
>{
>  fe_collection.push_back(FE_Q(degree));
>  quadrature_collection.push_back(QGauss(degree+1));
>  face_quadrature_collection.push_back(QGauss(degree+1));
>}
>  const unsigned int N = max_degree;
>  QGauss<1>  base_quadrature(2);
>  QIterated quadrature(base_quadrature, N);
>  for (unsigned int i = 0; i < fe_collection.size(); i++)
>fourier_q_collection.push_back(quadrature);
>  std::vector n_coefficients_per_direction(fe_collection.size
> (), N);
>  fourier = std::make_unique>(n_coefficients_per_
> direction, fe_collection, fourier_q_collection);
>  //resize(fourier_coefficients, N);
> }
> }
> template class hpfe::HPSolver<3, Vector> ;
>
> can you try once more?
>
> BR, 
> ihsan
>
>
>> On Friday, 5 June 2020 10:40:29 UTC+2, A.Z Ihsan wrote:
>>>
>>>
>>> Hi All, 
>>>
>>> I am trying to implement hp-fem into my problem according to the 
>>> step-27. But, i have an error when i am trying to compile, 
>>>
>>> error: no matching function for call to 'dealii::FESeries::Fourier<3, 
>>>> 3>::Fourier(std::vector&, dealii::hp::FECollection<3, 3>&, 
>>>> dealii::hp::QCollection<3>&)'
>>>>  { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); 
>>>> }
>>>
>>>
>>> i believe there is a mistake in assigning fourier, but i copied the 
>>> step-27 exactly. 
>>> Here is the code snippet... could someone help me?
>>>
>>> template 
>>> class HPSolver
>>> {
>>> public:
>>> HPSolver(
>>> const unsigned int max_fe_degree);
>>> virtual ~HPSolver();
>>>
>>> const hp::FECollection& get_fe_collection();
>>> const hp::QCollection& get_face_quadrature_collection();   
>>>  
>>> protected:
>>> hp::FECollection fe_collection;
>>> hp::QCollection quadrature_collection;
>>> hp::QCollection face_quadrature_collection;
>>> hp::QCollection  fourier_q_collection;
>>> std::unique_ptr> fourier;
>>> std::vector ln_k;
>>> Table>fourier_coefficients;
>>> };
>>>
>>> template 
>>> HPSolver::HPSolver(
>>> const unsigned int max_degree,
>>> :
>>> max_fe_degree(max_degree)
>>> {
>>> for (unsigned int degree=2; degree <= max_fe_degree; ++degree)
>>>   {
>>> fe_collection.push_back(FE_Q(degree));
>>> quadrature_collection.push_back(QGauss(degree+1));
>>> face_quadrature_collection.push_back(QGauss(degree+1));
>>>   }
>>> const unsigned int N = max_fe_degree;
>>> QGauss<1>  base_quadrature(2);
>>> QIterated quadrature(base_quadrature, N);
>>> for (unsigned int i = 0; i < fe_collection.size(); i++)
>>>   fourier_q_collection.push_back(quadrature);
>>> std::vector 
>>> n_coefficients_per_direction(fe_collection.size(), N);
>>> fourier = 
>>> std_cxx14::make_unique>(n_coefficients_per_direction,
>>>  
>>> fe_collection, fourier_q_collection);
>>> resize(fourier_coefficients, N);
>>> }
>>>
>>> BR, 
>>> Ihsan
>>>
>>

-- 
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/8fdb3fe9-05db-4cc6-a789-12950800b256o%40googlegroups.com.


[deal.II] Re: hp fem error assigning Fourier

2020-06-05 Thread A.Z Ihsan
Hi Peter, 
thank you for the answer. Actually i did put the fe_series.h. 
I forgot to mention that the problem arise when i use template 
specialization by the end the implementation

#include 
#include 
#include 
#include 

using namespace dealii;

namespace hpfe{
template 
class HPSolver
{
public:
 HPSolver(
 const unsigned int max_fe_degree);
 //virtual ~HPSolver();

const hp::FECollection& get_fe_collection();
 const hp::QCollection& get_face_quadrature_collection();   
 
protected:
 hp::FECollection fe_collection;
 hp::QCollection quadrature_collection;
 hp::QCollection face_quadrature_collection;
 hp::QCollection  fourier_q_collection;
 std::unique_ptr> fourier;
 std::vector ln_k;
 Table>fourier_coefficients;
};

template 
HPSolver::HPSolver(
 const unsigned int max_degree)
{
 for (unsigned int degree=2; degree <= max_degree; ++degree)
   {
 fe_collection.push_back(FE_Q(degree));
 quadrature_collection.push_back(QGauss(degree+1));
 face_quadrature_collection.push_back(QGauss(degree+1));
   }
 const unsigned int N = max_degree;
 QGauss<1>  base_quadrature(2);
 QIterated quadrature(base_quadrature, N);
 for (unsigned int i = 0; i < fe_collection.size(); i++)
   fourier_q_collection.push_back(quadrature);
 std::vector n_coefficients_per_direction(fe_collection.size
(), N);
 fourier = std::make_unique>(n_coefficients_per_
direction, fe_collection, fourier_q_collection);
 //resize(fourier_coefficients, N);
}
}
template class hpfe::HPSolver<3, Vector> ;

can you try once more?

BR, 
ihsan


> On Friday, 5 June 2020 10:40:29 UTC+2, A.Z Ihsan wrote:
>>
>>
>> Hi All, 
>>
>> I am trying to implement hp-fem into my problem according to the step-27. 
>> But, i have an error when i am trying to compile, 
>>
>> error: no matching function for call to 'dealii::FESeries::Fourier<3, 
>>> 3>::Fourier(std::vector&, dealii::hp::FECollection<3, 3>&, 
>>> dealii::hp::QCollection<3>&)'
>>>  { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
>>
>>
>> i believe there is a mistake in assigning fourier, but i copied the 
>> step-27 exactly. 
>> Here is the code snippet... could someone help me?
>>
>> template 
>> class HPSolver
>> {
>> public:
>> HPSolver(
>> const unsigned int max_fe_degree);
>> virtual ~HPSolver();
>>
>> const hp::FECollection& get_fe_collection();
>> const hp::QCollection& get_face_quadrature_collection();   
>>  
>> protected:
>> hp::FECollection fe_collection;
>> hp::QCollection quadrature_collection;
>> hp::QCollection face_quadrature_collection;
>> hp::QCollection  fourier_q_collection;
>> std::unique_ptr> fourier;
>> std::vector ln_k;
>> Table>fourier_coefficients;
>> };
>>
>> template 
>> HPSolver::HPSolver(
>> const unsigned int max_degree,
>> :
>> max_fe_degree(max_degree)
>> {
>> for (unsigned int degree=2; degree <= max_fe_degree; ++degree)
>>   {
>> fe_collection.push_back(FE_Q(degree));
>> quadrature_collection.push_back(QGauss(degree+1));
>> face_quadrature_collection.push_back(QGauss(degree+1));
>>   }
>> const unsigned int N = max_fe_degree;
>> QGauss<1>  base_quadrature(2);
>> QIterated quadrature(base_quadrature, N);
>> for (unsigned int i = 0; i < fe_collection.size(); i++)
>>   fourier_q_collection.push_back(quadrature);
>> std::vector 
>> n_coefficients_per_direction(fe_collection.size(), N);
>> fourier = 
>> std_cxx14::make_unique>(n_coefficients_per_direction, 
>> fe_collection, fourier_q_collection);
>> resize(fourier_coefficients, N);
>> }
>>
>> BR, 
>> Ihsan
>>
>

-- 
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/18f66ec5-7283-476e-b643-63b693ca10f7o%40googlegroups.com.


[deal.II] hp fem error assigning Fourier

2020-06-05 Thread A.Z Ihsan

Hi All, 

I am trying to implement hp-fem into my problem according to the step-27. 
But, i have an error when i am trying to compile, 

error: no matching function for call to 'dealii::FESeries::Fourier<3, 
> 3>::Fourier(std::vector&, dealii::hp::FECollection<3, 3>&, 
> dealii::hp::QCollection<3>&)'
>  { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }


i believe there is a mistake in assigning fourier, but i copied the step-27 
exactly. 
Here is the code snippet... could someone help me?

template 
class HPSolver
{
public:
HPSolver(
const unsigned int max_fe_degree);
virtual ~HPSolver();

const hp::FECollection& get_fe_collection();
const hp::QCollection& get_face_quadrature_collection();   
 
protected:
hp::FECollection fe_collection;
hp::QCollection quadrature_collection;
hp::QCollection face_quadrature_collection;
hp::QCollection  fourier_q_collection;
std::unique_ptr> fourier;
std::vector ln_k;
Table>fourier_coefficients;
};

template 
HPSolver::HPSolver(
const unsigned int max_degree,
:
max_fe_degree(max_degree)
{
for (unsigned int degree=2; degree <= max_fe_degree; ++degree)
  {
fe_collection.push_back(FE_Q(degree));
quadrature_collection.push_back(QGauss(degree+1));
face_quadrature_collection.push_back(QGauss(degree+1));
  }
const unsigned int N = max_fe_degree;
QGauss<1>  base_quadrature(2);
QIterated quadrature(base_quadrature, N);
for (unsigned int i = 0; i < fe_collection.size(); i++)
  fourier_q_collection.push_back(quadrature);
std::vector 
n_coefficients_per_direction(fe_collection.size(), N);
fourier = 
std_cxx14::make_unique>(n_coefficients_per_direction, 
fe_collection, fourier_q_collection);
resize(fourier_coefficients, N);
}

BR, 
Ihsan

-- 
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/3ee9b204-dd25-451b-b4fc-208a8c550ff4o%40googlegroups.com.


Re: [deal.II] Polycrystal on deal ii

2020-04-07 Thread A.Z Ihsan
Hi Andrew, 

Yes, thats what i want, just simply put the elastic anisotropy at the Gauss 
point level. 
Thank you for the answer. 

Best, 
Ihsan

On Tuesday, April 7, 2020 at 7:41:42 PM UTC+2, mac wrote:
>
> In the classical continuum approach to plasticity there is no grain 
> boundary. The elastic anisotropy of the crystal is captured at the Gauss 
> point level. So you would start by associating different materials 
> properties (elastic / plastic) to Gauss points depending on their spatial 
> location. 
>
> Have a look at the CellDataStorage class and how it is used in step-44.
>
> Best
> Andrew
>
> On 7 Apr 2020, at 18:36, A.Z Ihsan > 
> wrote:
>
> Hi Wolfgang, 
>
> alright, suppose i have a box that divided into two regions, and each 
> region has different elastic constant (anisotropy material). 
> Perhaps the idea is when calculating the cell_matrix, inside the for-loop 
> there is a function for choosing in which elastic constant to be used 
> depending on the region. 
>
> I already have the elastic solver written specifically for one elastic 
> constant.  
> Do you have any hint where should i start? 
>
> BR, 
> Ihsan
> On Tuesday, April 7, 2020 at 6:17:59 PM UTC+2, Wolfgang Bangerth wrote:
>>
>> On 4/7/20 2:30 AM, A.Z Ihsan wrote: 
>> > 
>> > Would anyone give me a hint on how to implement the polycrystal 
>> problem, i.e. 
>> > more than one grain boundary? 
>> > I already have the tensor mechanics solver written in deal.ii, but now 
>> it 
>> > needs to be extended solveing also polycrystal problem. 
>>
>> Ihsan, 
>> that's a rather unspecific question. What have you tried already, and what
>>  
>> step specifically is it that you have trouble with? 
>>
>> Best 
>>   WB 
>>
>>
>> -- 
>>  
>> 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 dea...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/aa866c2c-6d5b-4798-a3df-abcb6a811628%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/dealii/aa866c2c-6d5b-4798-a3df-abcb6a811628%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
>

-- 
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/83805872-e30d-4a4d-9c38-1c91e85b855b%40googlegroups.com.


Re: [deal.II] Polycrystal on deal ii

2020-04-07 Thread A.Z Ihsan
Hi Wolfgang, 

alright, suppose i have a box that divided into two regions, and each 
region has different elastic constant (anisotropy material). 
Perhaps the idea is when calculating the cell_matrix, inside the for-loop 
there is a function for choosing in which elastic constant to be used 
depending on the region. 

I already have the elastic solver written specifically for one elastic 
constant.  
Do you have any hint where should i start? 

BR, 
Ihsan
On Tuesday, April 7, 2020 at 6:17:59 PM UTC+2, Wolfgang Bangerth wrote:
>
> On 4/7/20 2:30 AM, A.Z Ihsan wrote: 
> > 
> > Would anyone give me a hint on how to implement the polycrystal problem, 
> i.e. 
> > more than one grain boundary? 
> > I already have the tensor mechanics solver written in deal.ii, but now 
> it 
> > needs to be extended solveing also polycrystal problem. 
>
> Ihsan, 
> that's a rather unspecific question. What have you tried already, and what 
> step specifically is it that you have trouble with? 
>
> Best 
>   WB 
>
>
> -- 
>  
> 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/aa866c2c-6d5b-4798-a3df-abcb6a811628%40googlegroups.com.


[deal.II] Polycrystal on deal ii

2020-04-07 Thread A.Z Ihsan
Hi, 

Would anyone give me a hint on how to implement the polycrystal problem, 
i.e. more than one grain boundary?
I already have the tensor mechanics solver written in deal.ii, but now it 
needs to be extended solveing also polycrystal problem. 

THank you. 

Best, 
ihsan

-- 
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/eced32b3-fcec-4adf-b24f-3bf868d23743%40googlegroups.com.


[deal.II] Re: KDTree question

2020-01-16 Thread A.Z Ihsan
Dear Wolfgang, 

yes you are right, i did some mistakes in the initialization step and it 
ends up the pointer taking the kdtree is nullptr. 

thank you. 

BR, 
Ihsan

On Tuesday, January 14, 2020 at 1:08:32 PM UTC+1, A.Z Ihsan wrote:
>
> Hi,
>
> i have question regarding the kdtree class in deal ii, though it has 
> become a deprecated class, but for my particular problem it might be 
> helpful. 
> suppose i have a class
>
> template
>
> class A
> {
> public: 
> A();
> 
> private:
> KDTree kdtree;
> };
>
>
>
> the question is how we can get a get function to the return the private 
> kdtree, e.g. A::get_kdtree() ? i still could not figure out what is the 
> type of the KDTree object. 
>
> BR, 
> Ihsan
>

-- 
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/6e3712f1-99df-4409-af6e-52d1256ad89e%40googlegroups.com.


[deal.II] Re: KDTree question

2020-01-14 Thread A.Z Ihsan
to be precise
template
class A
{
public: 
A(std::vector> );
const KDTree & get_kdtree() const;
double doing_something();

private:
KDTree kdtree;
};

and in my implementation i wrote
template 
A::A(std::vector> )
{
kdtree.set_points(points);
}

template 
const KDTree & 
A::get_kdtree() const
{
return kdtree;
}

template 
double
A::doing_something()
{
const auto& _v_kdtree = this->get_kdtree();

}


But everytime i called the get_kdtree function, i got the segmentation 
fault( you may see the snippet in doing_something() function. Any idea to 
resolve this problem?



On Tuesday, January 14, 2020 at 1:08:32 PM UTC+1, A.Z Ihsan wrote:
>
> Hi,
>
> i have question regarding the kdtree class in deal ii, though it has 
> become a deprecated class, but for my particular problem it might be 
> helpful. 
> suppose i have a class
>
> template
>
> class A
> {
> public: 
> A();
> 
> private:
> KDTree kdtree;
> };
>
>
>
> the question is how we can get a get function to the return the private 
> kdtree, e.g. A::get_kdtree() ? i still could not figure out what is the 
> type of the KDTree object. 
>
> BR, 
> Ihsan
>

-- 
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/6f10ec6e-08ea-4fcd-aeb6-5db841d4b228%40googlegroups.com.


[deal.II] KDTree question

2020-01-14 Thread A.Z Ihsan
Hi,

i have question regarding the kdtree class in deal ii, though it has become 
a deprecated class, but for my particular problem it might be helpful. 
suppose i have a class

template

class A
{
public: 
A();

private:
KDTree kdtree;
};



the question is how we can get a get function to the return the private 
kdtree, e.g. A::get_kdtree() ? i still could not figure out what is the 
type of the KDTree object. 

BR, 
Ihsan

-- 
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/b2f44c8e-5ff6-4a18-b382-e897e1f883bf%40googlegroups.com.


Re: [deal.II] Tensor<1, dim> initialization

2020-01-05 Thread A.Z Ihsan
Thank you Matthias. 
It works perfectly!

BR, 
Ihsan

On Sunday, January 5, 2020 at 3:41:38 PM UTC+1, Matthias Maier wrote:
>
>
> On Sun, Jan  5, 2020, at 07:15 CST, "A.Z Ihsan"  > wrote: 
>
> > Tensor<1, 3> b(); 
>
> If you write this then you declare a function "b" returning a 
> Tensor<1,3>. Declare the tensor without the parentheses: 
>
>   Tensor<1, 3> b; 
>
> You can access individual elements of the tensor via operator[]: 
>
>   b[0] = 1; 
>   b[1] = 1; 
>   b[2] = 0; 
>
> And you can do meaningful mathematical tensor operations. Including, 
> scaling a tensor 
>
>   auto a = 5. * b; 
>
> Adding two tensors together: 
>
>   auto c = a + b; 
>
> Taking the inner product: 
>
>   auto k = a * b; 
>
> etc. 
>
> Best, 
> Matthias 
>

-- 
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/9141b21d-f581-4493-a4d9-644b29255f39%40googlegroups.com.


[deal.II] Tensor<1, dim> initialization

2020-01-05 Thread A.Z Ihsan

Hi there, 
just a small question. 

suppose we want to construct a rank-1 tensor in 3 dim with values (1, 1, 0) 
: 
Tensor<1, 3> b();

i read a documentation we can use array_type as a parameter construction, 
but still i aml confused how to use it. 
any idea how to use it?

BR,
Ihsan

-- 
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/db9eecc4-9de6-4a12-b7dd-a3d262f1314c%40googlegroups.com.