Re: [deal.II] Understanding slightly cryptic warnings from modified Step-52 code

2020-06-24 Thread Krishnakumar Gopalakrishnan
Dear Prof Bangerth,

Ah. That now was helpful. Thank you! A scrolling screenful of warnings
which wrap across multiple lines is pretty intimidating for those not so
comfortable with C++.

Hi all,
Is there a tutorial or general online resource that folks here would
recommend for debugging?

Regards,
Krishna


On Wed, 24 Jun 2020 at 23:54, Wolfgang Bangerth 
wrote:

> On 6/24/20 3:14 PM, Krishnakumar Gopalakrishnan wrote:
> > Hi,
> >
> > I am solving the basic diffusion equation using the direct method (based
> on
> > Step-52).
> >
> > I have made the following changes from Step-52 tutorial
> >
> > 1. The domain is now 1D (as opposed to 2D in step-52)
> > 2. We have Neumann BCs on both ends (left NeumannBC = 0.5, right
> NeumannBC= 0)
> > 3. Removes the code for MMS validation (i.e. no source term S(t)) so
> that we
> > solve for the unknown field variable, instead of verifying whether the
> > pre-formulated analytical solution is retrieved)
> > 4. Sets the absorpotion coefficient, Sigma_a = 0
> > 5. Sets a non-zero initial condition (but a spatially constant value).
> >
> > The C++ source code & Cmakelists.txt files are attached herewith. The
> solution
> > is indeed correct and is as expected, and I have visualised this in
> Paraview.
> > However, I'd like to understand the compilation warnings.
> >
> > Some of them have to do with "unused variables", which are somewhat
> > straightforward to get rid of. But the other warnings which all have the
> > string  "required from here" is not so clear to me.
>
> Read the error/warning message in its entirety. For example, the first one
> says
>
> /home/bangerth/p/deal.II/1/install/examples/step-1/step-1.cc: In
> instantiation
> of ‘void DiffusionEqn::SolidDiffusion::run() [with int dim = 1]’:
> /home/bangerth/p/deal.II/1/install/examples/step-1/step-1.cc:441:26:
> required from here
> /home/bangerth/p/deal.II/1/install/examples/step-1/step-1.cc:420:24:
> warning:
> variable ‘n_steps’ set but not used [-Wunused-but-set-variable]
>   unsigned int   n_steps  = 0;
>  ^~~
>
> If you strip the details, it says:
>
> In instantiation of function b() // i.e., while compiling a()
> required from here   // i.e., we got to a() while
> compiling b()
> warning: variable unused
>
> In other words, the compiler isn't just telling you where (in which
> function
> and line of code) the problem happened, but also *why* it is compiling
> this
> function (because it's called from some other place) and with which
> template
> arguments.
>
> Best
>   W.
>
> >
> > Can someone please explain what these warnings mean, and what is the
> best
> > practice for refactoring it to avoid such warnings.
> >
> > Thanks!
> > Krishna
> >
> > --
> > The deal.II project is located at http://www.dealii.org/
> > <
> https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.dealii.org%2F&data=02%7C01%7CWolfgang.Bangerth%40colostate.edu%7Cfd8a27c47f9a45cc323908d818838c1f%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637286300568833692&sdata=D5TEoM8Dk11JtvV6qM7o79260F%2BztbJpQw5M%2FVghgaU%3D&reserved=0
> >
> > For mailing list/forum options, see
> > https://groups.google.com/d/forum/dealii?hl=en
> > <
> https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fforum%2Fdealii%3Fhl%3Den&data=02%7C01%7CWolfgang.Bangerth%40colostate.edu%7Cfd8a27c47f9a45cc323908d818838c1f%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637286300568843686&sdata=XWXhcdeMs1Poa%2BSLIqCZH73Wh1wqlvqLyz%2BTXB%2FMvBo%3D&reserved=0
> >
> > ---
> > 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
> > <mailto:dealii+unsubscr...@googlegroups.com>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/dealii/d6aaa13b-5325-4f4a-9493-23859a5bcb9co%40googlegroups.com
> > <
> https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fdealii%2Fd6aaa13b-5325-4f4a-9493-23859a5bcb9co%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=02%7C01%7CWolfgang.Bangerth%40colostate.edu%7Cfd8a27c47f9a45cc323908d818838c1f%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637286300568843686&sdata=4eiKv3%2FUh9%2Bx5zjYczkUfN%2F%2Fwn8M8zpGx%2Fvccf%2FIhjs%3D&reserved=0
> >.
>
>
&g

[deal.II] Understanding slightly cryptic warnings from modified Step-52 code

2020-06-24 Thread Krishnakumar Gopalakrishnan
Hi,

I am solving the basic diffusion equation using the direct method (based on 
Step-52).

I have made the following changes from Step-52 tutorial

1. The domain is now 1D (as opposed to 2D in step-52)
2. We have Neumann BCs on both ends (left NeumannBC = 0.5, right NeumannBC= 
0)
3. Removes the code for MMS validation (i.e. no source term S(t)) so that 
we solve for the unknown field variable, instead of verifying whether the 
pre-formulated analytical solution is retrieved)
4. Sets the absorpotion coefficient, Sigma_a = 0
5. Sets a non-zero initial condition (but a spatially constant value).

The C++ source code & Cmakelists.txt files are attached herewith. The 
solution is indeed correct and is as expected, and I have visualised this 
in Paraview. However, I'd like to understand the compilation warnings. 

Some of them have to do with "unused variables", which are somewhat 
straightforward to get rid of.  But the other warnings which all have the 
string  "required from here" is not so clear to me. 

Can someone please explain what these warnings mean, and what is the best 
practice for refactoring it to avoid such warnings.

Thanks!
Krishna

-- 
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/d6aaa13b-5325-4f4a-9493-23859a5bcb9co%40googlegroups.com.
#include 
#include 
#include 

#include 
#include 
#include 

#include 
#include 

#include 
#include 
#include 
#include 
#include 

#include 
#include 

#include 
#include 

#include 
#include 
#include 
#include 

namespace DiffusionEqn
{
  using namespace dealii;


  template 
  class SolidDiffusion
  {
  public:
SolidDiffusion();

void run();

  private:
void setup_system();

void assemble_system(); // Assembles all components of matrix i.e. those
// multiplying U(t)

// This gives the numerical value of the BC (at left boundary in 1D case)
double get_boundary_neumann_value(const double time) const;

// The 'evaluate_diffusion' function below evaluates RHS of weak form of
// spatially discretised PDE (M^-1  (-Dy-Ay+S + 𝛽(t) 𝜓(0)) ). Do not forget
// that this function's return value already accounts for M^-1.

Vector evaluate_diffusion(const double  time,
  const Vector &y) const;

void output_results(const double time,
const unsigned int   time_step,
TimeStepping::runge_kutta_method method) const;

unsigned int
embedded_explicit_method(const TimeStepping::runge_kutta_method method,
 const unsigned int n_time_steps,
 const double   initial_time,
 const double   final_time);


const unsigned int fe_degree;

const double diffusion_coefficient;
const double absorption_cross_section;

Triangulation triangulation;

const FE_Q fe;

DoFHandler dof_handler;

AffineConstraints constraint_matrix;

SparsityPattern sparsity_pattern;

SparseMatrix system_matrix; // - \mathcal{D} - \mathcal{A}
SparseMatrix mass_matrix;

SparseDirectUMFPACK inverse_mass_matrix;

Vector solution;

const double b; // length of the hypercube domain in each dimension
  };


  template 
  SolidDiffusion::SolidDiffusion()
: fe_degree(3)
, diffusion_coefficient(1. / 25.) // value of D
// , diffusion_coefficient(1. / 30.) // value of D
, absorption_cross_section(0.) // value of \Sigma_a
, fe(fe_degree)
, dof_handler(triangulation)
, b(5.0)
  {}


  template 
  void SolidDiffusion::setup_system()
  {
dof_handler.distribute_dofs(fe);

constraint_matrix.close();

DynamicSparsityPattern dsp(dof_handler.n_dofs());
DoFTools::make_sparsity_pattern(dof_handler, dsp, constraint_matrix);
sparsity_pattern.copy_from(dsp);

system_matrix.reinit(sparsity_pattern);
mass_matrix.reinit(sparsity_pattern);
solution.reinit(dof_handler.n_dofs());
  }


  template 
  void SolidDiffusion::assemble_system() // Assembles all matrix components
  // i.e. those multiplying U(t)
  {
system_matrix = 0.;
mass_matrix   = 0.;

const QGauss quadrature_formula(fe_degree + 1);

FEValues fe_values(fe,
quadrature_formula,
update_values | update_gradients |
  update_JxW_values);

const unsigned int dofs_per_cell = fe.dofs_per_cell;
const unsigned int n_q_points= quadrature_formula.size();

FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell

Re: [deal.II] How to apply a spatially variable non-zero initial condition in step-52?

2020-06-07 Thread Krishnakumar Gopalakrishnan
Dear Dr Bangerth,

I tried using the VectorTools::project idea from step-25. However, my code
fails to compile, and I could not decipher the errors and do not know how
to fix this problem (have been stuck for a while).

The attached code tries to implement Step-52 (but for 1D), with homogenous
dirichelet BC  at the left edge and homogenous Neumann BC at the right
edge, with an initial value of 4/5*x*(1 - x/5) (a simple quadratic
function). I am also attaching the CMakeLists.txt (adapted from Step-52
suitably).

I'd appreciate help (from you and others here on the forum) to solve this
issue.

Krishna



On Tue, 14 Apr 2020 at 01:24, Wolfgang Bangerth 
wrote:

> On 4/13/20 6:00 PM, Krishnakumar Gopalakrishnan wrote:
> > I am currently working on Step-52, which solves the diffusion equation.
> >
> > I now want to disable the Method of Manufactured Solutions (MMS) i.e.
> get rid
> > of the forcing function which produces an expected analytical solution,
> in the
> > direction towards solving my real-world problem.  I also have set the
> > absorption coefficient to zero, so that the diffusion equation reduces
> to a
> > form analogous to the heat-equation.
> >
> > Currently, the initial condition is set to be the zero vector.
> >
> > As a first step, I'd like to set my initial solution to be sin(b*x) *
> sin(b*y).
> >
> > I am currently interested in using only the embedded explicit method
> driver
> > function. Within this, I suspect that the lines of interest are the
> following:
> >
> > solution = 0.;
> > constraint_matrix.distribute(solution);
> >
> >
> > But I am not quite sure how can this initial condition be imposed. Any
> help
> > will be much appreciated.
>
> You will want to take a look at step-25. That program uses
> VectorTools::project(), but you can also use VectorTools::interpolate()
> instead.
>
> 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 a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/l-aX46O2McY/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/462c6c7a-341d-1657-559e-d7a2a3164771%40colostate.edu
> .
>

-- 
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/CABvf3kby4Ju6HYu_bCVasyt3OBkvP%3DmPfx85E4C2Ozj6e%2Bd65g%40mail.gmail.com.
##
#  CMake script for the solid_diffusion program:
##

# Set the name of the project and target:
SET(PROJECT_NAME "solid_diffusion")
# SET(TARGET "solid_diffusion")
SET(TARGET ${PROJECT_NAME}.run)

SET(TARGET_SRC
${PROJECT_NAME}.cc
  )

# Define the output that should be cleaned:
SET(CLEAN_UP_FILES *.vtu *.pvd)

# Usually, you will not need to modify anything beyond this point...

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)

FIND_PACKAGE(deal.II 9.2.0 QUIET
  HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
  )
IF(NOT ${deal.II_FOUND})
  MESSAGE(FATAL_ERROR "\n"
"*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n"
"You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to 
cmake\n"
"or set an environment variable \"DEAL_II_DIR\" that contains this path."
)
ENDIF()

DEAL_II_INITIALIZE_CACHED_VARIABLES()
PROJECT(${TARGET})
DEAL_II_INVOKE_AUTOPILOT()


solid_diffusion.cc
Description: Binary data


[deal.II] How to apply a spatially variable non-zero initial condition in step-52?

2020-04-13 Thread Krishnakumar Gopalakrishnan
I am currently working on Step-52, which solves the diffusion equation.

I now want to disable the Method of Manufactured Solutions (MMS) i.e. get 
rid of the forcing function which produces an expected analytical solution, 
in the direction towards solving my real-world problem.  I also have set 
the absorption coefficient to zero, so that the diffusion equation reduces 
to a form analogous to the heat-equation.

Currently, the initial condition is set to be the zero vector. 

As a first step, I'd like to set my initial solution to be sin(b*x) * 
sin(b*y).

I am currently interested in using only the embedded explicit method driver 
function. Within this, I suspect that the lines of interest are the 
following:

solution = 0.;
constraint_matrix.distribute(solution);


But I am not quite sure how can this initial condition be imposed. Any help 
will be much appreciated.

-- 
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/f9b1eebb-e3d0-4847-81c9-ceb01db54a50%40googlegroups.com.


Re: [deal.II] Installation with spack - no access to adol-c

2020-03-17 Thread Krishnakumar Gopalakrishnan
I did a spack-based install of deal.ii on a 64-bit Linux machine as well as 
on a macbook pro, and didn't encounter any issues.

Krishna

On Tuesday, March 17, 2020 at 9:58:48 PM UTC, Jean-Paul Pelteret wrote:
>
> Hi Konrad,
>
> Yes, we need some version of ADOL-C greater than 2.6.3, as we upstreamed 
> some required patches to the project. I installed deal.II using Spack a few 
> weeks ago, and didn’t run into any difficulty... but I see that the Gitlab 
> project is indeed locked down, which is a bit surprising. There’s a new, 
> active repo on github (https://github.com/coin-or/ADOL-C), so maybe 
> they’ve migrated the project there. 
>
> They’ve also made several releases since the Spack package was last 
> updated (https://www.coin-or.org/download/source/ADOL-C/). This is good, 
> because you can actually get Spack to pull one of these updated versions 
> for you (if you’re willing to do the download without checksumming). The 
> syntax for that would be something like
> spack install dealii@9.1.1+adol-c ^adol-c@2.7.2
>
> I hope that this helps you. I’ll try to remember to update the Spack 
> package in the near future.
> Best,
> Jean-Paul
>
> On 17 Mar 2020, at 11:28, Konrad Simon > 
> wrote:
>
> Hi all,
>
> A colleague and myself had problems to install dealii 9.1.1 via spack.
>
> Quick question: Did anyone have problems to install deal.ii via spack 
> lately? I see that it depends on the development version of adol-c but this 
> one requires a gitlab account and access to adol-c. Does deal.ii v9.1.1 
> really depend on the development version of adol-c? Other versions <= 2.6.3 
> are on github.
>
> Best,
> Konrad
>
> -- 
> 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 dea...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/a09a369b-ef5c-48d4-bdf5-1c3c681d614c%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/67d35a46-6407-4539-a01d-4e758bbc4209%40googlegroups.com.


Re: [deal.II] How to visualise the simulation output in vtk format on a one dimensional mesh?

2020-03-17 Thread Krishnakumar Gopalakrishnan
Hi,

Thanks a lot to everyone who offered valuable help on this.

Finally, I could get Paraview to plot the 1D set of .vtu files.  Turns out
that the default viewport is set to render, and the correct one to use is
the "plot" filter which sets up a new view pane.

Krishna




On Tue, 17 Mar 2020 at 01:56, Bruno Blais  wrote:

> I concur with Wolfgang.
> The same can be done with Paraview also. I have found that using the plot
> over line tool of paraview in 1D allows to obtain animation of 1D results
> in a very beautiful and user friendly fashion.
> There is a Python VTK library by the way which allows easy (relatively)
> opening of vtk file and conversion into numpy arrays. It can be pretty
> handy, although the documentation is poor.
>
> :)!
>
>
> On Monday, 16 March 2020 13:00:57 UTC-4, Wolfgang Bangerth wrote:
>>
>> On 3/16/20 9:37 AM, Krishnakumar Gopalakrishnan wrote:
>> >
>> > Are we all agreeing that sophisticated VisIT and Paraview cannot
>> produce
>> > simple 1D visualizations/animations?
>>
>> No, we definitely do not agree :-) Attached is a visualization of the
>> output
>> when replacing all occurrences of <2> by <1> in step-3, using visit. I'm
>> showing the solution in color, elevated by the value of the solution.
>>
>>
>> > If so, there must be anAssert()
>> > pre-condition check for the DataOut::write_vtk() and
>> DataOut::write_vtu()
>> > functions of the library which return an exception with "dimension not
>> > implemented" error.
>>
>> As others have pointed out, there are other reasons to output in these
>> file
>> formats that may not include visualization with Paraview only.
>>
>> 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/AFeah4OhYe8/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/cd00bc54-d8b9-43b6-928a-51e49e54ada9%40googlegroups.com
> <https://groups.google.com/d/msgid/dealii/cd00bc54-d8b9-43b6-928a-51e49e54ada9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CABvf3kb5hYf3BARq8erxPgHBto--cTW4z-%3DJhwfLXmp2v%2Bu6iw%40mail.gmail.com.


Re: [deal.II] How to visualise the simulation output in vtk format on a one dimensional mesh?

2020-03-16 Thread Krishnakumar Gopalakrishnan
Confusingly, there are two versions of MayaVi.  MayaVi 1 and MayaVi2.  They
didn't have a brew cask, so I didn't look at it so far.  I also don't want
to learn yet another full-blown python library commands just for a one-off
visualization exercise.  I really like Praveen's solution, but again
gnuplot is yet another plotting language that I need to learn.

Can matplotlib import .vtk files and produce time-step animations?  What an
irony that 1D visualisation is harder than 2D (for non-technical reasons)
:).

Regards,
Krishna

On Mon, 16 Mar 2020 at 16:30, Bruno Turcksin 
wrote:

> Krishna,
>
> I am not an expert on visualization but I know mayavi (
> https://docs.enthought.com/mayavi/mayavi/) can read vtk and vtu. This is
> more geared towards python users though. If you think that the
> documentation is lacking, feel free to open a pull request ;-)
>
> Best,
>
> Bruno
> On 3/16/20 12:14 PM, Krishnakumar Gopalakrishnan wrote:
>
> Hi Bruno,
>
> Thanks for this information.
>
> I am genuinely curious to know about these other programs that are capable
> of reading .vtk and .vtu files.  Everyone says that these files are so
> standard, and claim that there are a lot of tools that can read them.   I
> could not find really find any general purpose visualisation software
> outside of VisIT and Paraview that reads these files.  There are also
> couple of medical simulation visualizers/toolkits that again come out of
> kitware stables.  For an open-source framework like the VTK with a business
> -riendly BSD license, it is rather surprising that no other company or
> university has built a competing product.
>
>
>
> * Some people also use vtk to transfer data between programs. *
>
> What could be examples of such work flow, especially in a 1D context?  For
> all practical purposes, 1D .vtu/.vtk files seem useless.  At least could we
> have a warning/note block of text in the write_vtu() and write_vtk() pages
> of the documentation that 1D visualisation using .vtk is a non-starter?  I
> have seen many such notes calling for the readers' attention.  I spent
> nearly two days under the belief that a 1D simulation shoud just be a walk
> in the park for the two vtk-based heavyweights.
>
>
> Regards,
> Krishna
>
>
>
>
> On Mon, 16 Mar 2020 at 15:51, Bruno Turcksin 
> wrote:
>
>> Krishna,
>>
>> VisIt and Paraview are just two of many visualization software that can
>> read .vtk and .vtu files. Some people also use vtk to transfer data between
>> programs. Why should we restrict the output because two visualization tools
>> don't support 1D?
>>
>> Best,
>>
>> Bruno
>>
>> On Monday, March 16, 2020 at 11:37:57 AM UTC-4, Krishnakumar
>> Gopalakrishnan wrote:
>>>
>>> Hi Praveen,
>>>
>>> Thank you.  That really helps. I shall definitely check it out and
>>> report back.  I just have standard Q1 linear elements in a unit (0,1)
>>> domain, solving a standard 1D diffusion problem.
>>>
>>> Are we all agreeing that sophisticated VisIT and Paraview cannot produce
>>> simple 1D visualizations/animations? If so, there must be an Assert() 
>>> pre-condition
>>> check for the DataOut::write_vtk() and DataOut::write_vtu() functions
>>> of the library which return an exception with "dimension not implemented"
>>> error.
>>>
>>> Regards,
>>> Krishna
>>>
>>>
>>>
>>> On Mon, 16 Mar 2020 at 15:31, Praveen C  wrote:
>>>
>>>> I have a 1d example here
>>>>
>>>> https://bitbucket.org/cpraveen/deal_ii/src/master/dg/1d_scalar_legendre/
>>>>
>>>> The blank lines in the output file denote different elements. It is not
>>>> necessary to sort if you use gnuplot to plot it. gnuplot makes one curve
>>>> for the solution in each element. If the FE space is continuous, you will
>>>> get a plot which is globally continuous.
>>>>
>>>> Best
>>>> praveen
>>>>
>>>> On 16-Mar-2020, at 8:50 PM, Krishnakumar Gopalakrishnan <
>>>> krish...@vt.edu> wrote:
>>>>
>>>> Hi Praveen,
>>>>
>>>> Thanks for your reply. Yes, I had success with gnuplot, but the
>>>> following were the difficulties.
>>>>
>>>>1. Weirdly, the x-axis co-ordinates of the mesh are not sorted in a
>>>>particular order (they appear rather randomly, arranged in  groups of 2
>>>>rows with blank lines between them).
>>>>2. The time-animation is not easy to 

Re: [deal.II] How to visualise the simulation output in vtk format on a one dimensional mesh?

2020-03-16 Thread Krishnakumar Gopalakrishnan
Hi Bruno,

Thanks for this information.

I am genuinely curious to know about these other programs that are capable
of reading .vtk and .vtu files.  Everyone says that these files are so
standard, and claim that there are a lot of tools that can read them.   I
could not find really find any general purpose visualisation software
outside of VisIT and Paraview that reads these files.  There are also
couple of medical simulation visualizers/toolkits that again come out of
kitware stables.  For an open-source framework like the VTK with a business
-riendly BSD license, it is rather surprising that no other company or
university has built a competing product.



* Some people also use vtk to transfer data between programs. *

What could be examples of such work flow, especially in a 1D context?  For
all practical purposes, 1D .vtu/.vtk files seem useless.  At least could we
have a warning/note block of text in the write_vtu() and write_vtk() pages
of the documentation that 1D visualisation using .vtk is a non-starter?  I
have seen many such notes calling for the readers' attention.  I spent
nearly two days under the belief that a 1D simulation shoud just be a walk
in the park for the two vtk-based heavyweights.


Regards,
Krishna




On Mon, 16 Mar 2020 at 15:51, Bruno Turcksin 
wrote:

> Krishna,
>
> VisIt and Paraview are just two of many visualization software that can
> read .vtk and .vtu files. Some people also use vtk to transfer data between
> programs. Why should we restrict the output because two visualization tools
> don't support 1D?
>
> Best,
>
> Bruno
>
> On Monday, March 16, 2020 at 11:37:57 AM UTC-4, Krishnakumar
> Gopalakrishnan wrote:
>>
>> Hi Praveen,
>>
>> Thank you.  That really helps. I shall definitely check it out and report
>> back.  I just have standard Q1 linear elements in a unit (0,1) domain,
>> solving a standard 1D diffusion problem.
>>
>> Are we all agreeing that sophisticated VisIT and Paraview cannot produce
>> simple 1D visualizations/animations? If so, there must be an Assert() 
>> pre-condition
>> check for the DataOut::write_vtk() and DataOut::write_vtu() functions of
>> the library which return an exception with "dimension not implemented"
>> error.
>>
>> Regards,
>> Krishna
>>
>>
>>
>> On Mon, 16 Mar 2020 at 15:31, Praveen C  wrote:
>>
>>> I have a 1d example here
>>>
>>> https://bitbucket.org/cpraveen/deal_ii/src/master/dg/1d_scalar_legendre/
>>>
>>> The blank lines in the output file denote different elements. It is not
>>> necessary to sort if you use gnuplot to plot it. gnuplot makes one curve
>>> for the solution in each element. If the FE space is continuous, you will
>>> get a plot which is globally continuous.
>>>
>>> Best
>>> praveen
>>>
>>> On 16-Mar-2020, at 8:50 PM, Krishnakumar Gopalakrishnan 
>>> wrote:
>>>
>>> Hi Praveen,
>>>
>>> Thanks for your reply. Yes, I had success with gnuplot, but the
>>> following were the difficulties.
>>>
>>>1. Weirdly, the x-axis co-ordinates of the mesh are not sorted in a
>>>particular order (they appear rather randomly, arranged in  groups of 2
>>>rows with blank lines between them).
>>>2. The time-animation is not easy to visualize.  Paraview has a nice
>>>animation player for such sets of .vtu files.
>>>
>>> Is there some trick to visualize time-series of 1D spatial data?
>>>
>>>
>>> Regards,
>>> Krishna
>>>
>>>
>>> --
> 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/AFeah4OhYe8/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/f100beb0-9b91-482e-8e70-16939014ef61%40googlegroups.com
> <https://groups.google.com/d/msgid/dealii/f100beb0-9b91-482e-8e70-16939014ef61%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CABvf3kZa%2B__LvjON9AwH_XKw93fYyUDO7hNHvYRz%3D3Jzg9vs8g%40mail.gmail.com.


Re: [deal.II] How to visualise the simulation output in vtk format on a one dimensional mesh?

2020-03-16 Thread Krishnakumar Gopalakrishnan
Hi Praveen,

Thank you.  That really helps. I shall definitely check it out and report
back.  I just have standard Q1 linear elements in a unit (0,1) domain,
solving a standard 1D diffusion problem.

Are we all agreeing that sophisticated VisIT and Paraview cannot produce
simple 1D visualizations/animations? If so, there must be an Assert()
pre-condition
check for the DataOut::write_vtk() and DataOut::write_vtu() functions of
the library which return an exception with "dimension not implemented"
error.

Regards,
Krishna



On Mon, 16 Mar 2020 at 15:31, Praveen C  wrote:

> I have a 1d example here
>
> https://bitbucket.org/cpraveen/deal_ii/src/master/dg/1d_scalar_legendre/
>
> The blank lines in the output file denote different elements. It is not
> necessary to sort if you use gnuplot to plot it. gnuplot makes one curve
> for the solution in each element. If the FE space is continuous, you will
> get a plot which is globally continuous.
>
> Best
> praveen
>
> On 16-Mar-2020, at 8:50 PM, Krishnakumar Gopalakrishnan 
> wrote:
>
> Hi Praveen,
>
> Thanks for your reply. Yes, I had success with gnuplot, but the following
> were the difficulties.
>
>1. Weirdly, the x-axis co-ordinates of the mesh are not sorted in a
>particular order (they appear rather randomly, arranged in  groups of 2
>rows with blank lines between them).
>2. The time-animation is not easy to visualize.  Paraview has a nice
>animation player for such sets of .vtu files.
>
> Is there some trick to visualize time-series of 1D spatial data?
>
>
> Regards,
> Krishna
>
>
>

-- 
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/CABvf3kawgy%2BzfKJmHuNVj_3Q0B0BY%2BRF%3DMFLextho0rR04Q2NQ%40mail.gmail.com.


Re: [deal.II] How to visualise the simulation output in vtk format on a one dimensional mesh?

2020-03-16 Thread Krishnakumar Gopalakrishnan
Hi Praveen,

Thanks for your reply. Yes, I had success with gnuplot, but the following
were the difficulties.

   1. Weirdly, the x-axis co-ordinates of the mesh are not sorted in a
   particular order (they appear rather randomly, arranged in  groups of 2
   rows with blank lines between them).
   2. The time-animation is not easy to visualize.  Paraview has a nice
   animation player for such sets of .vtu files.

Is there some trick to visualize time-series of 1D spatial data?


Regards,
Krishna




On Mon, 16 Mar 2020 at 15:16, Praveen C  wrote:

> For 1d, you can save data in gnuplot format
>
>
> https://www.dealii.org/current/doxygen/deal.II/classDataOutInterface.html#a85407e870a68179ebe62410d9efc153f
>
> and use gnuplot to visualize it.
>
> Best
> praveen
>
> On 16-Mar-2020, at 8:33 PM, Krishnakumar Gopalakrishnan 
> wrote:
>
> Same as before -- have you actually tried this? Because I think they do
> just fine with 1d solutions!
>
>
>- Yes. Nothing shows up on the viewport. I thought it might be because
>I have just a 1D mesh.  Then looking at Paraview's official
>tutorial/documentation, the very first sentence of Chapter 1 Introduction
>says  *"ParaView is an open-source application for visualizing two-
>and three- dimensional data sets."*
>
> This raises doubts in one's head that 1D meshes are not supported. This is
> why I posted my question here. I haven't still been able to visualize my 1D
> simulation results.
>
> Regards,
> Krishna
>
>
>

-- 
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/CABvf3kYCeRhqP_N3vuY7mmswE_464%3Dhohg0JdFHY6mmt5j%3DV-A%40mail.gmail.com.


Re: [deal.II] How to visualise the simulation output in vtk format on a one dimensional mesh?

2020-03-16 Thread Krishnakumar Gopalakrishnan
Same as before -- have you actually tried this? Because I think they do
just fine with 1d solutions!


   - Yes. Nothing shows up on the viewport. I thought it might be because I
   have just a 1D mesh.  Then looking at Paraview's official
   tutorial/documentation, the very first sentence of Chapter 1 Introduction
   says  *"ParaView is an open-source application for visualizing two- and
   three- dimensional data sets."*

This raises doubts in one's head that 1D meshes are not supported. This is
why I posted my question here. I haven't still been able to visualize my 1D
simulation results.

Regards,
Krishna


On Mon, 16 Mar 2020 at 00:22, Wolfgang Bangerth 
wrote:

> On 3/15/20 1:50 PM, Krishnakumar Gopalakrishnan wrote:
> >
> > It looks like both paraview and VTK can only visualise 2D/3D meshes?
> What's
> > the best way to visualise 1D outputs?
>
> Same as before -- have you actually tried this? Because I think they do
> just
> fine with 1d solutions!
>
> 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 a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/AFeah4OhYe8/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/6d6325ea-0384-03f1-6d03-758535579247%40colostate.edu
> .
>

-- 
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/CABvf3ka5Css8HOFGOcJeSLs9dO1s1LrNeJ%3DQs6R%3Df%2BV8rWCrrg%40mail.gmail.com.


[deal.II] How to visualise the simulation output in vtk format on a one dimensional mesh?

2020-03-15 Thread Krishnakumar Gopalakrishnan
Using deal.ii, I got the results of a time-dependent 1D diffusion equation 
written to disk as a set of .vtu files (one per time-step).

It looks like both paraview and VTK can only visualise 2D/3D meshes? What's 
the best way to visualise 1D outputs?

Regards,
Krishna


-- 
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/32f5772f-02a7-4e49-ba1c-0b3c5018273b%40googlegroups.com.


Re: [deal.II] Accessing a particular boundary in one-dimensional case

2020-03-15 Thread Krishnakumar Gopalakrishnan
Have you tried this? I think it should work, but it will be faster for you
(and for us) if you just played with stuff and tried whether it actually
works :-)

   - Yay! That actually worked. Thank you all the help. I now have some
   working code to start with.

Regards,
Krishna


On Fri, 13 Mar 2020 at 23:47, Wolfgang Bangerth 
wrote:

> On 3/13/20 5:34 PM, Krishnakumar Gopalakrishnan wrote:
> >
> > Looking at step-7 and adapting it a little bit, does the following code
> look
> > reasonable to mark the boundary ID of the left edge as '1' for later
> setting
> > its flux?
> >
> > for (const auto &cell : triangulation.cell_iterators
> > <
> https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdealii.org%2Fdeveloper%2Fdoxygen%2Fdeal.II%2Fgroup__CPP11.html%23ga7295c669f32e78c45446ddc236f19136&data=02%7C01%7CWolfgang.Bangerth%40colostate.edu%7C78a1855a0a7a4b3ac25608d7c7a716c5%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637197392773455746&sdata=c5HWHjdx99F5AhA4Si5Zesfqc3krTMVywMf6E7nso2Y%3D&reserved=0
> >())
> > for (const auto &face : cell->face_iterators())
> >  {
> > const auto center = face->center();
> > if (std::fabs(center(0)) < 1e-12)
> >   face->set_boundary_id(1);
> >  }
> >
> >
> > This is based on my assumption that center(0) method of a face iterator
> shall
> > return the actual co-ordinate itself (since in the 1D case, the face
> > degenerates to a single point and its center is the same).
>
> Have you tried this? I think it should work, but it will be faster for you
> (and for us) if you just played with stuff and tried whether it actually
> works :-)
>
>
> > On a related note,
> > when we use the arrow operator, under which page should I look up the
> > documentation. Searching for center() returns a whole lot of results in
> doxygen.
>
> The class in question is TriaAccessor.
>
> Best
>   WB
>
> --
> 
> 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 a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/fbWdIUNF-SI/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/f8095857-cb3a-360c-34e9-a54ba561b27c%40colostate.edu
> .
>

-- 
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/CABvf3kYz3mzVcHc2PLRA0t%3D5Tc8Fj%3Dvzk4zeujm3pGqt44gGnA%40mail.gmail.com.


[deal.II] Accessing a particular boundary in one-dimensional case

2020-03-13 Thread Krishnakumar Gopalakrishnan
For a one-dimensional unit domain (0,1), if one needs to set non-homogenous 
Neumann BC at a particular end of the domain (say the left end, x=0),

Looking at step-7 and adapting it a little bit, does the following code 
look reasonable to mark the boundary ID of the left edge as '1' for later 
setting its flux?

for (const auto &cell : triangulation.cell_iterators 

())
for (const auto &face : cell->face_iterators())
{
 const auto center = face->center();
 if (std::fabs(center(0)) < 1e-12)
 face->set_boundary_id(1);
}


This is based on my assumption that center(0) method of a face iterator 
shall return the actual co-ordinate itself (since in the 1D case, the face 
degenerates to a single point and its center is the same). On a related 
note, when we use the arrow operator, under which page should I look up the 
documentation. Searching for center() returns a whole lot of results in 
doxygen.

-- 
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/415017fc-c2ec-4463-b51d-feee4d7493b2%40googlegroups.com.


Re: [deal.II] Linearizing a non-linear diffusion equation by using value from previous-time step for the non-linear part (Rothe method)

2020-03-13 Thread Krishnakumar Gopalakrishnan

   
   - *Yes, it's a good step. But it implies that you get a restriction on 
   the time step size. *


Does that become severe even if I use the present time-step for all other 
terms? In the \nabla ( D(u) u) term, I will replace only D(u) with the 
previous time-steps and retain the u^{n} to be at the current time-step.

So, the time-step restriction should not be as bad as the fully explicit 
case, right?

   - *You can also replace D(u^n) by D(u^*) where u^* is extrapolated from 
   the previous two or three time steps. That's a more accurate approximation 
   than just using u^{n-1}. *

That sounds perfect. Thank you. Is there any suitable functions from 
deal.ii that I can use for this extrapolation?  Is there any tutorial that 
already does something this?

Regards,
Krishna

On Friday, March 13, 2020 at 7:34:51 PM UTC, Wolfgang Bangerth wrote:
>
> On 3/13/20 12:59 PM, Krishnakumar Gopalakrishnan wrote: 
> > I have a non-linear diffusion equation of the form 
> > 
> > du/dt = \nabla.( D(u) \grad u) 
> > 
> > The non-linearity appears because of the dependence of the diffusion 
> > coefficient on the solution. 
> > 
> > When discretising by the Rothe method, applying backward Euler method in 
> > the strictest sense: 
> > 
> > (u^n - u^{n-1})/k^n  - \nabla. ( D(u^n) ) * \grad{u^n})  = 0 
> > 
> > This would require Newton iterations and such complications.  Is it okay 
> > to simply use the numerical value of D from the previous time-step? 
> > 
> > (u^n - u^{n-1})/k^n  - \nabla. ( D(u^{n-1}) ) * \grad{u^n})  = 0 
> > 
> > In this case, we get a nice linear equation, and most of step-26 can be 
> > used as.  D(u) is a continuous function of u. Is this semi-explicit type 
> > of usage of diffusion coefficient, a reasonable way to tackle this 
> problem? 
>
> Yes, it's a good step. But it implies that you get a restriction on the 
> time step size. 
>
> You can also replace D(u^n) by D(u^*) where u^* is extrapolated from the 
> previous two or three time steps. That's a more accurate approximation 
> than just using u^{n-1}. 
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/fe0e269e-f9b0-447f-9489-021425dc44a9%40googlegroups.com.


[deal.II] Linearizing a non-linear diffusion equation by using value from previous-time step for the non-linear part (Rothe method)

2020-03-13 Thread Krishnakumar Gopalakrishnan
I have a non-linear diffusion equation of the form

du/dt = \nabla.( D(u) \grad u) 

The non-linearity appears because of the dependence of the diffusion 
coefficient on the solution.

When discretising by the Rothe method, applying backward Euler method in 
the strictest sense:

(u^n - u^{n-1})/k^n  - \nabla. ( D(u^n) ) * \grad{u^n})  = 0

This would require Newton iterations and such complications.  Is it okay to 
simply use the numerical value of D from the previous time-step?

(u^n - u^{n-1})/k^n  - \nabla. ( D(u^{n-1}) ) * \grad{u^n})  = 0

In this case, we get a nice linear equation, and most of step-26 can be 
used as.  D(u) is a continuous function of u. Is this semi-explicit type of 
usage of diffusion coefficient, a reasonable way to tackle this problem?


-- 
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/68da12d0-ef9b-4cdf-bb86-126c343f3fbc%40googlegroups.com.


Re: [deal.II] Initial guidance/starting point for solving a non-linear diffusion equation with double neumann BCs

2020-03-13 Thread Krishnakumar Gopalakrishnan
Hi Daniel,

Thank you for your reply. I had seen all the tutorials you mentioned.

Let me further clarify some of the things in my PDE that are somewhat
different from the tutorials.

1. Unlike Step-7, I have Neumann-only BCs. In my prior experience with the
FD and FV methods, this is a difficult problem. Is there any specific
advice that can help me with this?

2. Step-15 solves a static non-linear problem and step-26 solves a linear
time-dependent problem. I somehow need to combine these ideas to solve my
non-linear time-dependent problem.  Does this mean, I first make the
problem a static one by time discretisation (Rothe method), and apply
Newton iterations at every time step. Also, it scares me to derive the
Newton update equation symbolically and was thinking of automatic
differentiation. Can this be done in an easier way than the sacado package
interface? Also, the amount of boiler-plate code and text (step-33) for
this auto diff is overwhelming for me.

Regards,
Krishna








On Fri, 13 Mar, 2020, 3:01 AM Daniel Arndt,  wrote:

> Krishna,
>
> Have a look at step-7 for Neumann boundary conditions, step-15 for
> nonlinear problems and step-26 for time-dependent problems to get started.
> Let us know if you have more specific questions.
>
> Best,
> Daniel
>
> Am Do., 12. März 2020 um 17:38 Uhr schrieb Krishnakumar Gopalakrishnan <
> krish...@vt.edu>:
>
>> I need to solve the following non-linear diffusion equation on a unit 1D
>> domain:
>>
>> du/dt = \nabla \dot ( D(u) \grad u)
>>
>> subject to Neumann bcs at both ends. D(u)*grad(u) = f(t) at x=0, and
>> D(u)*grad(u) = 0 at x=1, with a constant initial condition u(x,0) = u0
>>
>> The difficulty with this problem is two fold
>>
>>- The diffusion coefficient D is a function of the field variable u,
>>- Diffusion coefficient D(u) varies by 4 orders of magnitute between
>>10^-12 and 10^-16
>>
>> Being 1D, the problem size is very small and I am thnking of just using
>> direct solvers. However, I don't quite know how to start approaching this
>> problem and how to begin the coding this in deal.ii.
>>
>> I'd appreciate any thoughts/help/suggestions/guidance from the deal.II
>> community.
>>
>> Regards,
>> Krishna
>>
>>
>>
>> --
>> 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/3c0a13b9-1d59-443d-97bf-5a95440281d3%40googlegroups.com
>> <https://groups.google.com/d/msgid/dealii/3c0a13b9-1d59-443d-97bf-5a95440281d3%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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/xX4IMnVymCw/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/CAOYDWbK8fuCwiTQPjKO%2BaNhtLeAvCtXonskzS5%2BBha8CEkjw3w%40mail.gmail.com
> <https://groups.google.com/d/msgid/dealii/CAOYDWbK8fuCwiTQPjKO%2BaNhtLeAvCtXonskzS5%2BBha8CEkjw3w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CABvf3kY4WUPvLnCtac6wA%2BhXtLVE4TUeQnqBQ6D2Bvg0u7ez2w%40mail.gmail.com.


[deal.II] Initial guidance/starting point for solving a non-linear diffusion equation with double neumann BCs

2020-03-12 Thread Krishnakumar Gopalakrishnan
I need to solve the following non-linear diffusion equation on a unit 1D 
domain:

du/dt = \nabla \dot ( D(u) \grad u)

subject to Neumann bcs at both ends. D(u)*grad(u) = f(t) at x=0, and 
D(u)*grad(u) = 0 at x=1, with a constant initial condition u(x,0) = u0

The difficulty with this problem is two fold

   - The diffusion coefficient D is a function of the field variable u,
   - Diffusion coefficient D(u) varies by 4 orders of magnitute between 
   10^-12 and 10^-16

Being 1D, the problem size is very small and I am thnking of just using 
direct solvers. However, I don't quite know how to start approaching this 
problem and how to begin the coding this in deal.ii.

I'd appreciate any thoughts/help/suggestions/guidance from the deal.II 
community.

Regards,
Krishna



-- 
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/3c0a13b9-1d59-443d-97bf-5a95440281d3%40googlegroups.com.


Re: [deal.II] Question on copyright, licensing, authorship & attribution for reuse of (parts of) tutorial programs

2020-03-12 Thread Krishnakumar Gopalakrishnan
Thank you so much for your kind explanation.

I thought that maybe the common landing page for all the tutorials (the one 
with the graphviz dot-diagram relationship) is a possible candidate. But I 
understand why its probably also not the best since most pages have already 
lengthy content and any additional wording is better reserved for technical 
explanations.

Regards,
Krishna

On Thursday, March 12, 2020 at 2:05:41 PM UTC, Wolfgang Bangerth wrote:
>
>
> > /"But they're all licensed under the same LGPL license."/ 
> > 
> > Ah. I get it now. The library includes the tutorials as well, right? So 
> LGPL 
> > should apply everywhere. 
>
> Correct. Every tutorial file says that on line 8 :-) 
>
>
> > This is confusing because the number of deal.ii based user programs are 
> two 
> > orders of magnitude larger than the number of code gallery programs. 
> What is 
> > the vetting process of submissions and acceptance to the code-gallery? 
> Is this 
> > documented somewhere? 
>
> Yes, there are many more programs out there. But not everyone wants to 
> share 
> theirs. The procedure for contributing is documented if you hit the third 
> of 
> the orange buttons on the page I linked to: 
>https://dealii.org/code-gallery.html 
>
>
> > Is there a mechanism of linking an existing public 
> github/gitlab/bitbucket 
> > repo to the code gallery? That would be very useful since any time the 
> authors 
> > update their codes in github, the code gallery picks it up, and everyone 
> can 
> > benefit from the latest codes. 
>
> We don't have this kind of mechanism. But I think it's also the right 
> thing to 
> do to freeze the status of these programs at a time of submission. 
> Otherwise, 
> programs may work one day but not the next if you use someone's code you 
> don't 
> know, and the documentation may not actually describe the code as it is. 
>
>
> > /Copyright: You own what you wrote. We continue to own whatever we wrote 
> in 
> > your program (and grant you the right to use what we own as long as you 
> stay 
> > within the confines of the license). 
> > / 
> > / 
> > / 
> > So, at the top of my source code (licensed under LGPL), if I explicitly 
> assert 
> > my own copyright on a line of text, and below that just say "This 
> program is 
> > based on the step-xx tutorial of deal.II", will that be sufficient to 
> cover 
> > all the copyrights involved? 
>
> You're overthinking this. This is sufficient, but the point is that we 
> *want* 
> you to use our codes. 
>
>
> > All the information discussed so far in this question might be very 
> helpful if 
> > posted on the tutorial landing page in the deal.ii website. Anyone who 
> is 
> > looking to write code based on the tutorials can potentially benefit 
> from this 
> > info. 
>
> Like so many other pieces of information, it would be useful to state, but 
> there is no good place, and every place I can think of would distract from 
> lessons I think are far more important to teach at that place... 
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f38379b4-5677-48d5-9c94-f11d31ec8a8b%40googlegroups.com.


Re: [deal.II] Question on copyright, licensing, authorship & attribution for reuse of (parts of) tutorial programs

2020-03-12 Thread Krishnakumar Gopalakrishnan
Thank you so much for your answers.

*"But they're all licensed under the same LGPL license."*

Ah. I get it now. The library includes the tutorials as well, right? So 
LGPL should apply everywhere.

* In particular, that's why we came up  with the code gallery:
https://dealii.org/code-gallery.html *

This is confusing because the number of deal.ii based user programs are two 
orders of magnitude larger than the number of code gallery programs. What 
is the vetting process of submissions and acceptance to the code-gallery? 
Is this documented somewhere?
Is there a mechanism of linking an existing public github/gitlab/bitbucket 
repo to the code gallery? That would be very useful since any time the 
authors update their codes in github, the code gallery picks it up, and 
everyone can benefit from the latest codes.



*Copyright: You own what you wrote. We continue to own whatever we wrote in 
your program (and grant you the right to use what we own as long as you 
stay within the confines of the license). *

So, at the top of my source code (licensed under LGPL), if I explicitly 
assert my own copyright on a line of text, and below that just say "This 
program is based on the step-xx tutorial of deal.II", will that be 
sufficient to cover all the copyrights involved?

All the information discussed so far in this question might be very helpful 
if posted on the tutorial landing page in the deal.ii website. Anyone who 
is looking to write code based on the tutorials can potentially benefit 
from this info.

Regards,
Krishna


On Thursday, March 12, 2020 at 1:33:05 PM UTC, Wolfgang Bangerth wrote:
>
>
> > I see that some later tutorial programs have dois on Zenodo and certain 
> open 
> > licences attached to them.  However, most of the earlier tutorials do 
> not have 
> > this.  All of them do have a copyright line containing the author and 
> years. 
>
> But they're all licensed under the same LGPL license. 
>
>
> > The following are my specific questions: 
> > 
> >  1. Am I allowed to reuse one of the earlier tutorials as is and report 
> the 
> > simulation results (my project needs some additional post processing 
> of 
> > the FE solution field) in a journal publication? How would I 
> attribute this? 
>
> Yes, the license allows this. But like with all other uses of previously 
> known 
> material, standard scientific procedures state that you should cite your 
> sources. In the current case, add a reference to the tutorial program you 
> are 
> using. For example, this would work: 
>
> @Misc{dealiistep32, 
>author =   {M. Kronbichler and T. Heister and W. Bangerth}, 
>title ={deal.{II} tutorial program step-32, 
> \url{http://www.dealii.org/developer/doxygen/deal.II/step_32.html}}, 
>year = 2020 
> } 
>
> as would this: 
>
> @Book{step-49, 
> title = {The deal.II tutorial: step-49}, 
> year = 2013, 
> publisher = {
> https://www.dealii.org/developer/doxygen/deal.II/step\_49.html}, 
> author = {Timo Heister and Yuhan Zhou and Wolfgang Bangerth and David 
> Wells} 
> } 
>
> For some tutorials, no authors are easily identifiable. In that case, 
> either 
> omit the author list or list them as "The deal.II authors". 
>
>
> >  2. If I modify the tutorial code for my project, am I allowed to link 
> my 
> > github repo to the publication? What really constitutes a 
> modification of 
> > software code in general, and tutorial code in particular? 
> >   * Have time-dependent boundary conditions 
> >   * The generic variables of the tutorials will be renamed to the 
> > project-specific variables 
> >   * instead of the typical CG iterations, since the problem size is 
> small, 
> > replace it with direct solver 
> >   * Finally the problem is run in 1D 
> >   * Better refinement strategy if time permits 
> > 
> > If I were to embark on such an exercise i.e. make available an 
> open-source 
> > code linked to a journal publication, What would be my 
> > 
> >   * copyright and authorship rights? 
> >   * licensing and attribution requirements? 
>
> Up front: Of course we highly encourage this to happen! That's what we 
> write 
> deal.II for: So people use it for their own projects and, ideally, make 
> these 
> projects available to others as well. In particular, that's why we came up 
> with the code gallery: 
>https://dealii.org/code-gallery.html 
>
> The technical details governed by the license of deal.II. In particular, 
> if 
> you make your code available to anyone else, you need to license your code 
> in 
> a way that is compatible with the LGPL. For all practical purposes, that 
> will 
> mean that you have to license your code under either the GPL or the LGPL. 
> It 
> is of course always good practice to be open about where parts of your 
> code 
> come from, so it would make sense if there was a readme file or a comment 
> at 
> the top of your code that says 
>This progr

Re: [deal.II] Question about the advice about regularity of the stokes' equations in Step-22

2020-03-12 Thread Krishnakumar Gopalakrishnan
*"We do the same on the velocity. That's why we integrate by parts the 
form"*

Thank you so much for clarifying. That explains it, and I now understand 
this fully.  The original sentence was a bit misleading. "In practice, one 
wants to impose as little regularity on the pressure variable as possible". 
For someone who hasn't studied fluid dynamics, it can potentially plant 
doubts in one's head to mean something like:

*"Perhaps there exists some special mathematical considerations informed by 
the physics of the pressure variable that requires it be as less regular as 
possible, and therefore maybe some extra work and careful thought is needed 
specifically for this problem, which is somehow different from all others 
studied in tutorials so far".  *

I shall now de-emphase this in my mind and take this sentence to mean as* 
"In practice, one wants to impose as little regularity on the pressure 
variable as possible (just like every field variable solved by the Galerkin 
method in every tutorial thus far)".*

Thanks a lot once again for the clarification. Apologies for asking such 
basic questions.

Regards,
Krishna


On Wednesday, March 11, 2020 at 9:20:56 PM UTC, Wolfgang Bangerth wrote:
>
> On 3/10/20 12:59 PM, Krishnakumar Gopalakrishnan wrote: 
> > Step-22 has a strong-sounding stub-like statement:/"In practice, one 
> > wants to impose as little regularity on the pressure variable as 
> possible". 
> > / 
> > / 
> > / 
> > The above one-liner (fairly enough) assumes domain knowledge. As a new 
> > entrant to deal.ii (haven't studied fluid mechanics before), may I ask 
> > the following? 
> > 
> >  1. Why do we impose as little regularity on the pressure as possible? 
>
> We do the same on the velocity. That's why we integrate by parts the form 
>\int v (-Delta u) 
> to 
>\int \nabla v . \nabla u 
>
>
> >  2. When I attempt to solve my own PDE (outside traditional areas such 
> > as fluid or structural mechanics), what properties should I know 
> > about the field variable to correctly apply the procedure and 
> > learnings from this tutorial, i.e. what exactly is the regularity 
> > condition mentioned here? 
>
> You'll have to take a second course on PDEs, and most importantly learn 
> a bit about the theory of weak solutions. Here's a patch that explains 
> this in about as much detail as I would like to go into: 
>https://github.com/dealii/dealii/pull/9652/files 
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/dbb1c13c-6d02-42f4-a6c0-7689c5ba321a%40googlegroups.com.


[deal.II] Question on copyright, licensing, authorship & attribution for reuse of (parts of) tutorial programs

2020-03-12 Thread Krishnakumar Gopalakrishnan
While, I understand that deal.Ii (the library itself) is licensed under 
LGPL 2.1 or above, this question is about reuse of tutorial programs in own 
research.

I see that some later tutorial programs have dois on Zenodo and certain 
open licences attached to them.  However, most of the earlier tutorials do 
not have this.  All of them do have a copyright line containing the author 
and years.

The following are my specific questions:

   1. Am I allowed to reuse one of the earlier tutorials as is and report 
   the simulation results (my project needs some additional post processing of 
   the FE solution field) in a journal publication? How would I attribute this?
   2. If I modify the tutorial code for my project, am I allowed to link my 
   github repo to the publication? What really constitutes a modification of 
   software code in general, and tutorial code in particular? 
  - Have time-dependent boundary conditions 
  - The generic variables of the tutorials will be renamed to the 
  project-specific variables
   - instead of the typical CG iterations, since the problem size is small, 
  replace it with direct solver 
  - Finally the problem is run in 1D
  - Better refinement strategy if time permits
  
If I were to embark on such an exercise i.e. make available an open-source 
code linked to a journal publication, What would be my

   - copyright and authorship rights?
   - licensing and attribution requirements?


Regards,
Krishna

-- 
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/d928933c-05ed-42d4-b875-09d258dbbdc9%40googlegroups.com.


Re: [deal.II] How to determine the saddle-point nature of PDEs like those in Step-20, 21?

2020-03-11 Thread Krishnakumar Gopalakrishnan
Dear Prof Bangerth.

Thank you for your reply.

I had seen that github issue/pull-request, but didn't realise that
"saddle-point problems = (indefinite + symmetric)". These three words do
not appear in close-proximity to each other anywhere in the slides,
tutorials or video lectures. While I acknowledge the importance of
mathematical terminology, perhaps it would be quite useful to de-jargonise
this for the newcomers?

Now, my question becomes "how to test for definiteness and symmetric nature
of my DAEs?", i.e. simply by looking at the weak form of the equation which
consists of only symbolic notations, can one somehow infer the
definiteness/symmetry of the matrix?

Regards,
Krishna

On Wed, 11 Mar 2020 at 17:17, Wolfgang Bangerth 
wrote:

> On 3/11/20 7:57 AM, Krishnakumar Gopalakrishnan wrote:
> > In Step-21 tutorial, we have a statement that starts with the following
> > (emphasis is mine):
> >
> > /_"Given the saddle point structure_ of the first two equations and
> > their similarity to the mixed Laplace formulation we have introduced in
> > step-20
> > <
> https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdealii.org%2Fdeveloper%2Fdoxygen%2Fdeal.II%2Fstep_20.html&data=02%7C01%7CWolfgang.Bangerth%40colostate.edu%7Ccd1596e29c4a427d467808d7c5c41aa8%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C1%7C637195318357612315&sdata=1Y%2Fp8SQc%2F2YETGls%2FU5J8XPtkz5JLEZW%2FYGdLEnM9rc%3D&reserved=0
> >"/
> > /
> > /
> > //
> > It would be helpful if someone could explain the saddle-point structure
> > of the problem (and/or point to some easily readable online resources).
>  > [...]
> > However, I'd really appreciate if there was some "simple test" or
> > practical advice to determine whether our own PDEs and DAEs belong to
> > the saddle-point category or not, i.e. how to detect the presence of
> > saddle-point nature of the PDEs, just simulate with Qp elements and look
> > for a checkerboard pattern in the results?
>
> I thought we had addressed this a while ago already:
>https://github.com/dealii/dealii/pull/9470/files
>
> Is that not enough? Or is the issue that the text added there just says
> "indefinite", whereas you are looking for the term "saddle point problem"?
>
> I think a good approximation is that
>saddle point problem = indefinite + symmetric
>
> We could presumably add this there.
>
> 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/CABvf3kZWr2iWJOJ%2BtrxuDYrPfBCFzCe%3D4JzMmTBthEosf6Z-Tw%40mail.gmail.com.


[deal.II] How to determine the saddle-point nature of PDEs like those in Step-20, 21?

2020-03-11 Thread Krishnakumar Gopalakrishnan
In Step-21 tutorial, we have a statement that starts with the following 
(emphasis is mine):

*"Given the saddle point structure of the first two equations and their 
similarity to the mixed Laplace formulation we have introduced in step-20 
"*

It would be helpful if someone could explain the saddle-point structure of 
the problem (and/or point to some easily readable online resources).  
Before coming to this Step-21 tutorial, I have gone through Step-20 
tutorial wherein again the saddle-point nature of the problem is not 
explained.  In fact, it is entirely glossed over:

*"It is a well-known fact stated in almost every book on finite element 
theory that if one chooses discrete finite element spaces for the 
approximation of u,p inappropriately, then the resulting discrete 
saddle-point problem is instable and the discrete solution will not 
converge to the exact solution."*

I acknowledge that the deal.II tutorials is not intended to educate the 
user on such theory.  However, it is generally helpful to have one or two 
sentences explaining the saddle-point nature of the problem and or point to 
accessible online resource(s).

I have also finished watching Lecture 33.25 a couple of times which 
discusses saddle-point problems, but even this feels a bit too high-level 
to me i.e. all the important details are skipped. For example, the PDE is 
posed as an energy minimization problem without explaining why (the 
specific words being *"where exactly this step from here to here comes from 
is not terribly important, but if you will believe me that I can rewrite 
this equation in this form, now."*), and the rest of the lecture (the 
inf/sup LBB condition) is also a bit too mathematical for me. 

I apologise upfront and would like to clarify that I mean no disrespect to 
either the tutorial authors or Prof Bangerth. Together you have created a 
mountain of phenomenal quality work which I am thankful for.  However, I'd 
really appreciate if there was some "simple test" or practical advice to 
determine whether our own PDEs and DAEs belong to the saddle-point category 
or not, i.e. how to detect the presence of saddle-point nature of the PDEs, 
just simulate with Qp elements and look for a checkerboard pattern in the 
results?  

Regards,
Krishna

-- 
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/cfdf7943-eb48-4a71-9007-35114f7e3df2%40googlegroups.com.


[deal.II] Question about the advice about regularity of the stokes' equations in Step-22

2020-03-10 Thread Krishnakumar Gopalakrishnan
Step-22 has a strong-sounding stub-like statement:
* "In practice, one wants to impose as little regularity on the pressure 
variable as possible". *

The above one-liner (fairly enough) assumes domain knowledge. As a new 
entrant to deal.ii (haven't studied fluid mechanics before), may I ask the 
following?

   1. Why do we impose as little regularity on the pressure as possible?
   2. When I attempt to solve my own PDE (outside traditional areas such as 
   fluid or structural mechanics), what properties should I know about the 
   field variable to correctly apply the procedure and learnings from this 
   tutorial, i.e. what exactly is the regularity condition mentioned here?

Regards,
Krishna

-- 
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/28311c55-979a-490c-ad50-e2139cc70903%40googlegroups.com.


[deal.II] Updated link to Jack Poulson's PhD thesis (in the landing page of video lecture 34)

2020-03-10 Thread Krishnakumar Gopalakrishnan
The link to Jack Poulson's text currently in the landing page of Video 
Lecture 34 https://www.math.colostate.edu/~bangerth/videos.676.34.html  has 
become out of date.


For the benefit of those following the video lectures, the updated link to 
the official library handle for the thesis is 
https://repositories.lib.utexas.edu/handle/2152/ETD-UT-2012-12-6622. 
The direct link to the PDF within this library entry is 
https://repositories.lib.utexas.edu/bitstream/handle/2152/ETD-UT-2012-12-6622/POULSON-DISSERTATION.pdf?sequence=2&isAllowed=y
 



Regards,
Krishna


-- 
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/eff731e6-14a2-4e33-b806-9ee39953264b%40googlegroups.com.


[deal.II] Question on how MatrixTools::MatrixCreator sets the appropriate flags of FeValues?

2020-02-18 Thread Krishnakumar Gopalakrishnan
In the tutorials, Step-23 suddenly gets rid of the assemble_system() 
function and introduces MatrixTools::MatrixCreator::create_mass_matrix and 
MatrixTools::MatrixCreator::create_laplace_matrix

However, there is no discussion whatsoever of how the appropriate update 
flags (bitfields) of the Fevalues object is set? Can someone help to 
explain the interface of these two aspects of the library? Additionally, 
how do these interact when we have an FeSystem?

Krishna

-- 
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/dd6795cd-429c-42d4-95bc-2e63ad80b726%40googlegroups.com.


[deal.II] Open vs closed notation for time-interval of the heat equation

2020-02-15 Thread Krishnakumar Gopalakrishnan
I am slightly confused by the use of open vs closed interval for denoting 
the time-interval of the heat equation.

For example in lecture 27 
(https://www.math.colostate.edu/~bangerth/videos.676.27.html), both the 
video lecture and the slides seem to convey that the PDE holds for the 
closed interval [0,t]. However, the step-26 tutorial page denotes the same 
pde as being valid only in the open interval (0,t).

I acknowledge that this is a technical subtlety and may not change the 
results or code, but which one is more mathematically correct 
(closed-interval or open-interval)?

Regards,
Krishna

-- 
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/802dbd7e-404f-4612-a127-320588f20685%40googlegroups.com.


Re: [deal.II] Question about the definiteness of the system matrix in Step-20

2020-02-01 Thread Krishnakumar Gopalakrishnan
Dear Dr David Wells,

Thank you for the explanation. However, this only satisfies me partially 
because the very next statement in that tutorial says:

*"We would have to resort to other iterative solvers instead, such as 
MinRes, SymmLQ, or GMRES, that can deal with indefinite systems. However, 
then the next problem immediately surfaces: due to the zero block, there 
are zeros on the diagonal and none of the usual, "simple" preconditioners 
(Jacobi, SSOR) will work as they require division by diagonal elements."*


If the cause of the indefiniteness is not due to the eigen-value test, but 
rather due to the simple fact the pivot elements in the lower-right block 
is zero, then we have only *ONE* root cause of  all difficulties.  I am 
rephrasing the issues as follows (please correct me if my understanding is 
incorrect)


"*Two difficulties* arise due to the *zero pivots* in the bottom-right 
block of the matrix. 

   1. Firstly, following a classical result from linear algebra, such 
   matrices are indefinite and the conjugate gradient solver cannot be 
   applied. We would have to resort to other iterative solvers instead, 
   such as MinRes, SymmLQ, or GMRES, that can deal with indefinite systems.
   2. Secondly, due to the zero block, there are zeros on the diagonal and 
   none of the usual, "simple" preconditioners (Jacobi, SSOR) will work as 
   they require division by diagonal elements"


Regards,
Krishna

On Saturday, February 1, 2020 at 7:13:18 PM UTC, David Wells wrote:
>
> Hi Krishna, 
>
> This is a classic linear algebra result - a symmetric matrix is 
> positive definite if and only if it has positive pivots. Since this 
> matrix has a zero block it does not even have a full set of pivots so 
> it cannot be positive definite. 
>
> Thanks, 
> David Wells 
>
> On Sat, Feb 1, 2020 at 9:49 AM Krishnakumar Gopalakrishnan 
> > wrote: 
> > 
> > I realize that this question is not exactly about the code/concepts 
> behind deal.II library itself, but rather about a mathematical statement 
> from step-20. 
> > 
> > "After assembling the linear system we are faced with the task of 
> solving it. The problem here is: the matrix has a zero block at the bottom 
> right (there is no term in the bilinear form that couples the pressure p 
> with the pressure test function q), and it is indefinite". 
> > 
> > My question is about the indefiniteness of the matrix. In my 
> understanding, a matrix is indefinite if it has both positive and negative 
> eigen values.  However, there has not been any discussion thus far in 
> step-20 that comment about the eigen-values. How was the statement about 
> the indefiniteness then made?   Can someone here explain why that matrix is 
> indefinite? 
> > 
> > Regards, 
> > Krishna 
> > 
> > -- 
> > 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 dea...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/ec88d69a-4b26-43cb-915b-b3ae1fdfa3aa%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/2e309994-0d67-4809-bb28-0c07a142184e%40googlegroups.com.


[deal.II] Question on the operator matrix (system matrix) of Step-20

2020-02-01 Thread Krishnakumar Gopalakrishnan
Once again, apologies for asking questions which are more oriented towards 
vector calculus than the deal.II library/code itself.

In Step-20, under the introduction section on solvers, it says:

"If we sort our degrees of freedom so that all velocity come before all 
pressure variables, then we can subdivide the linear system Ax=b into the 
following blocks:"

(MBTB0)(UP)=(FG),




I am a bit confused about the origins of this block-matrix, particular the 
"B" term in the top-right block (and to a lesser extent to its transpose 
term in the bottom-left block). I shall explain more below.


*The confusing aspects*

Recalling that the above system matrix is the discretized version of the 
original (continuous) PDEs, this corresponds to the assembly of the 
bilinear form:

(v,K−1u)
−(div v,p)
−(q,div u)


   - Now, the top-left block M of the matrix operator is clear; We are 
   multiplying two vector shape functions which leads to the so-called "mass 
   matrix".
   - But the entry in the top-right block, B is not clear.  This is just a 
   product of a scalar shape function and the negative divergence of a vector 
   shape function.  *How is this operator, the gradient?*
   - Yes, the bottom-left block is actually the same as #2 above, right? 
   ie. the *product* of a scalar shape function and the negative divergence 
   of a vector shape function?  *Why is this entry indicated as just the 
   -div operator?*


Apologies for asking all these vector-calculus questions in this forum. 


Regards,
Krishna

-- 
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/32c21917-6e37-43a2-b47b-63b139c6a920%40googlegroups.com.


[deal.II] Question about the definiteness of the system matrix in Step-20

2020-02-01 Thread Krishnakumar Gopalakrishnan
I realize that this question is not exactly about the code/concepts behind 
deal.II library itself, but rather about a mathematical statement from 
step-20.

*"After assembling the linear system we are faced with the task of solving 
it. The problem here is: the matrix has a zero block at the bottom right 
(there is no term in the bilinear form that couples the pressure p with the 
pressure test function q), and it is indefinite".*

My question is about the indefiniteness of the matrix. In my understanding, 
a matrix is indefinite if it has both positive and negative eigen values.  
However, there has not been any discussion thus far in step-20 that comment 
about the eigen-values. How was the statement about the indefiniteness then 
made?   Can someone here explain why that matrix is indefinite?

Regards,
Krishna

-- 
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/ec88d69a-4b26-43cb-915b-b3ae1fdfa3aa%40googlegroups.com.


[deal.II] Question on references for locally conservative discretization of the Laplace equation such as in Step-20

2020-01-31 Thread Krishnakumar Gopalakrishnan
Step-20 tutorial says that:

*"It turns out that the usual discretizations of the Laplace equation (such 
as those used in step-3 
, step-4 
, or step-6 
) do not satisfy 
a desirable feature in typical porous media applications, i.e. that the 
numerical scheme is locally conservative, implying that whatever flows into 
a cell also flows out of it (or the difference is equal to the integral 
over the source terms over each cell, if the sources are nonzero). But, one 
can achieve this by choosing a different formulation of the problem and a 
particular combination of finite element spaces."*


Those arriving at the step-20 tutorial from step-6 (following the video 
lectures) can be taken by surprise by the above statement (since this may 
be a big jump in concepts to be understood). I know that this is not the 
responsibility of the library to impart the theoretical knowledge, but 
among the user community here, can someone point to a quick reference to a 
webpage or lecture slides that mathematically shows that the standard 
discretizations 
are not locally conservative while the proposed replacement scheme is?


Regards,
Krishna

-- 
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/37e27105-8ac1-4361-abda-023e2652ac17%40googlegroups.com.


[deal.II] IterativeInverse function appears to have disappeared between v8.5.0 and v9.0.0?

2020-01-20 Thread Krishnakumar Gopalakrishnan
I was just finishing Prof Bangerth's video lecture 21 wherein the concept 
of Schur Complement is introduced. For computing the inverse of the mass 
matrix (M), it looks like Dealii uses the facilities of the 
IterativeInverse class.

The latest notes in the webpage for the 
lecture, https://www.math.colostate.edu/~bangerth/videos.676.21.html say 
"The IterativeInveerse class is in fact a part of deal.II."

The last version which documents this class is v8.5.0.  Somehow, this 
version has disappeared since v9.0.0 (or maybe we have a doxygen bug?). I 
could not find any information related to this in the "news" section of the 
webpage, nor from the latest 
changelog https://www.dealii.org/developer/doxygen/deal.II/recent_changes.html  
. Also, it looks like there is no way to access the changelog corresponding 
to a release from the project's webpage.

Can someone please point me in the right direction regarding the 
documentation of this class for the latest release of dealii?

Regards,
Krishna



-- 
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/0b92201e-09ff-4322-8c44-2542e068a488%40googlegroups.com.


Re: [deal.II] Facilities for computing the "goodness" of a mesh (i.e. something like a mesh-quality indicator)

2020-01-15 Thread Krishnakumar Gopalakrishnan
Hi Martin,

Thank you. This is certainly looking useful.  Do we have any example usage 
of this function? For example, how do we re-compute the mesh based on the 
return value from this aspect_ratio function or something?

Krishna

On Wednesday, January 15, 2020 at 5:31:34 PM UTC, Martin Kronbichler wrote:
>
> Dear Krishna,
>
> We have recently added one such function, namely 
> GridTools::compute_aspect_ratio_of_cells(),
>
>
> https://dealii.org/developer/doxygen/deal.II/namespaceGridTools.html#a2a9d8801d952ea8afa9ec1573229a329
>
> Best,
> Martin
> On 15.01.20 18:26, Krishnakumar Gopalakrishnan wrote:
>
> In the results/extension section of Step-6 as well in Step-49, there is a 
> great deal of discussion about obtaining good meshes are for a problem, 
> with the caveat that this is a highly specialized topic. Step-49 is full of 
> warnings about things that can go wrong when applying certain 
> transformations, and it seems to implant doubts in my mind that my meshes 
> are never going to be correct :)
>
>
> Given this, in the spirit of the Kelly Indicator for solution errors in a 
> cell, is there a similar single-metric for the quality/goodness of each 
> cell in a mesh? Maybe there is something based on the smallest internal 
> angle (to prevent slivers, for Jacobian of the mapping to be invertible, to 
> prevent inverted cells etc).
>
>
> After all, error estimation is a complicated topic. nevertheless the Kelly 
> Indicator seems to do a reasonable job for quite a few equations. If 
> currently not implemented in Deal.II, is there any journal article that 
> discusses research in this direction?
>
>
>
> Krishna
> -- 
> 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 dea...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/3602a53a-a98a-4a5c-a512-a6d179c8dcec%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/dealii/3602a53a-a98a-4a5c-a512-a6d179c8dcec%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
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/0d406456-3ef9-4624-adb5-0343602466f4%40googlegroups.com.


[deal.II] Facilities for computing the "goodness" of a mesh (i.e. something like a mesh-quality indicator)

2020-01-15 Thread Krishnakumar Gopalakrishnan


In the results/extension section of Step-6 as well in Step-49, there is a 
great deal of discussion about obtaining good meshes are for a problem, 
with the caveat that this is a highly specialized topic. Step-49 is full of 
warnings about things that can go wrong when applying certain 
transformations, and it seems to implant doubts in my mind that my meshes 
are never going to be correct :)


Given this, in the spirit of the Kelly Indicator for solution errors in a 
cell, is there a similar single-metric for the quality/goodness of each 
cell in a mesh? Maybe there is something based on the smallest internal 
angle (to prevent slivers, for Jacobian of the mapping to be invertible, to 
prevent inverted cells etc).


After all, error estimation is a complicated topic. nevertheless the Kelly 
Indicator seems to do a reasonable job for quite a few equations. If 
currently not implemented in Deal.II, is there any journal article that 
discusses research in this direction?



Krishna

-- 
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/3602a53a-a98a-4a5c-a512-a6d179c8dcec%40googlegroups.com.


[deal.II] Possible minor error in a graphic for MATH676 video lecture 15

2020-01-11 Thread Krishnakumar Gopalakrishnan
I don't know if this is the right place to discuss this, but it might 
possibly be of relevance to new users of deal.ii

There might be a minor error in a graphic used in the slides corresponding 
to video lecture 15 of MATH676 (topic: cell refinement introduction)

In the longest edge refinement and red-green refinement strategies, the 
discussion pertains to triangular meshes. 

However, the right-most (slightly bottom-right) cell is actually a 
quadrilateral!   (see slides 10-15, 19-23) in 
https://www.math.colostate.edu/~bangerth/videos/676/slides.15.pdf. This is 
not an issue, since the refinement does not propagate onto this cell in the 
given example of longest-edge refinement, but certainly seems awkward when 
shaded red in the red-green refinement strategy. 

This is just a really minor observation, and does not seem to affect any 
concepts discussed at all. Perhaps, an informal notice may be posted on the 
lecture's landing page, if deemed appropriate. 

Regards,
Krishna

-- 
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/3ede876f-2793-4984-9a0c-2acd7f3ccca5%40googlegroups.com.


Re: [deal.II] Re: Why did the developers of deal.ii choose templates over variadic arguments?

2019-12-20 Thread Krishnakumar Gopalakrishnan
Hi Bruno,

Thank you for your really quick reply.  I shall read the article.

Krishna






On Fri, 20 Dec 2019 at 13:41, Bruno Turcksin 
wrote:

> Krishna,
>
> You can find an extensive discussion on the design choices made here
> <https://arxiv.org/pdf/1910.13247.pdf>. I think section 2.4 answers your
> question. The short answer is that using template makes the code run faster
> because the compiler can do a better job at optimizing everything and it
> allows us greater flexibility in the choice of data structure.
>
> Best,
>
> Bruno
>
> On Friday, December 20, 2019 at 8:12:56 AM UTC-5, Krishnakumar
> Gopalakrishnan wrote:
>>
>> With the highest deference to the amazing quality of software development
>> that deal.ii  developers follow, I wish to ask a question about the
>> particular development paradigm chosen (with no disrespect to any of the
>> developers intended). This question is just out of personal curiosity.
>>
>> deal.ii makes heavy use of templates for spatial-dimension independent
>> programming.  However, as already acknowledged in the FAQ, compiling
>> template-heavy code takes a long time.
>>
>> Since the number cases are only 3 (possible spatial dimensions), it
>> strikes me that the variadic arguments feature (facilitated by the
>> cstdarg.h header file) might be a slightly bit more natural choice for
>> this use case? Apologies if I am wrong about this, since I am a novice C++
>> user.
>>
>> Can the developers/users of deal.ii provide an objective reasoning of why
>> they went the template-route instead of variadic arguments?
>>
>> Regards,
>> Krishna
>>
> --
> 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/8QoMVsf0Oi4/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/15f96801-09e4-438b-b159-e7baf8b5a587%40googlegroups.com
> <https://groups.google.com/d/msgid/dealii/15f96801-09e4-438b-b159-e7baf8b5a587%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CABvf3kbbc60bxoToLfacjuPUjuYYFp0TwQi3QpdM%2BLaFFg273w%40mail.gmail.com.


[deal.II] Why did the developers of deal.ii choose templates over variadic arguments?

2019-12-20 Thread Krishnakumar Gopalakrishnan
With the highest deference to the amazing quality of software development 
that deal.ii  developers follow, I wish to ask a question about the 
particular development paradigm chosen (with no disrespect to any of the 
developers intended). This question is just out of personal curiosity.

deal.ii makes heavy use of templates for spatial-dimension independent 
programming.  However, as already acknowledged in the FAQ, compiling 
template-heavy code takes a long time.

Since the number cases are only 3 (possible spatial dimensions), it strikes 
me that the variadic arguments feature (facilitated by the cstdarg.h header 
file) might be a slightly bit more natural choice for this use case? 
Apologies if I am wrong about this, since I am a novice C++ user.
 
Can the developers/users of deal.ii provide an objective reasoning of why 
they went the template-route instead of variadic arguments?

Regards,
Krishna

-- 
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/02380aad-4385-4e6c-90aa-57a76ce4466e%40googlegroups.com.