Re: [deal.II] Re: discontinuity and overlap of elements in 2D thermoelasticity problem using quadratic elements

2017-01-22 Thread Anup Basak
Dear Jean-Paul,

Yes, I have already checked it with Paraview's warp tool and it works
correctly.

Thanks again,

Anup.

On Mon, Jan 23, 2017 at 12:43 AM, Jean-Paul Pelteret 
wrote:

> Dear Anup,
>
> Thank you for your test case. I forgot to update this thread, but I was in
> fact able to reproduce the problem
> <https://github.com/dealii/dealii/issues/2206#issuecomment-274263422>
> over the weekend. The problem appears to be in the interaction between the
> MappingQEulerian and DataOut classes. In the mean time you can work around
> it by not passing the Eulerian map to DataOut but rather transforming the
> body in the postprocessor itself (e.g. using Paraview's warp tool).
>
> Regards,
> Jean-Paul
>
>
> On Monday, January 23, 2017 at 7:27:57 AM UTC+1, Anup Basak wrote:
>>
>> Dear Jean-Paul,
>>
>> Thank you very much for your reply.
>> Please find the sample code that reproduce the problem. The discontinuity
>> and overlap can be seen by zooming into the mid-bottom and mid-upper part
>> of the deformed configuration.
>>
>> Thanks,
>> Anup.
>>
>>
>>
>> On Saturday, January 21, 2017 at 4:53:13 AM UTC-6, Jean-Paul Pelteret
>> wrote:
>>>
>>> Dear Anup,
>>>
>>> Its possible that this is related to this issue
>>> <https://github.com/dealii/dealii/issues/2206>. Do you perhaps have a
>>> minimal test case that reproduces the problem?
>>>
>>> Best,
>>> Jean-Paul
>>>
>>> On Saturday, January 21, 2017 at 4:07:00 AM UTC+1, Anup Basak wrote:
>>>>
>>>> Hello all,
>>>>
>>>> I have solved a 2D mechanics (thermoelasticity) problem based on step
>>>> 44 using quadratic elements (FE_Q). When I plot the solution in the
>>>> deformed configuration (attached herewith) I see that at one place
>>>> discontinuity gets developed between two elements (Fig. in page 2) and at
>>>> some other place two elements overlap (Fig. in page 3). I have shown the
>>>> locations in the figure of page 1.  However, when linear elements are used,
>>>> this problem does not appear. In both the cases I get sufficient
>>>> convergence.  I have confirmed this issue with both Visit and Paraview. I
>>>> never encountered such strange problem while solving 3D problems. Hence it
>>>> might be an issue related to post-processing.
>>>>
>>>> Has anyone encountered such problem in the past? I shall be thankful if
>>>> someone could tell me what might go wrong.
>>>>
>>>> Thanks and regards,
>>>> Anup.
>>>>
>>> --
> 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.
>

-- 
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: discontinuity and overlap of elements in 2D thermoelasticity problem using quadratic elements

2017-01-22 Thread Anup Basak
Dear Jean-Paul,

Thank you very much for your reply.
Please find the sample code that reproduce the problem. The discontinuity 
and overlap can be seen by zooming into the mid-bottom and mid-upper part 
of the deformed configuration.

Thanks,
Anup. 



On Saturday, January 21, 2017 at 4:53:13 AM UTC-6, Jean-Paul Pelteret wrote:
>
> Dear Anup,
>
> Its possible that this is related to this issue 
> <https://github.com/dealii/dealii/issues/2206>. Do you perhaps have a 
> minimal test case that reproduces the problem?
>
> Best,
> Jean-Paul
>
> On Saturday, January 21, 2017 at 4:07:00 AM UTC+1, Anup Basak wrote:
>>
>> Hello all,
>>
>> I have solved a 2D mechanics (thermoelasticity) problem based on step 44 
>> using quadratic elements (FE_Q). When I plot the solution in the deformed 
>> configuration (attached herewith) I see that at one place discontinuity 
>> gets developed between two elements (Fig. in page 2) and at some other 
>> place two elements overlap (Fig. in page 3). I have shown the locations in 
>> the figure of page 1.  However, when linear elements are used, this problem 
>> does not appear. In both the cases I get sufficient convergence.  I have 
>> confirmed this issue with both Visit and Paraview. I never encountered such 
>> strange problem while solving 3D problems. Hence it might be an issue 
>> related to post-processing.
>>
>> Has anyone encountered such problem in the past? I shall be thankful if 
>> someone could tell me what might go wrong.
>>
>> Thanks and regards,
>> Anup.
>>
>

-- 
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.
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
//
namespace PhaseField
{
  using namespace dealii;
// INPUT OF PARAMETERS
  namespace Parameters
  {
struct FESystem
{
  unsigned int poly_degree;
  unsigned int quad_order;
  static void
  declare_parameters(ParameterHandler &prm);

  void
  parse_parameters(ParameterHandler &prm);
};

void FESystem::declare_parameters(ParameterHandler &prm)
{
  prm.enter_subsection("Finite element system");
  {
prm.declare_entry("Polynomial degree", "2",
  Patterns::Integer(0),
  "Displacement system polynomial order");
prm.declare_entry("Quadrature order", "3",
  Patterns::Integer(0),
  "Gauss quadrature order");
  }
  prm.leave_subsection();
}

void FESystem::parse_parameters(ParameterHandler &prm)
{
  prm.enter_subsection("Finite element system");
  {
poly_degree = prm.get_integer("Polynomial degree");
quad_order = prm.get_integer("Quadrature order");
  }
  prm.leave_subsection();
}

struct Geometry
{
  unsigned int elements_per_width;
  double width;
  double   scale;
  static void
  declare_parameters(ParameterHandler &prm);
  void
  parse_parameters(ParameterHandler &prm);
};
void Geometry::declare_parameters(ParameterHandler &prm)
{
  prm.enter_subsection("Geometry");
  {

prm.declare_entry("Elements per width", "40",
Patterns::Integer(0),
  "Number of elements per width");
   prm.declare_entry("width", "50.0",
Patterns::Double(0),
  "width");

prm.declare_entry("Grid scale", "1e-9",
  Patterns::Double(0.0),
  "Global grid scaling factor");
  }
  prm.leave_subsection();
}
void Geometry::parse_parameters(ParameterHandler &prm)
{
  prm.enter_subsection("Geometry");
  {
elements_per_width = prm.get_integer("Elements per width

[deal.II] using FEValues extractor for a

2016-12-13 Thread Anup Basak
Hello all,

I am solving for a  3 dimensional displacement vector (*dim+1* 
dimensional)  in a *dim=2* dimensional space (for
a planer problem in elasticity). Hence I consider an FEvaluesExtractor:

const FEValuesExtractors::Vector u_fe;

and initialize it as 

u_fe(0)


Now I need to compute the gradient of the shape functions and the gradient 
of the solution vectors. Hence I 
use the command:


for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
for (unsigned int k = 0; k < dofs_per_cell; ++k)
fe_values_ref[u_fe].gradient(k, q_point)


Then I get 2x2 tensors. Could anyone suggest how to get gradient terms 
corresponding to all three vectors
and finally get a 3x3 tensors, instead of 2x2. I am expecting to get a 3x3 
tensor with non-zero entries in the
 first two columns and all zero entries in the third column.


Thanks and regards,
Anup.

-- 
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] a query from step44

2016-12-12 Thread Anup Basak
Hello all,

I am going to solve a generalized plane stain problem based on step 44. I 
have three displacement components (3 dofs per node) on a 2D geometry (dim 
=2) and mesh (compressible material hence no pressure). All displacements 
are function of x and y coordinates only, i, e u = u(x,y),   v=v(x,y), and  
w = w(x,y).  Hence solution_grads_u_total tensor and  F tensor (deformation 
gradient) are 3x3 tensors with the following forms (u, v, and w are 
displacements, suffixes denote derivative; and semicolon denotes end of a 
row):

solution_grads_u_total  = [u_x,  u_y,  0;   v_x,  v_y,  0;   w_x,  w_y,  0]
F = [F_11,  F_12,  0;   F_21,  F_22,  0;F_31,   F_32,   1]

I just wanted to confirm the following things. Please correct me if there 
is a problem my approach: 

  Since my deformation grad, strain, stress tensors are 2nd rank and having 
3x3 elements,
here I define the tensors (say F_inv)  as (note that *dim = 2*)

Tensor<2, *dim+1*> F_inv;

Now in the function assemble_system_tangent_one_cell  I need to compute 
the  grad_Nx  and symm_grad_Nx
tensors which, as I understand, should also be of type  Tensor<2, *dim+1*>
Thus my point is when we compute the gradient of the shape functions using 
the piece of command in the below 
(taken from function assemble_system_tangent_one_cell) we should expect to 
get first two columns with non-zero 
entries and last column with all zero entry as we not have derivatives of 
shape functions w.r.t. x and y only (note that
the tensor has already been initialized with 0 in scratch as done in step 
44). A part of the structure ScratchData_K is
 also given in the  below.

I shall be thankful if someone tells me if my approach about solving the 
problem is correct and
if there is issue somewhere.

Thanks and regards,
Anup.


for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
  {
const Tensor<2, *dim+1*> F_inv = lqph[q_point].get_F_inv();
for (unsigned int k = 0; k < dofs_per_cell; ++k)
  {
  scratch.grad_Nx[q_point][k] = scratch.fe_values_ref[u_fe].gradient(k, 
q_point)
  * F_inv;
  scratch.symm_grad_Nx[q_point][k] = 
symmetrize(scratch.grad_Nx[q_point][k]);
  }
   }
  
//  part of the structure  Scratchdata_K 


template 
  struct Solid::ScratchData_K
  {
FEValues fe_values_ref;
std::vector >   Nx;
std::vector > >  grad_Nx;  
std::vector > > symm_grad_Nx; 

ScratchData_K(const FiniteElement &fe_cell,
  const QGauss &qf_cell,
  const UpdateFlags uf_cell)
  :
  fe_values_ref(fe_cell, qf_cell, uf_cell),
  Nx(qf_cell.size(),
 std::vector(fe_cell.dofs_per_cell)),
  grad_Nx(qf_cell.size(),
  std::vector >(fe_cell.dofs_per_cell)), 
  symm_grad_Nx(qf_cell.size(),
   std::vector >  
   (fe_cell.dofs_per_cell))
{}

   








-- 
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] problem in lower dimensional grid in higher dimensional space

2016-12-10 Thread Anup Basak
Hello all,

I am trying to solve a mechanics problem in a 2D parallelogram (reference 
body) in a 3D space. In doing so I have started with
generating grids and just want to plot it in eps file. I am expecting a 
parallelogram at z=0 surface in a 3D space.  However, when
 I execute the command write_eps I get the following error (in blue). The 
piece of the code for triangulation and save eps is in 
the below. I shall be thankful if someone can suggest what is going wrong.

Thanks,
Anup.



dim = 3;
codim = dim-1;
Triangulationtriangulation;

template   void Solid::make_grid()
{
std::vector< unsigned int > repetitions(codim, 135);
const Point bottom_left = (Point(0.0, 0.0));
const Point top_right = (Point(15.0, 45.0));

 GridGenerator::subdivided_hyper_rectangle(triangulation,
  repetitions,
  bottom_left,
  top_right);
GridTools::transform(&grid_y_transform, triangulation);
}

template 
  Point grid_y_transform (const Point &pt_in)
{
  const double &x = pt_in[0];
   double tan_theta = 0.5413861341550015;
  Point pt_out = pt_in;
  pt_out[1] += x*tan_theta;
  return pt_out;
}


template   void Solid::output_results() const
  {
 std::ofstream out ("grid-1.eps");
 GridOut grid_out;
grid_out.write_eps (triangulation, out);
  }  




An error occurred in line <3439> of file 
 in function
void dealii::internal::{anonymous}::write_eps(const 
dealii::Triangulation<2, 3>&, std::ostream&, const dealii::Mapping<2, 3>*, 
const dealii::GridOutFlags::Eps<2>&, const dealii::GridOutFlags::Eps<3>&)
The violated condition was: 
false
The name and call sequence of the exception was:
ExcNotImplemented()
 

-- 
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] constraining solution in a part of the domain

2016-11-30 Thread Anup Basak
Hello all,

I am solving a heat equation and want to constrain solution to its initial 
values only in a 
*part of the domain*, and in rest of the part want to solve the equation. I 
would be thankful if someone 
could suggest a way to do this in dealii.

Thanks and regards,
Anup.

-- 
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] what to do with Neumann term in week formulation when applying Periodic Boundary Condition

2016-11-30 Thread Anup Basak
Dear Prof. Bangerth,

Thank you very much for your reply. I got your points.

Regards,
Anup.





On Wed, Nov 30, 2016 at 4:29 PM, Wolfgang Bangerth 
wrote:

> On 11/30/2016 03:26 PM, Anup Basak wrote:
>
>>
>> Let us consider an 1D domain with periodic BC applied on both ends. Then
>> it is clear from your reply that the gradient terms have equal and
>> opposite
>> contribution in the weak form and they just vanish. In homogeneous Neumann
>> BC also these terms do not participate. However, the difference is that
>> with
>> periodic
>> BC they normal component of the gradients need not be zero. Hence my
>> question is
>> how this fact (i.e. non-zero value of normal component of gradient) is
>> being
>> ensured
>> in the case when we are applying periodic BC.
>>
>
> It's because in the periodic case, the periodicity is part of the function
> space and is enforced via constraints through the ConstraintMatrix object.
> This does not happen for homogenous Neumann conditions.
>
>
> Also, in the periodic BC implementation of dealii is this part of the BC,
>> i.e.
>> equality
>>  (with -ve sign ) of normal component of the gradients are taken care of?
>>
>
> It isn't. You only enforce that the *values* of the solution are equal.
> The equality of the gradients (and consequently the negative equality of
> the normal component) happens as a result.
>
>
> Best
>  W.
>
>
> --
> 
> 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/fo
> rum/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.
>

-- 
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] what to do with Neumann term in week formulation when applying Periodic Boundary Condition

2016-11-30 Thread Anup Basak
Dear Prof. Bangerth,

I am also solving a similar problem. But I have a query from your last
reply.

Let us consider an 1D domain with periodic BC applied on both ends. Then
it is clear from your reply that the gradient terms have equal and opposite
contribution in the weak form and they just vanish. In homogeneous Neumann
BC also these terms do not participate. However, the difference is that
with periodic
BC they normal component of the gradients need not be zero. Hence my
question is
how this fact (i.e. non-zero value of normal component of gradient) is
being ensured
in the case when we are applying periodic BC.

Also, in the periodic BC implementation of dealii is this part of the BC,
i.e. equality
 (with -ve sign ) of normal component of the gradients are taken care of?

I shall be thankful if you please clarify this point.

Thanks and regards,
Anup.











On Wed, Nov 30, 2016 at 4:06 PM, Wolfgang Bangerth 
wrote:

> On 11/30/2016 10:38 AM, Hamed Babaei wrote:
>
>>
>> I am considering Periodic Boundary Condition for a problem which is very
>> simillar to step-25. Before applying periodic condition, I considered
>> homogeneous Newmann Boundary condition in external surfaces by simply
>> omitting
>> Neumann term in week formulation (v , n.grad(u) )=0. However, since
>> Neumann BC
>> has meaning when we have external surface and now I have periodicity
>> condition, It seems I can not have both periodic and neumann BC
>> simultaneously. Therefore I am going to eliminate Neumann condition by
>> keeping
>> the term (v, n.grad(u)) in my right hand side as a generalized force term.
>>
>
> If the solution is periodic, let's say across the left and right sides of
> the domain, then you have that
>   u(left) = u(right)
>   v(left) = v(right)
>   n(left) = -n(right)
> and
>   grad(u)|_left = grad(u)|_right
>
> In other words, you have that
>   (v, n.grad(u))_{Gamma_left} = - (v, n.grad(u))_{Gamma_right}
> and consequently (if left/right are the only periodic parts of the
> boundary)
>   (v, n.grad(u))_{Gamma_periodic)
>  = (v, n.grad(u))_{Gamma_left} + (v, n.grad(u))_{Gamma_right}
>  = 0.
>
> That means that the term you have should not appear in the bilinear form.
>
> Best
>  W.
>
> --
> 
> 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/fo
> rum/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.
>

-- 
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: problem in periodic boundary condition

2016-11-29 Thread Anup Basak
Many thanks Daniel for your help.

On Tue, Nov 29, 2016 at 2:25 PM, Daniel Arndt <
d.ar...@math.uni-goettingen.de> wrote:

> Anup,
>
> Looking at the resulting mesh after using grid_y_transform, the mesh is
> still rectangular.
> Therefore, it is not surprising that make_periodicity_constraints works
> without offset, but not with:
>
> Tensor<1, dim> offset;
> offset[dim-1] = width*tan_theta*scale;
> GridTools::collect_periodic_faces(dof_handler_eta, 1, 11, 0,
> periodicity_vector1, offset);
>
> However, the above code works if you turn grid_y_transform into
>
> Point pt_out = pt_in;
> pt_out[2] += x*tan_theta;
> return pt_out;
>
> 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.
>

-- 
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: problem in periodic boundary condition

2016-11-29 Thread Anup Basak
Hello Daniel,

Please find the attached .cc file along with the .txt file. The attached 
program runs perfectly
and gives a rectangular box. Now when I want to create the parallelepiped 
by uncommenting out
the commented portions in 'grid_y_transform' and in 'system_setup' 
functions (of course the 
corresponding lines in the present file have to be commented then), I get 
the following error (in red).


/home/abasak/Desktop/Anup/dealiicodes/myprogs/adaptime_subsequent_eta/half_sample/to_Daniel/PhaseField.cc:237:84:
 
error: no matching function for call to ‘dealii::Tensor<1, 3, 
double>::Tensor(double, double, double)’
  Tensor<1, dim>(0., 0., 
width*tan_theta*scale ));


Thanks a lot.

Anup.

On Tuesday, November 29, 2016 at 10:32:36 AM UTC-6, Daniel Arndt wrote:
>
> Anup,
>
> If you provide something compilable, I can have a look. ;-)
>
> Best,
> Daniel
>
> Am Dienstag, 29. November 2016 17:22:39 UTC+1 schrieb Anup Basak:
>>
>> Hello Daniel,
>>
>> I am attaching a slightly modified version for better readability. In 
>> actual code
>> I read the values from a .prm file.
>>
>> Thanks,
>> Anup.
>>
>> On Tuesday, November 29, 2016 at 9:52:40 AM UTC-6, Anup Basak wrote:
>>>
>>> Hello Daniel,
>>>
>>> Thanks for your reply and help. I am attaching a part of the code 
>>> herewith. 
>>>
>>> Thanks and regards,
>>> Anup.
>>>
>>> On Tuesday, November 29, 2016 at 9:41:19 AM UTC-6, Daniel Arndt wrote:
>>>>
>>>> Anup,
>>>>
>>>> I am trying to implement the periodic boundary condition for a 
>>>>> nonlinear parabolic equation (scalar).
>>>>> I have considered a *parallelepiped *as shown in the attached pdf. I 
>>>>> want to impose periodic
>>>>> BC at x=0 and x=w surfaces. I have used an offset vector as appearing 
>>>>> in the piece of code 
>>>>> below, which I formed based on my understanding from the documentation 
>>>>> (it is tangential to the 
>>>>> surface x = w). Could you please tell 
>>>>> me if it is the correct expression. I think the problem is in this 
>>>>> vector only, because when I reduce the 
>>>>> angle theta to zero, it works. Boundary x =0 and x=w are numbered as 1 
>>>>> and 11, respectively.
>>>>> I also tried with the offset vector : Tensor<1, dim>(0., 0., - 
>>>>> w*tan(theta)) 
>>>>> Any suggestion and help would be appreciated. 
>>>>>
>>>>> constraints_eta1.clear();
>>>>>std::vector>>>> DoFHandler::cell_iterator> > periodicity_vector1;
>>>>>GridTools::collect_periodic_faces(dof_handler_eta, 1, 11, 0, 
>>>>> periodicity_vector1,
>>>>>  Tensor<1, dim>(0., 0., 
>>>>> w*tan(theta)));
>>>>>  
>>>>>DoFTools::make_periodicity_constraints 
>>>>> >(periodicity_vector1, constraints_eta1);
>>>>>constraints_eta1.close();
>>>>>
>>>>  That looks and sounds correct if the vertices of the bounding 
>>>> parallelepiped have the coordinates
>>>> (0|0|0), (w|0|tan(theta)*w), (0|h|0), (w|h|tan(theta)*w), (0|0|L), 
>>>> (w|0|L+tan(theta)*w), (0|h|L), (w|h|L+tan(theta)*w)
>>>>
>>>> Can you confirm that the coarse cells have the correct boundary 
>>>> indicators? Would you have a minimal code?
>>>>
>>>> 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.
##
#  CMake script for the step-44 tutorial program:
##

# Set the name of the project and target:
SET(TARGET "PhaseField")

# Declare all source files the target consists of. Here, this is only
# the one step-X.cc file, but as you expand your project you may wish
# to add other source files as well. If your project becomes much larger,
# you may want to either replace the following statement by something like
#  FILE(GLOB_RECURSE TARGET_SRC  "source/*.cc")
#  FILE(GLOB_RECURSE TARGET_INC  "includ

[deal.II] Re: problem in periodic boundary condition

2016-11-29 Thread Anup Basak
Hello Daniel,

I am attaching a slightly modified version for better readability. In 
actual code
I read the values from a .prm file.

Thanks,
Anup.

On Tuesday, November 29, 2016 at 9:52:40 AM UTC-6, Anup Basak wrote:
>
> Hello Daniel,
>
> Thanks for your reply and help. I am attaching a part of the code 
> herewith. 
>
> Thanks and regards,
> Anup.
>
> On Tuesday, November 29, 2016 at 9:41:19 AM UTC-6, Daniel Arndt wrote:
>>
>> Anup,
>>
>> I am trying to implement the periodic boundary condition for a nonlinear 
>>> parabolic equation (scalar).
>>> I have considered a *parallelepiped *as shown in the attached pdf. I 
>>> want to impose periodic
>>> BC at x=0 and x=w surfaces. I have used an offset vector as appearing in 
>>> the piece of code 
>>> below, which I formed based on my understanding from the documentation 
>>> (it is tangential to the 
>>> surface x = w). Could you please tell 
>>> me if it is the correct expression. I think the problem is in this 
>>> vector only, because when I reduce the 
>>> angle theta to zero, it works. Boundary x =0 and x=w are numbered as 1 
>>> and 11, respectively.
>>> I also tried with the offset vector : Tensor<1, dim>(0., 0., - 
>>> w*tan(theta)) 
>>> Any suggestion and help would be appreciated. 
>>>
>>> constraints_eta1.clear();
>>>std::vector>> DoFHandler::cell_iterator> > periodicity_vector1;
>>>GridTools::collect_periodic_faces(dof_handler_eta, 1, 11, 0, 
>>> periodicity_vector1,
>>>  Tensor<1, dim>(0., 0., 
>>> w*tan(theta)));
>>>  
>>>DoFTools::make_periodicity_constraints 
>>> >(periodicity_vector1, constraints_eta1);
>>>constraints_eta1.close();
>>>
>>  That looks and sounds correct if the vertices of the bounding 
>> parallelepiped have the coordinates
>> (0|0|0), (w|0|tan(theta)*w), (0|h|0), (w|h|tan(theta)*w), (0|0|L), 
>> (w|0|L+tan(theta)*w), (0|h|L), (w|h|L+tan(theta)*w)
>>
>> Can you confirm that the coarse cells have the correct boundary 
>> indicators? Would you have a minimal code?
>>
>> 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.
template 
  void Solid::run()
  {
make_grid(); 
system_setup();
}


template 
Point grid_y_transform (const Point &pt_in)
{
 double tan_theta = 0.5413861341550015;
 double length = 45;
 double width = 15;
  const double &x = pt_in[0];
  const double &z = pt_in[2];

  const double z_upper = length + tan_theta*x; 
  const double z_lower =  0.0 + tan_theta*x; 
  const double theta = z/length; 
  const double y_transform = (1-theta)*z_lower + theta*z_upper; 
  Point pt_out = pt_in;
  pt_out[2] = y_transform;
  return pt_out;
}
///
  template 
  void Solid::make_grid()
  {
double length = 45;
double width = 15;
double thickness = 1;
double scale = 1e-9;
int elements_per_edge = 135;
int elements_per_width = 45;
std::vector< unsigned int > repetitions(dim, elements_per_edge);
repetitions[dim-3] = elements_per_width;
if (dim == 3)
  repetitions[dim-2] = 1;
const Point bottom_left = (dim == 3 ? Point(0.0, -thickness, 0.0) : Point(0.0, 0.0));
const Point top_right = (dim == 3 ? Point(width, thickness,
length) :
 Point(width, length));

GridGenerator::subdivided_hyper_rectangle(triangulation, 
  repetitions,
  bottom_left,
  top_right);

   const double tol_boundary = 1e-6;
   typename Triangulation::active_cell_iterator cell =
 triangulation.begin_active(), endc = triangulation.end();
   for (; cell != endc; ++cell)
 for (unsigned int face = 0;
  face < GeometryInfo::faces_per_cell; ++face)
   if (cell->face(face)->at_boundary() == true)
   {
  if (std::abs(cell->face(face)->center()[0] - 0.0) < tol_boundary)
  cell->face(face)->set_boun

[deal.II] Re: problem in periodic boundary condition

2016-11-29 Thread Anup Basak
Hello Daniel,

Thanks for your reply and help. I am attaching a part of the code herewith. 

Thanks and regards,
Anup.

On Tuesday, November 29, 2016 at 9:41:19 AM UTC-6, Daniel Arndt wrote:
>
> Anup,
>
> I am trying to implement the periodic boundary condition for a nonlinear 
>> parabolic equation (scalar).
>> I have considered a *parallelepiped *as shown in the attached pdf. I 
>> want to impose periodic
>> BC at x=0 and x=w surfaces. I have used an offset vector as appearing in 
>> the piece of code 
>> below, which I formed based on my understanding from the documentation 
>> (it is tangential to the 
>> surface x = w). Could you please tell 
>> me if it is the correct expression. I think the problem is in this vector 
>> only, because when I reduce the 
>> angle theta to zero, it works. Boundary x =0 and x=w are numbered as 1 
>> and 11, respectively.
>> I also tried with the offset vector : Tensor<1, dim>(0., 0., - 
>> w*tan(theta)) 
>> Any suggestion and help would be appreciated. 
>>
>> constraints_eta1.clear();
>>std::vector> DoFHandler::cell_iterator> > periodicity_vector1;
>>GridTools::collect_periodic_faces(dof_handler_eta, 1, 11, 0, 
>> periodicity_vector1,
>>  Tensor<1, dim>(0., 0., 
>> w*tan(theta)));
>>  
>>DoFTools::make_periodicity_constraints 
>> >(periodicity_vector1, constraints_eta1);
>>constraints_eta1.close();
>>
>  That looks and sounds correct if the vertices of the bounding 
> parallelepiped have the coordinates
> (0|0|0), (w|0|tan(theta)*w), (0|h|0), (w|h|tan(theta)*w), (0|0|L), 
> (w|0|L+tan(theta)*w), (0|h|L), (w|h|L+tan(theta)*w)
>
> Can you confirm that the coarse cells have the correct boundary 
> indicators? Would you have a minimal code?
>
> 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.
template 
  void Solid::run()
  {
make_grid(); 
system_setup();
}


template 
Point grid_y_transform (const Point &pt_in)
{
  const double &x = pt_in[0];
  const double &z = pt_in[2];

  const double z_upper = 45.0 + 0.5413861341550015*x; 
  const double z_lower =  0.0 + 0.5413861341550015*x; 
  const double theta = z/45.0; 
  const double y_transform = (1-theta)*z_lower + theta*z_upper; 
  Point pt_out = pt_in;
  pt_out[2] = y_transform;
  return pt_out;
}
///
  template 
  void Solid::make_grid()
  {
std::vector< unsigned int > repetitions(dim, parameters.elements_per_edge);
repetitions[dim-3] = parameters.elements_per_width;
if (dim == 3)
  repetitions[dim-2] = 1;
const Point bottom_left = (dim == 3 ? Point(0.0, -parameters.thickness, 0.0) : Point(0.0, 0.0));
const Point top_right = (dim == 3 ? Point(parameters.width, parameters.thickness,
parameters.length) :
 Point(parameters.width, parameters.length));

GridGenerator::subdivided_hyper_rectangle(triangulation, 
  repetitions,
  bottom_left,
  top_right);

   const double tol_boundary = 1e-6;
   typename Triangulation::active_cell_iterator cell =
 triangulation.begin_active(), endc = triangulation.end();
   for (; cell != endc; ++cell)
 for (unsigned int face = 0;
  face < GeometryInfo::faces_per_cell; ++face)
   if (cell->face(face)->at_boundary() == true)
   {
  if (std::abs(cell->face(face)->center()[0] - 0.0) < tol_boundary)
  cell->face(face)->set_boundary_id(1); 
 else if (std::abs(cell->face(face)->center()[0] - parameters.width) < tol_boundary)
   cell->face(face)->set_boundary_id(11); 
 
   }

GridTools::transform(&grid_y_transform, triangulation);
GridTools::scale(parameters.scale, triangulation);
  
  }
/

  template 
  void Solid::system_setup()
  {

dof_handler_eta.distribute_dofs (fe_eta);
const unsigned int n_dofs_eta = dof_handler_eta.n_dofs();

   constraints_eta1.clear();
   std::vector::cell_iterator> > periodicity_vector1;
   GridTools::collect_periodic_faces(dof_handler_eta, 1, 11, 0, periodicity_vector1,
 Tensor<1, dim>(0., 0., 0.5413861341550015*parameters.width*1e-9));
 
   DoFTools::make_periodicity_constraints >(periodicity_vect

[deal.II] problem in periodic boundary condition

2016-11-28 Thread Anup Basak
Dear all,

I am trying to implement the periodic boundary condition for a nonlinear 
parabolic equation (scalar).
I have considered a *parallelepiped *as shown in the attached pdf. I want 
to impose periodic
BC at x=0 and x=w surfaces. I have used an offset vector as appearing in 
the piece of code 
below, which I formed based on my understanding from the documentation (it 
is tangential to the 
surface x = w). Could you please tell 
me if it is the correct expression. I think the problem is in this vector 
only, because when I reduce the 
angle theta to zero, it works. Boundary x =0 and x=w are numbered as 1 and 
11, respectively.
I also tried with the offset vector : Tensor<1, dim>(0., 0., - w*tan(theta)) 
Any suggestion and help would be appreciated. 

constraints_eta1.clear();
   std::vector::cell_iterator> > periodicity_vector1;
   GridTools::collect_periodic_faces(dof_handler_eta, 1, 11, 0, 
periodicity_vector1,
 Tensor<1, dim>(0., 0., w*tan(theta)));
 
   DoFTools::make_periodicity_constraints 
>(periodicity_vector1, constraints_eta1);
   constraints_eta1.close();


Thanks and regards,
Anup.

-- 
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.


box.pdf
Description: Adobe PDF document


[deal.II] a small issue with step44

2016-11-16 Thread Anup Basak
Dear developers,

I see a small issue in function 'solve_nonlinear_timestep(
BlockVector 
 
&solution_delta)' of step44.
If the 'for' loop corresponding to the Newton iteration is considered in 
its present form, the exception in the end of
this function will never be thrown, because 'newton_iteration' will never 
exceed 'parameters.max_iterations_NR'.
Hence I think in the 'for' statement '<=' should be considered instead of 
'<', i.e,

for ( ; newton_iteration <= parameters.max_iterations_NR; 
++newton_iteration)

Thank you,

Regards,
Anup.

-- 
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] condition number

2016-11-15 Thread Anup Basak
Hello all,

I wanted to know the condition number of my system_matrix and hence I have 
used the line in blue (below) in my CG solve function.
It shows the condition number. But in the documentation the definition of 
this is not mentioned. I mean when I store
my system matrix and calculate its max and min eigenvalues in matlab and 
then calculate the condition number as their ratio 
(i.e, max_eigen_val/ min_eigen_val), this does not match with the one 
calculated by connect_condition_number_slot.
The quantities differ by two order of magnitudes. 

I shall be thankful if someone puts some light on this.

   cg.connect_condition_number_slot(std_cxx11::bind(&Solid::print_cond, 
this, std_cxx11::_1));

Thanks,
Anup.

-- 
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: Question about Step 44 shape function gradient computations

2016-11-09 Thread Anup Basak
Hi all,

The attached pdf might be useful. There is some notational difference from
step44, but it is defined here.

Thanks,
Anup

On Wed, Nov 9, 2016 at 12:41 PM, Andrew McBride 
wrote:

> Dear Claire
>
> You might also be interested in the one-field version of step-44 in the
> code gallery https://dealii.org/developer/doxygen/deal.II/
> code_gallery_Quasi_static_Finite_strain_Compressible_Elasticity.html
>
> A
>
> On 9 Nov 2016, at 18:24, Claire  wrote:
>
> Dear Wolfgang and Jean-Paul,
>
> I will try to do my best to produce the document and give a contribution
> (even small) to the library.
> I am not sure when exactly I will be able to have time to make it though...
> The problem that I personally try to solve is simpler and does not require
> a three field formulation... I actually ask the question in the first place
> to satisfy my curiosity!
> However I'll be glad to think about it, it will certainly be a good way to
> practice and improve my derivation skills.
> But in that case I will accept your offer Jean-Paul, I will for sure use a
> documented derivation.
>
> Thank you very much by advance,
>
> Best,
>
> Claire
>
> Le mardi 8 novembre 2016 15:55:10 UTC+1, Wolfgang Bangerth a écrit :
>>
>> On 11/08/2016 01:36 AM, Jean-Paul Pelteret wrote:
>> >
>> > You're welcome. If you go through the formulation and still don't have
>> full
>> > clarity, then let me know. I do have this derivation documented
>> somewhere...
>>
>> Claire -- If, on the other hand, you do figure it out, write it up into a
>> one-page latex document that we'll be happy to help you convert into
>> something
>> we could add to the documentation of that tutorial program! If this issue
>> wasn't clear to you, it's likely also not going to be clear to others.
>>
>> Cheers
>>   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.
>
>
> --
> 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.
>

-- 
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.


largeStrain_Anup.pdf
Description: Adobe PDF document


Re: [deal.II] Re: using .vtk file as initial condition

2016-11-08 Thread Anup Basak
Hello all,

It seems that using block_write() and block_read would be easier to store 
data and reuse them 
as initial conditions on identical geometry and mesh compared to using 
boost:serialization. However,
I have some issues and quires (I do not use parallelization in my code). I 
shall be thankful if someone
clarifies the following things:

(i) Suppose I want to store my 'Solution' vector to the zeroth block of a 
BlockVector 'solution_save'.
For that I have used the following command (in blue) and I get error (in 
red). It seems that the first
line is not the correct way to store vectors in the block. Can you please 
let me know the correct command?

solution_save.block(0) = solution;
std::ofstream output_text("data.txt");
solution_save.block_write(output_text);

/home/abasak/Desktop/Anup/dealiicodes/myprogs/junks/step-26/step-26.cc:338:28: 
error: no match for ‘operator=’ (operand types are ‘const BlockType {aka 
const dealii::Vector}’ and ‘const dealii::Vector’)
 solution_save.block(0) = solution;

2. I am solving mechanics problem. So I need to store the stress and strain 
tensors at each node as well. I was wondering if it is possible to store
the tensors somehow. One possibility could be, I think, to store all nine 
(here six) components in different blocks and reunite them while reading. 
But is there a smarter way to store tensors?

3. Also, I must save the triangulation and all nodal and element 
information. How to go about it?

Many thanks,

Regards,
Anup.






On Monday, November 7, 2016 at 7:31:08 PM UTC-6, Wolfgang Bangerth wrote:
>
> On 11/07/2016 06:11 PM, Anup Basak wrote: 
> > 
> > It seems that to work with load() and save() one needs to work with 
> boost 
> > packages. 
> > I was wondering if it is already inbuilt in dealii packages or I need to 
> > install boost and build it 
> > separately. 
>
> It's all there already, ready for you to use :-) 
> 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: using .vtk file as initial condition

2016-11-07 Thread Anup Basak
Hello all,

It seems that to work with load() and save() one needs to work with boost
packages.
I was wondering if it is already inbuilt in dealii packages or I need to
install boost and build it
separately.

Thanks,
Anup.

On Mon, Nov 7, 2016 at 8:39 AM, Anup Basak  wrote:

> Thank you Jean-Paul and Prof. Bangerth for the references. I will work on
> it now.
>
> Regards,
> Anup.
>
>
> On Tuesday, October 11, 2016 at 5:59:49 PM UTC-5, Anup Basak wrote:
>>
>> Dear all,
>>
>> I have a solution saved in two .vtk files for a mechanics problem
>> (displacement, stress, strain, temperature etc.
>> at the nodal points). Now let us say I want to use this as initial
>> conditions for another problem (the domain,
>> boundary conditions, and meshes are identical for both the problems).
>> Could anyone please suggest that
>> how should I implement it.
>>
>> Thanks,
>> Anup.
>>
> --
> 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.
>

-- 
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: using .vtk file as initial condition

2016-11-07 Thread Anup Basak
Thank you Jean-Paul and Prof. Bangerth for the references. I will work on 
it now.

Regards,
Anup.

On Tuesday, October 11, 2016 at 5:59:49 PM UTC-5, Anup Basak wrote:
>
> Dear all,
>
> I have a solution saved in two .vtk files for a mechanics problem 
> (displacement, stress, strain, temperature etc.
> at the nodal points). Now let us say I want to use this as initial 
> conditions for another problem (the domain, 
> boundary conditions, and meshes are identical for both the problems). 
> Could anyone please suggest that 
> how should I implement it.
>
> Thanks,
> Anup.
>

-- 
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: using .vtk file as initial condition

2016-11-06 Thread Anup Basak
Hello all,

I shall be thankful if someone could tell me in details how to use 'save()' 
and 'load()' functions to save and load 
triangulation information and the nodal values of displacements, strains, 
stresses, and may be temperature
(similar to step44) so that they can be used as initial data in another 
simulations with the identical triangulation data.

Or if there is some other simpler way.

Thanks and regards,
Anup.

On Tuesday, November 1, 2016 at 6:23:09 PM UTC-5, Anup Basak wrote:
>
> Dear Jean-Paul and Timo,
>
> Thank you very much for your reply. 
>
> I would like to use 'save ()' and 'load() ' functions as both of you 
> suggested, but it is not
> fully clear to me how should they be used in the dealii code (I am using a 
> code similar to step-44
> large deformation problem). Suppose I need  to save all the trangulation 
> information and 
> data like displacements, stresses, strains, etc. and use them as initial 
> data on the saved
>  geometry.
>
> It would be very helpful if you kindly explain little elaborately and tell 
> me if any of the examples
> has used this idea (or some other reference).
>
> Thanks a lot.
>
> Regards,
> Anup.
>
>
>
>
> On Fri, Oct 14, 2016 at 1:51 PM, Timo Heister  wrote:
>
>> .vtk files are visualization output, which always involves some loss
>> of information (for example we interpolate linearly to the vertices of
>> each cell by default), so therefore it is
>> complicated/inaccurate/undesirable to reconstruct a finite element
>> solution vector from it. This is the reason nobody has implemented
>> this inside deal.II so far. You should consider storing the finite
>> element solution and read that back in or do what J-P suggests.
>>
>> On Wed, Oct 12, 2016 at 2:29 AM, Jean-Paul Pelteret
>>  wrote:
>> > Dear Anup.
>> >
>> > I notice that this question has been asked before, but remains without 
>> an
>> > answer. I'm not sure that this is possible - so far, save and load 
>> functions
>> > only read/write to boost archive data structures. You're probably 
>> better off
>> > investigating using these functions instead of a VTK file. That being 
>> said,
>> > if its an ASCII VTK file then it wouldn't be too difficult it wouldn't 
>> be
>> > too difficult to implement such functionality. But things could get 
>> tricky
>> > if you are using parallel data structures.
>> >
>> > Regards,
>> > J-P
>> >
>> >
>> > On Wednesday, October 12, 2016 at 12:59:49 AM UTC+2, Anup Basak wrote:
>> >>
>> >> Dear all,
>> >>
>> >> I have a solution saved in two .vtk files for a mechanics problem
>> >> (displacement, stress, strain, temperature etc.
>> >> at the nodal points). Now let us say I want to use this as initial
>> >> conditions for another problem (the domain,
>> >> boundary conditions, and meshes are identical for both the problems).
>> >> Could anyone please suggest that
>> >> how should I implement it.
>> >>
>> >> Thanks,
>> >> Anup.
>> >
>> > --
>> > The deal.II project is located at 
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dealii.org_&d=CwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=ItwOC0neOpqcosvpqST2azKxUqBCeihSaE71KljSX5k&s=utGxqw4FA4GTJrqTHK-pMzDeWHX906ycL5y2BTDm5VU&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=CwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=ItwOC0neOpqcosvpqST2azKxUqBCeihSaE71KljSX5k&s=NvnyBWAmMqXf1ji8zz6NQ9zrD-5tM-0RXGWHuI48rWQ&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=CwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=ItwOC0neOpqcosvpqST2azKxUqBCeihSaE71KljSX5k&s=Cdt_SsJ9xS_vt6t8lyvpIFqOUHyn-imvC7IVOeNoZJs&e=
>>  
>> .
>>
>>
>>
>> --
>> Timo Heister
>> http:

Re: [deal.II] Re: using .vtk file as initial condition

2016-11-01 Thread Anup Basak
Dear Jean-Paul and Timo,

Thank you very much for your reply.

I would like to use 'save ()' and 'load() ' functions as both of you
suggested, but it is not
fully clear to me how should they be used in the dealii code (I am using a
code similar to step-44
large deformation problem). Suppose I need  to save all the trangulation
information and
data like displacements, stresses, strains, etc. and use them as initial
data on the saved
 geometry.

It would be very helpful if you kindly explain little elaborately and tell
me if any of the examples
has used this idea (or some other reference).

Thanks a lot.

Regards,
Anup.




On Fri, Oct 14, 2016 at 1:51 PM, Timo Heister  wrote:

> .vtk files are visualization output, which always involves some loss
> of information (for example we interpolate linearly to the vertices of
> each cell by default), so therefore it is
> complicated/inaccurate/undesirable to reconstruct a finite element
> solution vector from it. This is the reason nobody has implemented
> this inside deal.II so far. You should consider storing the finite
> element solution and read that back in or do what J-P suggests.
>
> On Wed, Oct 12, 2016 at 2:29 AM, Jean-Paul Pelteret
>  wrote:
> > Dear Anup.
> >
> > I notice that this question has been asked before, but remains without an
> > answer. I'm not sure that this is possible - so far, save and load
> functions
> > only read/write to boost archive data structures. You're probably better
> off
> > investigating using these functions instead of a VTK file. That being
> said,
> > if its an ASCII VTK file then it wouldn't be too difficult it wouldn't be
> > too difficult to implement such functionality. But things could get
> tricky
> > if you are using parallel data structures.
> >
> > Regards,
> > J-P
> >
> >
> > On Wednesday, October 12, 2016 at 12:59:49 AM UTC+2, Anup Basak wrote:
> >>
> >> Dear all,
> >>
> >> I have a solution saved in two .vtk files for a mechanics problem
> >> (displacement, stress, strain, temperature etc.
> >> at the nodal points). Now let us say I want to use this as initial
> >> conditions for another problem (the domain,
> >> boundary conditions, and meshes are identical for both the problems).
> >> Could anyone please suggest that
> >> how should I implement it.
> >>
> >> Thanks,
> >> Anup.
> >
> > --
> > The deal.II project is located at https://urldefense.proofpoint.
> com/v2/url?u=http-3A__www.dealii.org_&d=CwIBaQ&c=Ngd-
> ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmE
> jX38S7JmlS9Vw&m=ItwOC0neOpqcosvpqST2azKxUqBCeihSaE71KljSX5k&s=
> utGxqw4FA4GTJrqTHK-pMzDeWHX906ycL5y2BTDm5VU&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=CwIBaQ&c=Ngd-
> ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmE
> jX38S7JmlS9Vw&m=ItwOC0neOpqcosvpqST2azKxUqBCeihSaE71KljSX5k&s=
> NvnyBWAmMqXf1ji8zz6NQ9zrD-5tM-0RXGWHuI48rWQ&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=CwIBaQ&c=Ngd-
> ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmE
> jX38S7JmlS9Vw&m=ItwOC0neOpqcosvpqST2azKxUqBCeihSaE71KljSX5k&s=Cdt_SsJ9xS_
> vt6t8lyvpIFqOUHyn-imvC7IVOeNoZJs&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.
>

-- 
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] plane strain proble

2016-10-24 Thread Anup Basak
Hello all,

I was wondering if there is plane strain element (generalized) in dealii, 
i.e. the domain will be 2D whereas
the displacement will have all three components and the stress and strain 
tensors will be 3x3. In my case
it would be similar to step 44 (but compressible) with finite strain 
components.

Thanking you,

Anup. 

-- 
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] using .vtk file as initial condition

2016-10-11 Thread Anup Basak
Dear all,

I have a solution saved in two .vtk files for a mechanics problem 
(displacement, stress, strain, temperature etc.
at the nodal points). Now let us say I want to use this as initial 
conditions for another problem (the domain, 
boundary conditions, and meshes are identical for both the problems). Could 
anyone please suggest that 
how should I implement it.

Thanks,
Anup.

-- 
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: variable time step in step44

2016-09-03 Thread Anup Basak
Dear Jean-Paul,

Thank you for your reply.

I, in fact, have done that way only. I have defined the initial time step
through .prm file. Now my question is that
after I update my time step in the run() function how can I pass this new
time step, say 'delta_t' to the class 'Time'
to obtain other parameters like current_time etc.

Thanks and regards,
Anup.

On Wed, Aug 31, 2016 at 12:27 AM, Jean-Paul Pelteret 
wrote:

> Dear Anup,
>
> Why don't you reinterpret the parameter passed as "delta_t" to be the
> initial timestep size "delta_t_0" and then adjust the current timestep size
> "delta_t" however you want? How you do this adjustment algorithm-wise is,
> of course, entirely up to you.
>
> Regards,
> J-P
>
>
> On Tuesday, August 30, 2016 at 7:02:41 PM UTC+2, Anup Basak wrote:
>>
>> Hello all,
>>
>> I was trying to implement an adaptive time step in step44. In the given
>> example 'delta_t' has been considered to be
>> fixed and its value is taken from the .prm file. Now let us say one
>> changes the value of 'delta_t' in the function 'run()'.
>> What will be the convenient way to replace old value of 'delta_t' by the
>> new one and use it to obtain current time etc
>> using the class 'Time'.
>>
>> I shall be thankful if someone can help me in this regard.
>>
>> Thank you,
>>
>> Regards,
>> Anup.
>>
> --
> 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.
>

-- 
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] variable time step in step44

2016-08-30 Thread Anup Basak
Hello all,

I was trying to implement an adaptive time step in step44. In the given 
example 'delta_t' has been considered to be
fixed and its value is taken from the .prm file. Now let us say one changes 
the value of 'delta_t' in the function 'run()'.
What will be the convenient way to replace old value of 'delta_t' by the 
new one and use it to obtain current time etc
using the class 'Time'.

I shall be thankful if someone can help me in this regard.

Thank you,

Regards,
Anup.

-- 
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] problem applying Dirichlet boundary condition

2016-07-28 Thread Anup Basak
Dear All,

I am solving a mechanics problem based on the finite strain problem in Step 
44.
I need to apply non-zero Dirichlet boundary condition for displacement in
one of the outer boundary of a square 2D domain. I have considered a class 
called
'IncrementalBoundaryValues' (a part of the code given in the below in 
blue)  to define the 
boundary conditions and added a few lines in the function 'make_constraint' 
(also given 
below in green).  Whenever I consider 'values(0)'  (defined in class 
'IncrementalBoundaryValues')
to be some non-zero value I get the error massage as given below (in red).  
The rest of the
 code related to the Constraint_Matrix is similar to step 44.

I shall be thankful if someone could tell me what is going wrong here.

Thanks and regards,
Anup.

void 
PhaseField::Material_Compressible_Neo_Hook_Three_Field::update_material_data(const
 
dealii::Tensor<2, dim>&, const dealii::Tensor<2, dim>&, double, double, 
double, double, double, double, double, double) [with int dim = 2]
The violated condition was: 
det_F > 0
The name and call sequence of the exception was:
ExcInternalError()



template 
  class IncrementalBoundaryValues :  public Function
  {
  public:
IncrementalBoundaryValues (const double length, const 
double applied_strain);
virtual
void
vector_value (const Point &p,
  Vector   &values) const;
virtual
void
vector_value_list (const std::vector > 
&points,
   std::vector >   
&value_list) const;
  private:
const double length;
const double applied_strain;

  };
  template 
  IncrementalBoundaryValues::
  IncrementalBoundaryValues (const double length, const 
double applied_strain)
:
Function (dim),
length (length),
applied_strain (applied_strain)
  {}

  template 
  void
  IncrementalBoundaryValues::
  vector_value (const Point &/*p*/,
Vector   &values) const
  {
Assert (values.size() == dim,
ExcDimensionMismatch (values.size(), dim));
values = 0;
values(0) = length * applied_strain;
  }
  template 
  void
  IncrementalBoundaryValues::
  vector_value_list (const std::vector > &points,
 std::vector >   
&value_list) const
  {
const unsigned int n_points = points.size();
Assert (value_list.size() == n_points,
ExcDimensionMismatch (value_list.size(), 
n_points));
for (unsigned int p=0; p::vector_value 
(points[p],

value_list[p]);
  }



template 
  void Solid::make_constraints(const int &it_nr)
  {
std::cout << " CST " << std::flush;

if (it_nr > 1)
  return;
constraints.clear();
const bool apply_dirichlet_bc = (it_nr == 0);
const FEValuesExtractors::Scalar x_displacement(0);
const FEValuesExtractors::Scalar y_displacement(1);

if (dim == 3)
const FEValuesExtractors::Scalar z_displacement(2);
{
  const int boundary_id = 1;

  if (apply_dirichlet_bc == true)
VectorTools::interpolate_boundary_values(dof_handler_ref,
 boundary_id,
 
ZeroFunction(n_components),
 constraints,
 
fe.component_mask(x_displacement)|
 
fe.component_mask(y_displacement));
  else
VectorTools::interpolate_boundary_values(dof_handler_ref,
 boundary_id,
 
ZeroFunction(n_components),
 constraints,
 
fe.component_mask(x_displacement)|
 
fe.component_mask(y_displacement));
}

















*{  const int boundary_id = 11;  if (apply_dirichlet_bc == 
true)  VectorTools::interpolate_boundary_values 
(dof_handler_ref,   
boundary_id,   
IncrementalBoundaryValues(parameters.length,   
 

[deal.II] Dirichlet constraint to a specific node

2016-07-15 Thread Anup Basak
Hello,

I have a vector valued (say, displacement) problem and I want to apply 
Dirichlet boundary condition
corresponding to one component of the displacement vector to a single node 
(whose position is know)
on a boundary.

I shall be thankful if someone can  tell me how can I implement it in 
dealii.

Thank you,

Anup.

-- 
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] store data of specific nodes

2016-07-13 Thread Anup Basak
Hello all,

I want to store the solution data corresponding to the nodes within a 
specific part of the domain.
If anyone has idea how it can be done, kindly let me know. 

Thanks in advance,

Regards,
Anup.

-- 
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: introduce random initial condition

2016-07-05 Thread Anup Basak
Hello Bruno,

Thank you very much for your reply. But my question is that is there any
function in dealii
through which I can generate random numbers within a range at the nodal
points.

Thanks and regards,
Anup.

On Tue, Jul 5, 2016 at 7:13 PM, Bruno Turcksin 
wrote:

> Anup,
>
> I assume that your solution at time t_1 depends on the solution at time
> t_0. If you use Lagrangian FE, you just need to fill your vector solution
> at t_0 with random values between T_0 and T_1.
>
> Best,
>
> Bruno
>
>
> On Tuesday, July 5, 2016 at 6:02:32 PM UTC-4, Anup Basak wrote:
>>
>> Dear All,
>>
>> I am solving a heat conduction equation and want to impose random
>> distribution of
>> temperature, say between T_0 to T_1, as an initial condition over the
>> entire domain.
>>  I shall be thankful if someone can tell me how to introduce in dealii.
>>
>> Thanks and regards,
>> Anup.
>>
> --
> 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.
>

-- 
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] introduce random initial condition

2016-07-05 Thread Anup Basak
Dear All,

I am solving a heat conduction equation and want to impose random 
distribution of 
temperature, say between T_0 to T_1, as an initial condition over the 
entire domain.
 I shall be thankful if someone can tell me how to introduce in dealii.

Thanks and regards,
Anup. 

-- 
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: casting a 4th order symm tensor to Tensor

2016-06-14 Thread Anup Basak
Hello Jean,

Thanks for the reply. Yes, I have already done what you suggested. But I
think that casting operation should be incorporated.

Many thanks,

Regards,
Anup.

On Tue, Jun 14, 2016 at 12:22 AM, Jean-Paul Pelteret 
wrote:

> Hi Anup,
>
> It looks like there's no constructor from which one can create a rank 4
> tensor from a rank 4 symmetric tensor, nor an assignment operator. I've
> opened up an issue on GitHub here
> <https://github.com/dealii/dealii/issues/2679>. It looks like you'll just
> have to copy out the entries manually for now.
>
> J-P
>
>
> On Tuesday, June 14, 2016 at 1:07:56 AM UTC+2, Anup Basak wrote:
>>
>> Hello all,
>>
>> I want to cast a 4th order SymmetricTensor<4, dim> to a Tensor<4, dim>
>> and have used the following command:
>>
>> Tensor<4, dim> tens = Tensor<4, dim>(StandardTensors::II);
>>
>> where StandardTensors::II is the fourth order symmetric unit tensor
>> defined in
>> StandardTensors class (same as that defined in Step 44). However, I get
>> error saying that
>>
>> cannot convert ‘const value_type {aka const dealii::Tensor<1, 6,
>> double>}’ to ‘double’ in assignment
>>  t[d][d] = data[d];
>>
>> I shall be thankful if someone can point out where it is going wrong.
>>
>> Thanks and regards,
>> Anup.
>>
> --
> 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.
>

-- 
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: tensor contraction problem

2016-06-13 Thread Anup Basak
Hi Jean

I have installed version 8.4 and it seems that the contract<0,1>(Tensor<2, 
dim>, Tensor<2, dim> ) is working.

Thanks,
Anup.

On Monday, June 13, 2016 at 1:15:33 AM UTC-5, Jean-Paul Pelteret wrote:
>
> Hi Anup,
>
> One must always be conscientious of the fact that different functionality 
> exists between different versions of deal.II. Between versions 8.3 and 8.4 
> the tensor class was updated, so the contract functions that I suggested to 
> you previously don't exist in your installed version of deal.II.
>
> Here's a link to the online documentation for deal.II 8.3
> https://www.dealii.org/8.3.0/index.html
> and the tensor class
> https://www.dealii.org/8.3.0/doxygen/deal.II/classTensor.html
>
> I'm sure that a quick look there will help you get to the solution that 
> you're looking for. For future reference, to find the documentation for 
> older versions of deal.II, you navigate to the home page, click the "All 
> versions" button at the top of the screen and go from there.
>
> J-P
>
> On Monday, June 13, 2016 at 12:57:27 AM UTC+2, Anup Basak wrote:
>>
>> Hi Jean,
>>
>> Thanks for your reply. I am using version 8.3.0 and installed in 
>> February, 2016.
>> Do you think in this version the problem is expected?
>>
>> Thanks,
>>
>> Anup.
>>
>> On Sun, Jun 12, 2016 at 5:05 PM, Jean-Paul Pelteret <> wrote:
>>
>>> Hi Anup,
>>>
>>> What version of deal.II are you using? In the documentation for version 
>>> 8.4.0 such a function certainly exists 
>>> <https://www.dealii.org/8.4.0/doxygen/deal.II/classTensor.html#a0923600f30b498c743cbef3d2eab4993>
>>> .
>>>
>>> Anyway, in this case its probably unnecessary to explicitly specify the 
>>> contraction indices. Since its just the inner indices that are summed over, 
>>> you can use the * operator 
>>> <https://www.dealii.org/8.4.0/doxygen/deal.II/classTensor.html#acff14b5a87224a20eb287ed06017c80f>
>>> .
>>> Tensor<2, dim> A = Tensor<2, dim>(B)*Tensor<2, dim>(C);
>>> or, if you think its sensible,
>>> SymmetricTensor<2, dim> A = symmetrize(Tensor<2, dim>(B)*Tensor<2, 
>>> dim>(C));
>>>
>>> J-P
>>>
>>>
>>> On Sunday, June 12, 2016 at 10:59:30 PM UTC+2, Anup Basak wrote:
>>>>
>>>> Hello all,
>>>>
>>>> I am trying to calculate the following tensor multiplication (I am 
>>>> using dealii 8.3.0. and installed in February, 2016):
>>>>
>>>> A_{ij} =  B_{ik} C_{kj}
>>>>
>>>> where B and C are both symmetric tensors.  Since using  B*C would lead 
>>>> to a scalar, I am trying to calculate using
>>>> 'contract' command. For that I have at first cast the tensors B and C 
>>>> into Tensor<2,dim>. The command I have used
>>>> is the following:
>>>>
>>>> Tensor<2, dim> A = contract<1, 0>(Tensor<2, dim>(B), Tensor<2, dim>(C));
>>>>
>>>> However, I get the following error massage (in blue)
>>>>
>>>> no matching function for call to ‘contract(dealii::Tensor<2, 3, 
>>>> double>, dealii::Tensor<2, 3, double>)’
>>>> Tensor<2, dim> A = contract<1, 0>(Tensor<2, dim>(B), Tensor<2, 
>>>> dim>(C));
>>>>
>>>> Can anyone tell me where it is going wrong.
>>>>
>>>> Thanks and regards,
>>>> Anup.
>>>>
>>> -- 
>>> 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+un...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
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] casting a 4th order symm tensor to Tensor

2016-06-13 Thread Anup Basak
Hello all,

I want to cast a 4th order SymmetricTensor<4, dim> to a Tensor<4, dim> and 
have used the following command:

Tensor<4, dim> tens = Tensor<4, dim>(StandardTensors::II);

where StandardTensors::II is the fourth order symmetric unit tensor 
defined in 
StandardTensors class (same as that defined in Step 44). However, I get 
error saying that

cannot convert ‘const value_type {aka const dealii::Tensor<1, 6, double>}’ 
to ‘double’ in assignment
 t[d][d] = data[d];

I shall be thankful if someone can point out where it is going wrong.

Thanks and regards,
Anup.

-- 
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: tensor contraction problem

2016-06-12 Thread Anup Basak
Hi Jean,

Thanks for your reply. I am using version 8.3.0 and installed in February,
2016.
Do you think in this version the problem is expected?

Thanks,

Anup.

On Sun, Jun 12, 2016 at 5:05 PM, Jean-Paul Pelteret 
wrote:

> Hi Anup,
>
> What version of deal.II are you using? In the documentation for version
> 8.4.0 such a function certainly exists
> <https://www.dealii.org/8.4.0/doxygen/deal.II/classTensor.html#a0923600f30b498c743cbef3d2eab4993>
> .
>
> Anyway, in this case its probably unnecessary to explicitly specify the
> contraction indices. Since its just the inner indices that are summed over,
> you can use the * operator
> <https://www.dealii.org/8.4.0/doxygen/deal.II/classTensor.html#acff14b5a87224a20eb287ed06017c80f>
> .
> Tensor<2, dim> A = Tensor<2, dim>(B)*Tensor<2, dim>(C);
> or, if you think its sensible,
> SymmetricTensor<2, dim> A = symmetrize(Tensor<2, dim>(B)*Tensor<2,
> dim>(C));
>
> J-P
>
>
> On Sunday, June 12, 2016 at 10:59:30 PM UTC+2, Anup Basak wrote:
>>
>> Hello all,
>>
>> I am trying to calculate the following tensor multiplication (I am using
>> dealii 8.3.0. and installed in February, 2016):
>>
>> A_{ij} =  B_{ik} C_{kj}
>>
>> where B and C are both symmetric tensors.  Since using  B*C would lead to
>> a scalar, I am trying to calculate using
>> 'contract' command. For that I have at first cast the tensors B and C
>> into Tensor<2,dim>. The command I have used
>> is the following:
>>
>> Tensor<2, dim> A = contract<1, 0>(Tensor<2, dim>(B), Tensor<2, dim>(C));
>>
>> However, I get the following error massage (in blue)
>>
>> no matching function for call to ‘contract(dealii::Tensor<2, 3, double>,
>> dealii::Tensor<2, 3, double>)’
>> Tensor<2, dim> A = contract<1, 0>(Tensor<2, dim>(B), Tensor<2,
>> dim>(C));
>>
>> Can anyone tell me where it is going wrong.
>>
>> Thanks and regards,
>> Anup.
>>
> --
> 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.
>

-- 
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] tensor contraction problem

2016-06-12 Thread Anup Basak
Hello all,

I am trying to calculate the following tensor multiplication (I am using 
dealii 8.3.0. and installed in February, 2016):

A_{ij} =  B_{ik} C_{kj}

where B and C are both symmetric tensors.  Since using  B*C would lead to a 
scalar, I am trying to calculate using
'contract' command. For that I have at first cast the tensors B and C into 
Tensor<2,dim>. The command I have used
is the following:

Tensor<2, dim> A = contract<1, 0>(Tensor<2, dim>(B), Tensor<2, dim>(C));

However, I get the following error massage (in blue)

no matching function for call to ‘contract(dealii::Tensor<2, 3, double>, 
dealii::Tensor<2, 3, double>)’
Tensor<2, dim> A = contract<1, 0>(Tensor<2, dim>(B), Tensor<2, 
dim>(C));

Can anyone tell me where it is going wrong.

Thanks and regards,
Anup.

-- 
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: tensor product and polar decomposition

2016-06-11 Thread Anup Basak
Many thanks Jean.

On Sat, Jun 11, 2016 at 1:05 AM, Jean-Paul Pelteret 
wrote:

> Hi Anup,
>
> No, the contraction rule is not the same. If you click on the link that I
> provided then you'll see that when the LHS type and RHS type are both
> symmetric tensors then it performs a double contraction. Although I thought
> that there was a generic contraction operation implemented for
> SymmetricTensors, this actually appears not to be the case (from what I can
> see in the docs). To perform a single contraction with SymmetricTensors you
> could then first cast them to normal tensors and perform the contraction as
> you wish.
>
> J-P
>
> On Friday, June 10, 2016 at 9:51:23 PM UTC+2, Anup Basak wrote:
>>
>> Hello Jean-Paul,
>>
>> Thank you very much for the reply. I got your point. Now I have a small
>> query. In
>> the first link provided by you for single contraction I see that the
>> contraction rule
>> is given for 'Tensors'. I think the same contraction rules applies for
>> two 'SymmetricTensors'
>> as well, am I right?
>>
>> Thank you very much,
>>
>> Regards,
>> Anup.
>>
>> On Fri, Jun 10, 2016 at 1:36 PM, Jean-Paul Pelteret <> wrote:
>>
>>> For the first question, if the tensors are of type Tensor then
>>> the * operator does a contraction over a single index
>>> <https://www.dealii.org/8.4.0/doxygen/deal.II/classTensor.html#acff14b5a87224a20eb287ed06017c80f>.
>>> If the tensors are of type SymmetricTensor, then the * operator
>>> will perform a contraction over two indices
>>> <https://www.dealii.org/8.4.0/doxygen/deal.II/classSymmetricTensor.html#a3586fe5da69c834e642026d1dc310c65>.
>>> If you need finer control over which indices are summed over, then both
>>> classes offer such options though the contract and double_contract
>>> functions.
>>>
>>>
>>> On Friday, June 10, 2016 at 6:18:20 PM UTC+2, Anup Basak wrote:
>>>>
>>>> Hello all,
>>>>
>>>> I have two quires regarding tensor product and polar decomposition.
>>>>
>>>> 1. Suppose I want to multiply two second order tensors with a fourth
>>>> order tensor to get a forth order tensor as follows:
>>>>
>>>> A_{ijkl} = B_{im} C_{mjkn} D_{nl}.
>>>>
>>>> It is clear that we have a single index contraction with B and C, and
>>>> with C and D. If I use the command  in the code
>>>>
>>>> A = B* C* D, am I correct (of course I have already defined the tensors
>>>> in the code)?  I mean the multiplication with '*'
>>>> does contraction over one index, right?
>>>>
>>>>
>>>> 2. I have another query. How to perform the polar decomposition in
>>>> dealii, like
>>>> F_{ij} = R_{ik} U_{kj} = V_{ik} R_{kj},
>>>>
>>>> where R is an orthogonal tensor and U and V are symmetric tensors.
>>>>
>>>> I shall be thankful if someone can help me in this regard.
>>>>
>>>> Thanks and regards,
>>>> Anup.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>> 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.
>>>
>>
>> --
> 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.
>

-- 
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: tensor product and polar decomposition

2016-06-10 Thread Anup Basak
Hello Jean-Paul,

Thank you very much for the reply. I got your point. Now I have a small
query. In
the first link provided by you for single contraction I see that the
contraction rule
is given for 'Tensors'. I think the same contraction rules applies for two
'SymmetricTensors'
as well, am I right?

Thank you very much,

Regards,
Anup.

On Fri, Jun 10, 2016 at 1:36 PM, Jean-Paul Pelteret 
wrote:

> For the first question, if the tensors are of type Tensor then
> the * operator does a contraction over a single index
> <https://www.dealii.org/8.4.0/doxygen/deal.II/classTensor.html#acff14b5a87224a20eb287ed06017c80f>.
> If the tensors are of type SymmetricTensor, then the * operator
> will perform a contraction over two indices
> <https://www.dealii.org/8.4.0/doxygen/deal.II/classSymmetricTensor.html#a3586fe5da69c834e642026d1dc310c65>.
> If you need finer control over which indices are summed over, then both
> classes offer such options though the contract and double_contract
> functions.
>
>
> On Friday, June 10, 2016 at 6:18:20 PM UTC+2, Anup Basak wrote:
>>
>> Hello all,
>>
>> I have two quires regarding tensor product and polar decomposition.
>>
>> 1. Suppose I want to multiply two second order tensors with a fourth
>> order tensor to get a forth order tensor as follows:
>>
>> A_{ijkl} = B_{im} C_{mjkn} D_{nl}.
>>
>> It is clear that we have a single index contraction with B and C, and
>> with C and D. If I use the command  in the code
>>
>> A = B* C* D, am I correct (of course I have already defined the tensors
>> in the code)?  I mean the multiplication with '*'
>> does contraction over one index, right?
>>
>>
>> 2. I have another query. How to perform the polar decomposition in
>> dealii, like
>> F_{ij} = R_{ik} U_{kj} = V_{ik} R_{kj},
>>
>> where R is an orthogonal tensor and U and V are symmetric tensors.
>>
>> I shall be thankful if someone can help me in this regard.
>>
>> Thanks and regards,
>> Anup.
>>
>>
>>
>>
>>
>>
>>
>>
>> --
> 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.
>

-- 
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] tensor product and polar decomposition

2016-06-10 Thread Anup Basak
Hello all,

I have two quires regarding tensor product and polar decomposition.

1. Suppose I want to multiply two second order tensors with a fourth order 
tensor to get a forth order tensor as follows:

A_{ijkl} = B_{im} C_{mjkn} D_{nl}.

It is clear that we have a single index contraction with B and C, and  with 
C and D. If I use the command  in the code

A = B* C* D, am I correct (of course I have already defined the tensors in 
the code)?  I mean the multiplication with '*'
does contraction over one index, right?


2. I have another query. How to perform the polar decomposition in dealii, 
like 
F_{ij} = R_{ik} U_{kj} = V_{ik} R_{kj},

where R is an orthogonal tensor and U and V are symmetric tensors.

I shall be thankful if someone can help me in this regard.

Thanks and regards,
Anup.








-- 
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] fourth order tensor

2016-05-24 Thread Anup Basak
Hi all,

I have a confusion regarding 4th order symmetric tensor. I need the fourth
order symmetric tensor   \mathcal S, as defined in step 44.  After defining 
\mathcal S in the introduction, it is mentioned that "The fourth-order
 SymmetricTensor 
 
returned by identity_tensor() is \mathcal S". However,
in the code this command has been used to get II  (same as \mathcal I), i.e.

template const SymmetricTensor<4, dim> 

StandardTensors::II = identity_tensor();

I am confused here, because \mathcal I and \mathcal S are two different 
tensors.
 If anyone can clearly tell me which command to be used to get   \mathcal 
I  and
 which one to get  \mathcal S, will be helpful for me.

Thanks and regards,
Anup.

-- 
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.