[deal.II] Re: Neumann condtitions in the mixed space setting

2016-08-30 Thread Eldar Khattatov
I managed to imply the Neumann conditions on stress only by first 
projecting the boundary values to the entire mixed space (affecting 
rotations), and then manually removing the constraints associated with 
rotations. The code is below if someone is interested.
VectorTools::project_boundary_values (dof_handler,
  stress_boundary_functions,
  QGauss(2),
  boundary_values_stress);

FEValuesExtractors::Scalar rotation(dim*dim + dim);
VectorTools::interpolate_boundary_values (dof_handler,
  0,
  ZeroFunction(dim*dim + dim + 
0.5*dim*(dim-1)),
  boundary_values_rotation,
  fe.component_mask(rotation));

for (std::map::iterator it_r=
boundary_values_rotation.begin();
 it_r!=boundary_values_rotation.end();
 ++it_r)
   boundary_values_stress.erase(it_r->first);

MatrixTools::apply_boundary_values (boundary_values_stress,
system_matrix,
solution,
system_rhs);


I still wonder, though, if there is a nicer way to do it.

-- 
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] Neumann condtitions in the mixed space setting

2016-08-30 Thread Eldar Khattatov
I am trying to implement mixed elasticity with Neumann conditions using 
deal.ii. The formulation seeks for stress, displacement and rotation as the 
unknowns, and the Neumann conditions are to set stress normal components to 
be equal to some function g. 

I know that for mixed Darcy it is possible to do this using

project_boundary_values

as from what I understood from the implementation of this method, it does 
not do anything to pressure DoFs as they are not on the boundary. However, 
in my setting I am using BDM1 - Q0 - Q1_cts for elasticity, and while this 
approach does not constrain displacements, it actually restricts rotations, 
which I would want to avoid. I looked at
  
interpolate_boundary_values

which takes ComponentMask as an argument, but unfortunately it does not 
work with the elements I am using. Could you please point me to the 
possible way of solving this issue?

Another question, for mixed Darcy, is there a difference in using

project_boundary_values

or
  
project_boundary_values_div_conforming

dealing with Neumann conditions?

Thank you.

-- 
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] matrix factorization reuse?

2016-08-30 Thread David F
Hi, I'm interested in this as well. Could you post or link to your 
solution? Thanks.


On Friday, 19 February 2016 17:21:22 UTC+1, Michael Harmon wrote:
>
> If you want to use Trilinos, I refactored their direct solver so that it 
> can be used the way you want, I will submit the patch, but if you want can 
> send you the changes as well.
>
>
> On Tuesday, December 1, 2015 at 4:05:29 AM UTC-6, Pascal Kraft wrote:
>>
>> Hello Wolfgang,
>>
>> does the same hold true for other direct solvers? I would like to use 
>> Mumps (PETSc) to get a LU-factorization and reuse that a couple of times. 
>> The PETSc wrappers only provide a constructor and solve. If I reuse solve 
>> withe the same matrix argument, will the factorization be done again or 
>> does it detect that the inverse is already present? The code for both the 
>> PETSc wrappers as well as the Trilinos Wrappers does not look as if that 
>> was supported.
>>
>> Greetings,
>> Pascal Kraft
>>
>> Am Sonntag, 4. Oktober 2015 20:14:30 UTC+2 schrieb bangerth:
>>>
>>>
>>> Zhen, 
>>>
>>> Jean-Paul already gave the correct answer, namely use a sparse direct 
>>> solver 
>>> and factorize only once. 
>>>
>>> > Therefore my following questions are: 
>>> > 
>>> > What is the limit of the size of matrix system can I do a lapack LU 
>>> > factorization on a single machine? 
>>>
>>> For a sparse direct solver, I think you can probably go to around 1M 
>>> unknowns. 
>>> If you use a LAPACK matrix, you will quickly be limited by memory. For 
>>> example, a 10,000 x 10,000 matrix already requires almost a GB of 
>>> memory. 
>>>
>>>
>>> > Are there any better way to get LU factorization in deal.ii? 
>>> > Can we incorporate "history experience" to achieve more efficient 
>>> solvers? 
>>>
>>> People have tried that and there is a substantial amount of literature 
>>> on the 
>>> topic of Krylov subspace recycling. I always think that it is a great 
>>> idea and 
>>> want to investigate using it, but it has not found its way into 
>>> mainstream 
>>> applications to the best of my knowledge. 
>>>
>>> Best 
>>>   W. 
>>>
>>> -- 
>>>  
>>> Wolfgang Bangerth   email:bang...@math.tamu.edu 
>>>  www: 
>>> http://www.math.tamu.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.


[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] Re: Vector-valued gradient of solution vector

2016-08-30 Thread Jean-Paul Pelteret
Dear Joel,

No, this functionality doesn't exist. However, you can create a quadrature 
rule with the quadrature points located at the support points (see the FAQ 
),
 
and could then extract the solution based on your custom quadrature rule.

Regards,
J-P

On Tuesday, August 30, 2016 at 5:32:13 PM UTC+2, Joel Davidsson wrote:
>
> Dear Daniel,
>
> I was just wondering if their exist a similar function 
> to DoFTools::map_dofs_to_support_points, but that maps a vector-valued 
> solution Vector into to a std::vector instead?
>
> Best,
> Joel
>
> On Monday, August 22, 2016 at 9:03:22 PM UTC+2, Daniel Arndt wrote:
>>
>> Joel,
>>
>> You should not rely on any particular sorting of the dofs in the solution 
>> vector. Instead you can ask the FiniteElement on each cell for the 
>> component of a local dof by
>> const unsigned int component = fe.system_to_component_index(i).first; 
>>
>> Apart from that the DataOut object knows about components and you can do 
>> some postprocessing on the solution vector using DataPostprocessor [1]
>>
>> Best,
>> Daniel
>>
>>  [1] https://dealii.org/8.4.1/doxygen/deal.II/classDataPostprocessor.html
>>
>> Am Montag, 22. August 2016 17:05:08 UTC+2 schrieb Joel Davidsson:
>>>
>>> Dear Daniel,
>>>
>>> Thank you for a very good answer, adding the fe_values_scalar and 
>>> cell_scalar fixed the problem.
>>>
>>> I have a follow-up question about the solution I get out, how is the 
>>> data organized in the solution vector? Say for example I want to loop over 
>>> all the x components, how would I do that?
>>>
>>> Best,
>>> Joel
>>>
>>> On Friday, August 12, 2016 at 5:35:07 PM UTC+2, Daniel Arndt wrote:

 Joel,

 Yes the matrix you are assembling is a vector-valued mass matrix now.
 For me your code is failing with

 void dealii::FEValuesBase::get_function_gradients(const 
 InputVector&, std::vector >&) const [with InputVector = 
 dealii::Vector; int dim = 3; int spacedim = 3; typename 
 InputVector::value_type = double]
 The violated condition was: 
 (fe->n_components()) == (1)
 The name and call sequence of the exception was:
 dealii::ExcDimensionMismatch((fe->n_components()),(1))
 Additional Information: 
 Dimension 3 not equal to 1

 and this is not surprising. What you are doing is to extract the 
 gradients of a vector-valued finite element solution. The object that 
 should store this should therefore be a 
 std::vector> as you want to store for each 
 quadrature point and each component a Tensor<1,dim>.

 What you want to do is really that in "Do not work". As you have two 
 DoFHandlers, you should also have two FEValues objects and two 
 cell_iterator corresponding to the correct DoFHandler. Then you can 
 extract 
 the gradient of your scalar field and project it onto the ansatz space for 
 the vector-valued field. This should look like:

 typename DoFHandler::active_cell_iterator cell_scalar = 
 dof_handler_scalar.begin_active();
 typename DoFHandler::active_cell_iterator cell = 
 dof_handler.begin_active();
 ...

  for (; cell!=endc; ++cell, ++cell_vector)
 {
   fe_values.reinit (cell);
   fe_values_scalar.reinit (cell_scalar);
   fe_values_scalar.get_function_gradients(test,fe_function_grad);
   ...
 }

 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.