Re: [deal.II] Setting boundary id's for points instead of faces

2022-10-11 Thread Wasim Niyaz Munshi ce21d400
I was using a constraint object to apply the boundary conditions and
component mask to deal with hanging nodes and apply x and y displacements
separately.
Now, I want to solve an elasticity problem on a unit square wherein I want
to apply a displacement in y direction on top face and have a pin and
roller support at lower left and right node respectively.
I tried to do this as follows:
1. I used the constraint object to apply displacement in y direction on top
face.
2. I created a std::map boundary_values object to enforce a pin and roller
support bc at lower left and right node respectively.
I took a look at step79. They seem to have similar dirichlet bc at the
bottom but apply a neumann bc at the top. I followed a similar procedure to
have a pin and roller bc at lower left and right node respectively(using
the setup_boundary_values class as they have done).


My code throws the following error:
An error occurred in line <324> of file

in function
static void
dealii::internal::DoFAccessorImplementation::Implementation::process_dof_index(const
dealii::DoFHandler&, unsigned int, unsigned int, unsigned
int, unsigned int, const std::integral_constant&,
GlobalIndexType&, const DoFPProcessor&) [with int dim = 2; int spacedim =
2; int structdim = 0; GlobalIndexType = unsigned int; DoFPProcessor =
dealii::internal::DoFAccessorImplementation::Implementation::get_dof_index<2,
2, 0>::]
The violated condition was:
::dealii::deal_II_exceptions::internals::compare_less_than(obj_level,
dof_handler.object_dof_indices.size())
Additional information:
Index 0 is not in the half-open range [0,0). In the current case, this
half-open range is in fact empty, suggesting that you are accessing an
element of an empty collection such as a vector that has not been set
to the correct size.

Stacktrace:
---
#0  ./step-103: void
dealii::internal::DoFAccessorImplementation::Implementation::process_dof_index<2,
2, 0, unsigned int,
dealii::internal::DoFAccessorImplementation::Implementation::get_dof_index<2,
2, 0>(dealii::DoFHandler<2, 2> const&, unsigned int, unsigned int, unsigned
int, unsigned int, std::integral_constant const&)::{lambda(auto:1
const&, auto:2&)#1}>(dealii::DoFHandler<2, 2> const&, unsigned int,
unsigned int, unsigned int, unsigned int, std::integral_constant
const&, unsigned int&,
dealii::internal::DoFAccessorImplementation::Implementation::get_dof_index<2,
2, 0>(dealii::DoFHandler<2, 2> const&, unsigned int, unsigned int, unsigned
int, unsigned int, std::integral_constant const&)::{lambda(auto:1
const&, auto:2&)#1} const&)
#1  ./step-103: unsigned int
dealii::internal::DoFAccessorImplementation::Implementation::get_dof_index<2,
2, 0>(dealii::DoFHandler<2, 2> const&, unsigned int, unsigned int, unsigned
int, unsigned int, std::integral_constant const&)
#2  ./step-103: dealii::DoFAccessor<2, 2, 2,
false>::vertex_dof_index(unsigned int, unsigned int, unsigned int) const
#3  ./step-103: step103::ElasticProblem::setup_boundary_values()
#4  ./step-103: step103::ElasticProblem::run()
#5  ./step-103: main


make[3]: *** [CMakeFiles/run.dir/build.make:71: CMakeFiles/run] Aborted
(core dumped)
make[2]: *** [CMakeFiles/Makefile2:116: CMakeFiles/run.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/run.dir/rule] Error 2
make: *** [Makefile:137: run] Error 2
 Is it because I am applying Dirichlet bc using two objects, constraints
and boundary_values?


Thank you



On Mon, Oct 10, 2022 at 7:28 PM Wolfgang Bangerth 
wrote:

> On 10/10/22 07:42, Wasim Niyaz Munshi ce21d400 wrote:
> > I am trying to solve the elasticity equation on a square domain (similar
> to
> > step 8).
> > For the patch test I am using just one element.
> > I am having problems with the application of boundary conditions.
> > I want to fix the lower left node in both x and y, and also fix the
> lower
> > right node in y.
> > The lower right node is free to move in x.
> > The problem I am facing is that both these nodes are on the same face,
> and I
> > do not know how to specify different values of x displacement for the 2
> nodes
> > of the same face.
> >
> > Is there a way to set boundary id to a node rather than to a face?
>
> No -- principally because from a mathematical perspective, you can only
> set
> boundary indicators on parts of the boundary that have (d-1) dimensional
> measure larger than zero. Vertices do not satisfy this.
>
> But it is a common thing to do anyway. You might want to look at the
> step-79
> that does something similar.
>
> 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/forum/dealii?hl=en
> ---
> You r

Re: [deal.II] Re: Trying to increase precision of floating point values in step3 of tutorial

2022-10-11 Thread Bruno Turcksin
You want to do something like this:

  DataOut<2> data_out;
  data_out.attach_dof_handler(dof_handler);
  data_out.add_data_vector(solution, "solution");
  data_out.build_patches();

  std::ofstream output("solution.vtk");
  output.set_precisition(12);
  data_out.write_vtk(output);

Best,

Bruno

Le mar. 11 oct. 2022 à 00:48, Wasim Niyaz Munshi ce21d400 <
ce21d...@smail.iitm.ac.in> a écrit :

> I used this to set precision of 12 for my solution vector
> *std::cout << "Solution" << std::setprecision(12) <
> I had to add the following line of code also:
> *#include *
>
> I tried the following to write data to vtk file with a higher
> precision(12):
> DataOut<2> data_out;
>   data_out.attach_dof_handler(dof_handler);
>   data_out.add_data_vector(*std::setprecision(12)* < "solution");
>   data_out.build_patches();
>
>   std::ofstream output("solution.vtk");
>   data_out.write_vtk(output);
>
> But it gives the following error:
> error: no match for ‘operator<<’ (operand types are ‘std::_Setprecision’
> and ‘const dealii::Vector’)
>
> Thanks
>
> On Tuesday, October 11, 2022 at 1:27:54 AM UTC+5:30 Wolfgang Bangerth
> wrote:
>
>> On 10/10/22 11:45, Wasim Niyaz Munshi ce21d400 wrote:
>> > So I used set precision function when using the cout to print the
>> > solution vector.
>> > With setprecision, the values are printed accurately to machine
>> precision.
>> > However, I was still unable to write the values accurately upto machine
>> > precision, to a vtk file.
>>
>> Did you use .setprecision(...) also on the stream that you give to
>> data_out.write_vtk()? You need to set the precision separately for each
>> stream on which you want to output.
>>
>> Best
>> W.
>>
>> --
>> 
>> Wolfgang Bangerth email: bang...@colostate.edu
>> www: http://www.math.colostate.edu/~bangerth/
>>
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/8Ud1gkzUbNQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/7bad0073-391e-4b5a-8613-0749a664f21fn%40googlegroups.com
> 
> .
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAGVt9eN%2BAu8NVxzV_jQfJMGxYEBWgzAW%3DbKo6126kSm3N_jf5g%40mail.gmail.com.


Re: [deal.II] Re: Trying to increase precision of floating point values in step3 of tutorial

2022-10-11 Thread Wasim Niyaz Munshi ce21d400
Did you mean 
output.set_precision(12);

It gives the following error
error: ‘std::ofstream’ {aka ‘class std::basic_ofstream’} has no 
member named ‘set_precision’; did you mean ‘std::streamsize 
std::ios_base::_M_precision’? (not accessible from this context)

I also tried 
output.setprecision(12);

It also gave the same error
error: ‘std::ofstream’ {aka ‘class std::basic_ofstream’} has no 
member named ‘setprecision’; did you mean ‘std::streamsize 
std::ios_base::_M_precision’? (not accessible from this context)

Thanks

On Tuesday, October 11, 2022 at 6:00:55 PM UTC+5:30 bruno.t...@gmail.com 
wrote:

> You want to do something like this:
>
>   DataOut<2> data_out;
>   data_out.attach_dof_handler(dof_handler);
>   data_out.add_data_vector(solution, "solution");
>
>   data_out.build_patches();
>
>   std::ofstream output("solution.vtk");
>   output.set_precisition(12);
>   data_out.write_vtk(output);
>
> Best,
>
> Bruno
>
> Le mar. 11 oct. 2022 à 00:48, Wasim Niyaz Munshi ce21d400 <
> ce21...@smail.iitm.ac.in> a écrit :
>
>> I used this to set precision of 12 for my solution vector
>> *std::cout << "Solution" << std::setprecision(12) <>
>> I had to add the following line of code also:
>> *#include *
>>
>> I tried the following to write data to vtk file with a higher 
>> precision(12):
>> DataOut<2> data_out;
>>   data_out.attach_dof_handler(dof_handler);
>>   data_out.add_data_vector(*std::setprecision(12)* <> "solution");
>>   data_out.build_patches();
>>
>>   std::ofstream output("solution.vtk");
>>   data_out.write_vtk(output);
>>
>> But it gives the following error:
>> error: no match for ‘operator<<’ (operand types are ‘std::_Setprecision’ 
>> and ‘const dealii::Vector’)
>>
>> Thanks
>>
>> On Tuesday, October 11, 2022 at 1:27:54 AM UTC+5:30 Wolfgang Bangerth 
>> wrote:
>>
>>> On 10/10/22 11:45, Wasim Niyaz Munshi ce21d400 wrote: 
>>> > So I used set precision function when using the cout to print the 
>>> > solution vector. 
>>> > With setprecision, the values are printed accurately to machine 
>>> precision. 
>>> > However, I was still unable to write the values accurately upto 
>>> machine 
>>> > precision, to a vtk file. 
>>>
>>> Did you use .setprecision(...) also on the stream that you give to 
>>> data_out.write_vtk()? You need to set the precision separately for each 
>>> stream on which you want to output. 
>>>
>>> Best 
>>> W. 
>>>
>>> -- 
>>>  
>>> Wolfgang Bangerth email: bang...@colostate.edu 
>>> www: http://www.math.colostate.edu/~bangerth/ 
>>>
>> -- 
>>
> The deal.II project is located at http://www.dealii.org/
>> For mailing list/forum options, see 
>> https://groups.google.com/d/forum/dealii?hl=en
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "deal.II User Group" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/dealii/8Ud1gkzUbNQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> dealii+un...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/7bad0073-391e-4b5a-8613-0749a664f21fn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/af85f162-31e4-480a-830e-7a102b81fc95n%40googlegroups.com.


Re: [deal.II] Re: Trying to increase precision of floating point values in step3 of tutorial

2022-10-11 Thread Bruno Turcksin
Sorry, it should be output.precision(12)

Bruno


Le mar. 11 oct. 2022 à 09:03, Wasim Niyaz Munshi ce21d400 <
ce21d...@smail.iitm.ac.in> a écrit :

> Did you mean
> output.set_precision(12);
>
> It gives the following error
> error: ‘std::ofstream’ {aka ‘class std::basic_ofstream’} has no
> member named ‘set_precision’; did you mean ‘std::streamsize
> std::ios_base::_M_precision’? (not accessible from this context)
>
> I also tried
> output.setprecision(12);
>
> It also gave the same error
> error: ‘std::ofstream’ {aka ‘class std::basic_ofstream’} has no
> member named ‘setprecision’; did you mean ‘std::streamsize
> std::ios_base::_M_precision’? (not accessible from this context)
>
> Thanks
>
> On Tuesday, October 11, 2022 at 6:00:55 PM UTC+5:30 bruno.t...@gmail.com
> wrote:
>
>> You want to do something like this:
>>
>>   DataOut<2> data_out;
>>   data_out.attach_dof_handler(dof_handler);
>>   data_out.add_data_vector(solution, "solution");
>>
>>   data_out.build_patches();
>>
>>   std::ofstream output("solution.vtk");
>>   output.set_precisition(12);
>>   data_out.write_vtk(output);
>>
>> Best,
>>
>> Bruno
>>
>> Le mar. 11 oct. 2022 à 00:48, Wasim Niyaz Munshi ce21d400 <
>> ce21...@smail.iitm.ac.in> a écrit :
>>
>>> I used this to set precision of 12 for my solution vector
>>> *std::cout << "Solution" << std::setprecision(12) <>>
>>> I had to add the following line of code also:
>>> *#include *
>>>
>>> I tried the following to write data to vtk file with a higher
>>> precision(12):
>>> DataOut<2> data_out;
>>>   data_out.attach_dof_handler(dof_handler);
>>>   data_out.add_data_vector(*std::setprecision(12)* <>> "solution");
>>>   data_out.build_patches();
>>>
>>>   std::ofstream output("solution.vtk");
>>>   data_out.write_vtk(output);
>>>
>>> But it gives the following error:
>>> error: no match for ‘operator<<’ (operand types are ‘std::_Setprecision’
>>> and ‘const dealii::Vector’)
>>>
>>> Thanks
>>>
>>> On Tuesday, October 11, 2022 at 1:27:54 AM UTC+5:30 Wolfgang Bangerth
>>> wrote:
>>>
 On 10/10/22 11:45, Wasim Niyaz Munshi ce21d400 wrote:
 > So I used set precision function when using the cout to print the
 > solution vector.
 > With setprecision, the values are printed accurately to machine
 precision.
 > However, I was still unable to write the values accurately upto
 machine
 > precision, to a vtk file.

 Did you use .setprecision(...) also on the stream that you give to
 data_out.write_vtk()? You need to set the precision separately for each
 stream on which you want to output.

 Best
 W.

 --
 

 Wolfgang Bangerth email: bang...@colostate.edu
 www: http://www.math.colostate.edu/~bangerth/

>>> --
>>>
>> The deal.II project is located at http://www.dealii.org/
>>> For mailing list/forum options, see
>>> https://groups.google.com/d/forum/dealii?hl=en
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "deal.II User Group" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/dealii/8Ud1gkzUbNQ/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> dealii+un...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/dealii/7bad0073-391e-4b5a-8613-0749a664f21fn%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/8Ud1gkzUbNQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/af85f162-31e4-480a-830e-7a102b81fc95n%40googlegroups.com
> 
> .
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAGVt9ePfryRGyF%3D87Z5CmAZ6Sr%3Dhp%2BH4krnBJO3PFfBYeOeDfw%40mail.gmail.com.


Re: [deal.II] Setting boundary id's for points instead of faces

2022-10-11 Thread Wolfgang Bangerth



Wasim,
I imagine you are calling your setup_boundary_values() function before you 
call dof_handler.distribute_dofs()?

Best
 W.

On 10/11/22 05:16, Wasim Niyaz Munshi ce21d400 wrote:

*** Caution: EXTERNAL Sender ***

I was using a constraint object to apply the boundary conditions and component 
mask to deal with hanging nodes and apply x and y displacements separately.
Now, I want to solve an elasticity problem on a unit square wherein I want to 
apply a displacement in y direction on top face and have a pin and roller 
support at lower left and right node respectively.

I tried to do this as follows:
1. I used the constraint object to apply displacement in y direction on top 
face.
2. I created a std::map boundary_values object to enforce a pin and roller 
support bc at lower left and right node respectively.
I took a look at step79. They seem to have similar dirichlet bc at the bottom 
but apply a neumann bc at the top. I followed a similar procedure to have a 
pin and roller bc at lower left and right node respectively(using the 
setup_boundary_values class as they have done).



My code throws the following error:
An error occurred in line <324> of file 
 
in function
     static void 
dealii::internal::DoFAccessorImplementation::Implementation::process_dof_index(const 
dealii::DoFHandler&, unsigned int, unsigned int, unsigned int, 
unsigned int, const std::integral_constant&, GlobalIndexType&, 
const DoFPProcessor&) [with int dim = 2; int spacedim = 2; int structdim = 0; 
GlobalIndexType = unsigned int; DoFPProcessor = 
dealii::internal::DoFAccessorImplementation::Implementation::get_dof_index<2, 
2, 0>::]

The violated condition was:
     ::dealii::deal_II_exceptions::internals::compare_less_than(obj_level, 
dof_handler.object_dof_indices.size())

Additional information:
     Index 0 is not in the half-open range [0,0). In the current case, this
     half-open range is in fact empty, suggesting that you are accessing an
     element of an empty collection such as a vector that has not been set
     to the correct size.

Stacktrace:
---
#0  ./step-103: void 
dealii::internal::DoFAccessorImplementation::Implementation::process_dof_index<2, 
2, 0, unsigned int, 
dealii::internal::DoFAccessorImplementation::Implementation::get_dof_index<2, 
2, 0>(dealii::DoFHandler<2, 2> const&, unsigned int, unsigned int, unsigned 
int, unsigned int, std::integral_constant const&)::{lambda(auto:1 
const&, auto:2&)#1}>(dealii::DoFHandler<2, 2> const&, unsigned int, unsigned 
int, unsigned int, unsigned int, std::integral_constant const&, 
unsigned int&, 
dealii::internal::DoFAccessorImplementation::Implementation::get_dof_index<2, 
2, 0>(dealii::DoFHandler<2, 2> const&, unsigned int, unsigned int, unsigned 
int, unsigned int, std::integral_constant const&)::{lambda(auto:1 
const&, auto:2&)#1} const&)
#1  ./step-103: unsigned int 
dealii::internal::DoFAccessorImplementation::Implementation::get_dof_index<2, 
2, 0>(dealii::DoFHandler<2, 2> const&, unsigned int, unsigned int, unsigned 
int, unsigned int, std::integral_constant const&)
#2  ./step-103: dealii::DoFAccessor<2, 2, 2, false>::vertex_dof_index(unsigned 
int, unsigned int, unsigned int) const

#3  ./step-103: step103::ElasticProblem::setup_boundary_values()
#4  ./step-103: step103::ElasticProblem::run()
#5  ./step-103: main


make[3]: *** [CMakeFiles/run.dir/build.make:71: CMakeFiles/run] Aborted (core 
dumped)

make[2]: *** [CMakeFiles/Makefile2:116: CMakeFiles/run.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/run.dir/rule] Error 2
make: *** [Makefile:137: run] Error 2
  Is it because I am applying Dirichlet bc using two objects, constraints and 
boundary_values?



Thank you



On Mon, Oct 10, 2022 at 7:28 PM Wolfgang Bangerth > wrote:


On 10/10/22 07:42, Wasim Niyaz Munshi ce21d400 wrote:
 > I am trying to solve the elasticity equation on a square domain
(similar to
 > step 8).
 > For the patch test I am using just one element.
 > I am having problems with the application of boundary conditions.
 > I want to fix the lower left node in both x and y, and also fix the lower
 > right node in y.
 > The lower right node is free to move in x.
 > The problem I am facing is that both these nodes are on the same face,
and I
 > do not know how to specify different values of x displacement for the 2
nodes
 > of the same face.
 >
 > Is there a way to set boundary id to a node rather than to a face?

No -- principally because from a mathematical perspective, you can only set
boundary indicators on parts of the boundary that have (d-1) dimensional
measure larger than zero. Vertices do not satisfy this.

But it is a common thing to do anyway. You might want to look at the step-79
that does something similar.

Best
   W>


-- 

Re: [deal.II] Regarding boundary condition

2022-10-11 Thread Deepika Kushwah
Thank you Dr. Wolfgang Bangerth,

I have successfully applied boundary conditions at the extreme node of 1-D
bar but not able to impose it on intermediate points.
I have following doubts-
1. How to check boundary ids and assign boundary values corresponding to
any intermediate node?
2. In the solution file (vtk), 4 points can be seen instead of 3 for 2
elements. Why is it so?
3. How to alter the output parameters/variables given in the solution file?



Thanks & Regards
Deepika

On Thu, Sep 29, 2022 at 9:38 PM Wolfgang Bangerth 
wrote:

> On 9/29/22 04:41, Deepika Kushwah wrote:
> >
> > I am trying to solve the 1-D bar problem by taking step-3 as a
> > reference. I am not able to understand how to impose a dirichlet
> > boundary condition (u=0 at one end and u=0.001 at the last node?
> > How to proceed?
>
> Take a look here:
>
> https://github.com/dealii/dealii/wiki/Frequently-Asked-Questions#dealii-programs-behave-differently-in-1d-than-in-23d
>
> 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/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/47f49164-0507-8e0b-6c70-c487816301bb%40colostate.edu
> .
>

-- 
**

This e-mail is for the sole use of the intended recipient(s) and may

contain confidential and privileged information. If you are not the

intended recipient, please contact the sender by reply e-mail and destroy

all copies and the original message. Any unauthorized review, use,

disclosure, dissemination, forwarding, printing or copying of this email


is strictly prohibited and appropriate legal action will be taken. 




-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAKTdrprLFJJeAPsX%2BTV6On_LO0Kab7kL-pvE7Bdzn7TYfcx7qQ%40mail.gmail.com.


[deal.II] Re: Segmentation fault in Trilinos direct solver

2022-10-11 Thread Marc Fehling
Hello,

I can't identify the problem right away, but here are some tips in 
debugging it:

   - Does the problem persist if you disable both h- and p-refinement? If 
   so, than an issue might be that your data structures haven't been 
   reinitialized after you updated your discretization.
   - Do you run the code in Debug mode?
   - Do you use the latest version of Trilinos?

Marc

On Sunday, October 9, 2022 at 7:02:26 AM UTC-6 yy.wayne wrote:

> In step-75 I try to replace the coarse mg solver with a direct solver, 
> which is TrilinosWrappers::SolverDirect. However I get Segmentation error 
> calling the direct solver, at the last step of SolverDirect::solve():
>
> solver_control.check(0,0);
>
>  Where could be the mistake?  (The deal.ii version is 9.4.0)
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/ae19b481-0bc9-4410-a5d6-36816ba7eff4n%40googlegroups.com.


[deal.II] Re: Segmentation fault in Trilinos direct solver

2022-10-11 Thread 'yy.wayne' via deal.II User Group
Thank for your reply,
 
Actually I just kill this error by writing the code again from scratch. I 
think the problem might be "system_matrix.clear()" is missed befor 
system_matrix.reinit().

在2022年10月12日星期三 UTC+8 04:05:32 写道:

> Hello,
>
> I can't identify the problem right away, but here are some tips in 
> debugging it:
>
>- Does the problem persist if you disable both h- and p-refinement? If 
>so, than an issue might be that your data structures haven't been 
>reinitialized after you updated your discretization.
>- Do you run the code in Debug mode?
>- Do you use the latest version of Trilinos?
>
> Marc
>
> On Sunday, October 9, 2022 at 7:02:26 AM UTC-6 yy.wayne wrote:
>
>> In step-75 I try to replace the coarse mg solver with a direct solver, 
>> which is TrilinosWrappers::SolverDirect. However I get Segmentation error 
>> calling the direct solver, at the last step of SolverDirect::solve():
>>
>> solver_control.check(0,0);
>>
>>  Where could be the mistake?  (The deal.ii version is 9.4.0)
>>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/a0bc1ad7-2d97-47c8-aba7-2b2fc95d1e51n%40googlegroups.com.


[deal.II] Re: Segmentation fault in Trilinos direct solver

2022-10-11 Thread 'yy.wayne' via deal.II User Group
... sadly after some modification the errors show again(I adapt step-29 
into this framework(involves FESystem), with matrix-based p-multigrid). I 
think the error is not on direct solver, since the coarse matrix is 
initialized successfully in Klu direct solver. However the worst thing is *no 
error information is returned*,  making it really difficult to debug. Maybe 
the problem is from transfer between MG levels? 

I'm runing on the 1.22 version deal.II virtualBox, so environment should be 
fine. 

Best,
Wayne
在2022年10月12日星期三 UTC+8 09:16:17 写道:

> Thank for your reply,
>  
> Actually I just kill this error by writing the code again from scratch. I 
> think the problem might be "system_matrix.clear()" is missed befor 
> system_matrix.reinit().
>
> 在2022年10月12日星期三 UTC+8 04:05:32 写道:
>
>> Hello,
>>
>> I can't identify the problem right away, but here are some tips in 
>> debugging it:
>>
>>- Does the problem persist if you disable both h- and p-refinement? 
>>If so, than an issue might be that your data structures haven't been 
>>reinitialized after you updated your discretization.
>>- Do you run the code in Debug mode?
>>- Do you use the latest version of Trilinos?
>>
>> Marc
>>
>> On Sunday, October 9, 2022 at 7:02:26 AM UTC-6 yy.wayne wrote:
>>
>>> In step-75 I try to replace the coarse mg solver with a direct solver, 
>>> which is TrilinosWrappers::SolverDirect. However I get Segmentation error 
>>> calling the direct solver, at the last step of SolverDirect::solve():
>>>
>>> solver_control.check(0,0);
>>>
>>>  Where could be the mistake?  (The deal.ii version is 9.4.0)
>>>
>>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/3e8340b6-59d1-44b4-a023-d0e7f91c7e8en%40googlegroups.com.


Re: [deal.II] Re: Segmentation fault in Trilinos direct solver

2022-10-11 Thread Wolfgang Bangerth

On 10/11/22 23:19, 'yy.wayne' via deal.II User Group wrote:

**

Specifically, when a Trilinos::SolverDirect object calls solve(), the line

         solver_control.check(0,0)

is not executed.
I've debuged with both QT and gdb but error information is similiar, both only 
returns a segmentation fault


Wayne:
I know nothing about the code in question, but have this advice:

The way to debug segmentation faults is to run the program in a debugger and 
do two things:
* Take a look at the backtrace (=call stack) to know where you are when the 
segfault happens
* In the debugger, go to the function where the problem happens and inspect 
the local variables. A segfault means that you are accessing memory you are 
not allowed to look at, and it is useful to know what variable it is you are 
accessing. Typically, this is either an invalid array access, or derefencing 
NULL or uninitialized pointers. You can often infer what happened if you know 
what variable causes the invalid access.


I believe that I show something like this process in one of my video lectures, 
but there are also certainly many other videos on youtube that show this 
general procedure.


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/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/fc2ed2b1-c8b6-62ff-8508-cbcfc8985f7a%40colostate.edu.