getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Getfem-users] transient problems in Getfem


From: Yves Renard
Subject: Re: [Getfem-users] transient problems in Getfem
Date: Wed, 20 Feb 2013 15:10:17 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2


Dear Andriy,

The truth is that did not treat any case where the matrix corresponding to the dynamic term was not a mass matrix. Additionally, I do not systematically use time dispatchers (I think, the concept would have to be clarified, especially for the support of the Newmark scheme).

Your solution is of course perfectly in the spirit of the time dispatcher.
I think, it should be interesting to add your first_order_derivative_dispatcher
to the list of available ones in getfem_models.cc

Yves.









Le 19/02/2013 11:28, Andriy Andreykiv a écrit :
Dear Yves, dear Getfem users

I was wondering about the general strategy for first order transient problems in Getfem.
If some problem is described by 

    C*du/dt + K*u = RHS

then something like K is conveniently taken into account with time dispatchers (either theta or midpoint).
What I don't understand is the general strategy for an arbitrary C brick. Getfem has functionality like add_basic_d_on_dt_brick.
But this function is specific to a mass matrix. I find it a bit not general enough to build a brick for every C like matrix.

The manual on time dispatchers also says that 
"The same brick as for the \theta-method can be used to represent a first order time derivative."
but I"m not completely sure how this can be achieved. In the beginning I thought that I can create a list of 
bricks that go into C and pass them to 
   getfem::add_theta_method_dispatcher(model,transient_bricks_derivative,"1/dt");
but this is not entirely correct, because in that case Getfem will be setting the coefficients like this:

      md.matrix_coeff_of_brick(ib) = 1/dT;
      md.rhs_coeffs_of_brick(ib)[0] = 1/dT;
      md.rhs_coeffs_of_brick(ib)[1] = 1- 1/dT

while I need something like this:

      md.matrix_coeff_of_brick(ib) = 1/dT;
      md.rhs_coeffs_of_brick(ib)[0] = 1/dT;
      md.rhs_coeffs_of_brick(ib)[1] = - 1/dT;

Well, this is all easy to solve by creating another dispatcher which allows me 
to add any C-like brick (which is being multiplied by first order derivative du/dt )
(I used this solution to develop poroelastic formulation for structural-flow coupling)

struct first_order_derivative_dispatcher: public theta_method_dispatcher{
    void set_dispatch_coeff(const model &md, size_type ib) const {
      scalar_type dt;
      if (md.is_complex())
        dt = gmm::real(md.complex_variable(param_names[0])[0]);
      else
        dt = md.real_variable(param_names[0])[0];
      md.matrix_coeff_of_brick(ib) = 1.0/dt;
      md.rhs_coeffs_of_brick(ib)[0] = 1.0/dt;
      md.rhs_coeffs_of_brick(ib)[1] = -1.0/dt;
    }

  void add_first_order_derivative_dispatcher
  (model &md, dal::bit_vector ibricks, const std::string &dt) {
    pdispatcher pdispatch = new first_order_derivative_dispatcher(dt);
    for (dal::bv_visitor i(ibricks); !i.finished(); ++i)
      md.add_time_dispatcher(i, pdispatch);
  }

but I resent the fact if I might be re-inventing a wheel in this case.

Thanks in advance,
                               Andriy



_______________________________________________
Getfem-users mailing list
address@hidden
https://mail.gna.org/listinfo/getfem-users


-- 

  Yves Renard (address@hidden)       tel : (33) 04.72.43.87.08
  Pole de Mathematiques, INSA-Lyon             fax : (33) 04.72.43.85.29
  20, rue Albert Einstein
  69621 Villeurbanne Cedex, FRANCE
  http://math.univ-lyon1.fr/~renard

---------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]