Re: [deal.II] Why is this asserted to be impossible?

2016-09-18 Thread Wolfgang Bangerth

On 09/18/2016 03:45 AM, Alex Zimmerman wrote:

I question all of the asserts in this
file: 
https://github.com/dealii/dealii/blob/master/source/numerics/vector_tools_rhs.cc

My particular case is the one on line 36, for dim = 1 and spacedim = 1.

Thanks for looking into this.


This looks like we disabled these functions back in the day when computing 
boundary integrals in 1d did not work. I think this ought to work now. What 
happens if you just remove these 4 functions from the file, recompile the 
deal.II library, and test whether the result works for your code?


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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Can we say that the higher order method, the more accurate?

2016-09-18 Thread Wolfgang Bangerth

On 09/18/2016 05:34 PM, JAEKWANG KIM wrote:

I also wonder whether their is a limitation in higher order method that deal
offer.

If no, then we can use Q10 method, just putting degree value as 10?


Yes. It will work, but you will find practical restrictions such as the fact 
that matrices become very dense and difficult to invert.


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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Can we say that the higher order method, the more accurate?

2016-09-18 Thread Wolfgang Bangerth

On 09/18/2016 03:43 PM, JAEKWANG KIM wrote:


To, Daniel Arndt.
Also, I didn't understand what you meant by
_"Are you using a Mapping of the same order as your velocity ansatz space is?"_


You will want to look at the step-10 and step-11 tutorial programs to see what 
mappings are.


You can't expect a high accuracy for a boundary integral if the boundary is 
not accurately represented.


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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] A*diag(V) with mmult?

2016-09-18 Thread Wolfgang Bangerth

On 09/18/2016 10:01 AM, 'Franck Kalala' via deal.II User Group wrote:


How to perform the matrix multiplication

A*diag(V)

where diag(V) is a diagonal matrix with the vector V in the main diagonal.

is there any such function in dealii?

how to create the SparseMatrix diag(V) for a given vector V?

to my knowledge dealii on provided

A.mmult(C,B,V)  for   C= A*diag(V)*B or

A.mmult(C,B)  for   C= A*B


Do you actually need to form the product matrix? Or are you only interested in 
*applying* this matrix to vectors?


In the latter case, the operation
  diag(V) * vec
can be achieved using the Vector::scale() function.

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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: Can we say that the higher order method, the more accurate?

2016-09-18 Thread JAEKWANG KIM
I also wonder whether their is a limitation in higher order method that 
deal offer. 

If no, then we can use Q10 method, just putting degree value as 10?  

-- 
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: Can we say that the higher order method, the more accurate?

2016-09-18 Thread JAEKWANG KIM




This is how my mesh looks like. 
I am using half domain of 2D sphere assuming that it would symmetrical 
along phi domain. 
Tho my domain is 2d, I am describing 3D phenomena. I am using cylindrical 
coordinate. 
So... in real horizontal line mean r-axis and vertical line is z-axis. 

When r=0 (so the left straight line), I used boundary condition that u_r=0 
(because there will be no flow across this axis if flow is symmetric) 

other boundary, sphere boundary condition is 0 velocity, and top,end,right 
side boundary condition is given by analytical solution (it was expressed 
in spherical coordinate, so I transferred it into cylindrical coordinate) 

To, Daniel Arndt. 
Also, I didn't understand what you meant by 
*"Are you using a Mapping of the same order as your velocity ansatz space 
is?"*


Thanks for reply!!!

-- 
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] A*diag(V) with mmult?

2016-09-18 Thread Timo Heister
Franck,

> How to perform the matrix multiplication
>
> A*diag(V)

There is no function inside the library to do this, but you can write
it yourself by scaling the entry a_ij by v_i. Code should be something
like this (not tested):

  for (SparseMatrix::iterator it=A.begin();it!=A.end(); ++it)
it->value() = it->value * v[it->column()];

Best,
Timo

On Sun, Sep 18, 2016 at 12:01 PM, 'Franck Kalala' via deal.II User
Group  wrote:
> I am having a SparseMatrix A which has a certain sparsity pattern and a
> vector V.
>
> How to perform the matrix multiplication
>
> A*diag(V)
>
> where diag(V) is a diagonal matrix with the vector V in the main diagonal.
>
> is there any such function in dealii?
>
> how to create the SparseMatrix diag(V) for a given vector V?
>
> to my knowledge dealii on provided
>
> A.mmult(C,B,V)  for   C= A*diag(V)*B or
>
> A.mmult(C,B)  for   C= A*B
>
> Cheers
>
> --
> The deal.II project is located at 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dealii.org_=CwIBaQ=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw=nutqCiVLmVstYWjGLzjVBnkpm9fqmaOfCj5dSBZ-TZM=AzRYY0doLxrkmdpDhGlH6HDbgqaABDuNDwbbd0aM2GY=
>  
> For mailing list/forum options, see
> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_forum_dealii-3Fhl-3Den=CwIBaQ=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw=nutqCiVLmVstYWjGLzjVBnkpm9fqmaOfCj5dSBZ-TZM=7v1hoCoTBoEMxL_KX9Daw91tj6p8_JXh4CUuacMt1Sg=
>  
> ---
> 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=CwIBaQ=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw=nutqCiVLmVstYWjGLzjVBnkpm9fqmaOfCj5dSBZ-TZM=tMPN5KkkAsE6vymVUM-x3zYLWLqrNf_ZjIcVzniBkDk=
>  .



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


[deal.II] Re: A*diag(V) with mmult?

2016-09-18 Thread Daniel Arndt
Franck,

One possibility is to use A.mmult(C,B,V) where B is an IdentityMatrix.
Another way is to create an IdentityMatrix B, modify its entries suitably 
and use A.mmult(C,B).
A third approach would be to just write the the scaling yourself.

Best,
Daniel

Am Sonntag, 18. September 2016 18:01:17 UTC+2 schrieb franck75:
>
> I am having a SparseMatrix A which has a certain sparsity pattern and a 
> vector V.
>
> How to perform the matrix multiplication 
>
> A*diag(V)
>
> where diag(V) is a diagonal matrix with the vector V in the main diagonal.
>
> is there any such function in dealii?
>
> how to create the SparseMatrix diag(V) for a given vector V?
>
> to my knowledge dealii on provided 
>
> A.mmult(C,B,V)  for   C= A*diag(V)*B or 
>
> A.mmult(C,B)  for   C= A*B  
>
> Cheers
>

-- 
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: Can we say that the higher order method, the more accurate?

2016-09-18 Thread Daniel Arndt
Jaekwank,

You would indeed expect significantly better results with higher polynomial 
degree on the same mesh, if the solution is sufficiently regular.
What kind of mesh are you using? Are you resolving all the boundary layers 
suitably? Are you using a Mapping of the same order as your velocity ansatz 
space is?

Best,
Daniel

Am Sonntag, 18. September 2016 17:57:16 UTC+2 schrieb JAEKWANG KIM:
>
>
> Hello, I am a starter of dealii and am learning a lot these days with the 
> help of video lectures and tutorial examples. 
>
> I modified step-22 code (stokes flow code) into my own problem, the flow 
> around sphere.
>
> and I intend to evaluate the drag force (which is analytically given by 
> stokes equation) 
>
> My code reached quite close to the value since the absolute error  : 
> abs(drag_calculated-drag_exact)/drag_exact is around 10^(-3)
>
> However, I expected that if I input higher 'degree' I will receive more 
> accurate result, but it didn't
>
> Obviously Q2 is better than Q1. and Q3 is better than Q2. But Q4 or Q4 is 
> not better than Q2 or Q3? 
>
> Is there any reason on this? 
>
> (To be specific, if i say degree 2 , that mean I use (2+1) for velocity, 
> (2) for pressure, and (2+2) for Gauss integral
>
>
> Thank you 
>
> Jaekwang Kim  
>

-- 
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*diag(V) with mmult?

2016-09-18 Thread 'Franck Kalala' via deal.II User Group
I am having a SparseMatrix A which has a certain sparsity pattern and a
vector V.

How to perform the matrix multiplication

A*diag(V)

where diag(V) is a diagonal matrix with the vector V in the main diagonal.

is there any such function in dealii?

how to create the SparseMatrix diag(V) for a given vector V?

to my knowledge dealii on provided

A.mmult(C,B,V)  for   C= A*diag(V)*B or

A.mmult(C,B)  for   C= A*B

Cheers

-- 
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] Why is this asserted to be impossible?

2016-09-18 Thread Alex Zimmerman
I question all of the asserts in this 
file: 
https://github.com/dealii/dealii/blob/master/source/numerics/vector_tools_rhs.cc

My particular case is the one on line 36, for dim = 1 and spacedim = 1.

Thanks for looking into this.


On Sunday, September 18, 2016 at 2:42:01 AM UTC+2, Wolfgang Bangerth wrote:
>
> On 09/17/2016 05:20 AM, Alex Zimmerman wrote: 
> > 
> > Not understanding why this is impossible, I began digging through the 
> code a 
> > bit and thought I would write my own 1D implementation. I noticed that 
> the 
> > code in the existing template should work correctly without any changes. 
> So 
> > instead I simply copied and renamed the template, without the 
> implementation 
> > asserting impossibility in 1D ( Assert(false, ExcImpossibleInDim(1)); ). 
> My 
> > first test ran exactly as expected. 
> > 
> > deal.II often asserts that something doesn't make sense or is impossible 
> in a 
> > certain dimension. Sometimes I agree and sometimes I don't. This is the 
> first 
> > time that it's just seemed completely wrong to me. What am I missing? 
>
> Quite possibly nothing -- we may simply be wrong. Can you point out the 
> file 
> and line where the offending Assert is located? 
>
> 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 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.