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
> 
> 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
>>> . 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 Jean-Paul Pelteret
Dear Anup,

Thank you for your test case. I forgot to update this thread, but I was in 
fact able to reproduce the problem 
 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 
>> . 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.


[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 
> . 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");
width = prm.get_double("width");
scale = prm.get_double("Grid scale");
  }
  prm.leave_subsection();
}

 /
struct Materials
{
  double lambda0;
  double mu0;
  double lambdai;
  double mui;

  static void
  declare_parameters(ParameterHandler &prm)

[deal.II] Assemble system with variational right hand side

2017-01-22 Thread Jaekwang Kim
Hi. I have a question on how we can impose external force term, or right 
hand side, in Stokes flow. 

My governing equation is same with that of step-22, stokes flow 

-nabla^2 u + grad p = f 

-grad u = 0 

but I want to impose 'f', 

To do this, I made function that gives me f value on each point. 
For example, if I want function of f thats looks like f=(x^2,y^2); 
I would make function like this...

  template 

  class RightHandSide : public Function

  {

public:

  RightHandSide () : Function(dim+1) {}


  virtual void vector_value (const Point &p,

Vector   &value) const;


  };


  template 

  void

  RightHandSide::vector_value (const Point &p,

Vector   &values) const

  {

values(0) =  pow(p[0],2);

values(1) =  pow(p[1],2);

values(2) =  0.0;

  }

After that I may consider this 'f' term when I assemble system. 
but I don't see a way to how I should try modify following read lines of 
the code from step-22 

  for (; cell!=endc; ++cell)

  {

fe_values.reinit (cell);

local_matrix = 0;

local_rhs = 0;


right_hand_side.vector_value_list(fe_values.get_quadrature_points(),

  rhs_values);


for (unsigned int q=0; qhttp://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: Postprocessing using the same variable twice

2017-01-22 Thread 'Seyed Ali Mohseni' via deal.II User Group
Thank you, Daniel.

I solved my problem already in the following way before reading your post:

DataOut data_out;
data_out.attach_dof_handler(dof_handler);

// [ DISPLACEMENT COMPONENTS 
]=

std::vector displacement_components;
switch (dim)
{
case 1:
displacement_components.push_back("displacement_x");
break;
case 2:
displacement_components.push_back("displacement_x");
displacement_components.push_back("displacement_y");
break;
case 3:
displacement_components.push_back("displacement_x");
displacement_components.push_back("displacement_y");
displacement_components.push_back("displacement_z");
break;
default:
Assert(false, ExcInternalError())
;
}

std::vector 
displacement_component_interpretation(dim, 
DataComponentInterpretation::component_is_scalar);

// Collect data output
data_out.add_data_vector(incremental_displacement, displacement_components, 
DataOut::type_dof_data, displacement_component_interpretation);

// [ DISPLACEMENTS MAGNITUDE 
]=

std::vector displacement_magnitude(dim, "displacement");

std::vector 
displacement_magnitude_interpretation(dim, 
DataComponentInterpretation::component_is_part_of_vector);

data_out.add_data_vector(incremental_displacement, displacement_magnitude, 
DataOut::type_dof_data, displacement_magnitude_interpretation);


I thought there would be a more elegant solution than this, which is why I 
asked here. But it seems your suggestion is similar to my approach. 
Regarding the DataPostprocessor class, I am just using it for quantities at 
integration points, e.g. strains etc. 

Kind regards,
S. A. Mohseni


-- 
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: Postprocessing using the same variable twice

2017-01-22 Thread Daniel Arndt

>
> Is it possible to output the magnitude of displacements and its components 
> all together?
>
> std::vector 
> data_component_interpretation(dim, DataComponentInterpretation::
> component_is_part_of_vector);
>
> The above allows me to output the displacements as a vector field and 
> shows one variable containing the magnitude of displacements.
>
> std::vector 
> data_component_interpretation(dim, DataComponentInterpretation::
> component_is_scalar);
>
> Hence, this one enables the output of each component separately, e.g. 
> displacement_x (delta_x) according to step-18.
>
> What I want is to have all in one, such as:
>
> displacement_x
> displacement_y
> displacement_z
> displacement_magnitude
>
> Is that possible?
>
There are multiple ways to achieve that. The easiest one would probably be 
to create multiple output data vectors by calling multiple times 
DataOut::add_data_vector, i.e.

std::vectordata_component_interpretation_vector
 (dim, 
DataComponentInterpretation::component_is_part_of_vector);
std::vectordata_component_interpretation_scalars
 (dim, 
DataComponentInterpretation::component_is_scalar);
data_out.add_data_vector (solution, 
solution_names_scalars, DataOut::type_dof_data, 
data_component_interpretation_scalars);
data_out.add_data_vector (solution, 
solution_names_vector, DataOut::type_dof_data, 
data_component_interpretation_vector);
 

> I am using VisIt 2.11.0.
>
I am not too familiar with Visit but in Paraview you can use the filter 
"Calculator" to store individual components or the magnitude in a new 
visualization object without changing your code.

If you are just interested in the magnitude without storing the solution 
vector separately, you could also compute the magnitude vector via 
DataPostprocessor[1].

Best,
Daniel

[1] https://www.dealii.org/8.4.0/doxygen/deal.II/classDataPostprocessor.html

-- 
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] Postprocessing using the same variable twice

2017-01-22 Thread 'Seyed Ali Mohseni' via deal.II User Group
Dear all,

Is it possible to output the magnitude of displacements and its components 
all together?

std::vector 
data_component_interpretation(dim, DataComponentInterpretation::
component_is_part_of_vector);

The above allows me to output the displacements as a vector field and shows 
one variable containing the magnitude of displacements.

std::vector 
data_component_interpretation(dim, DataComponentInterpretation::
component_is_scalar);

Hence, this one enables the output of each component separately, e.g. 
displacement_x (delta_x) according to step-18.

What I want is to have all in one, such as:

displacement_x
displacement_y
displacement_z
displacement_magnitude

Is that possible?

I am using VisIt 2.11.0.

Kind regards,
S. A. Mohseni

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