Ignore:
Timestamp:
03/12/12 14:40:42 (13 years ago)
Author:
cborstad
Message:

merged revisions 11428:11680 from trunk-jpl into branches/trunk-jpl-damage

Location:
issm/branches/trunk-jpl-damage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-jpl-damage

  • TabularUnified issm/branches/trunk-jpl-damage/src/c/modules/Reduceloadx/Reduceloadx.cpp

    r9761 r11684  
    1212#include "../../io/io.h"
    1313
    14 void    Reduceloadx( Vec pf, Mat Kfs, Vec y_s,bool flag_ys0){
     14void    Reduceloadx( Vector* pf, Matrix* Kfs, Vector* y_s,bool flag_ys0){
    1515
    1616        /*intermediary*/
    17         Vec         y_s0   = NULL;
    18         Vec         Kfsy_s = NULL;
     17        Vector*     y_s0   = NULL;
     18        Vector*     Kfsy_s = NULL;
    1919        int         Kfsm,Kfsn;
    2020        int         global_m,global_n;
    21         PetscScalar a;
    2221        bool        fromlocalsize = true;
    2322        int         verbose;
     
    2524        _printf_(VerboseModule(),"   Dirichlet lifting applied to load vector\n");
    2625
    27         MatGetSize(Kfs,&global_m,&global_n);
     26        Kfs->GetSize(&global_m,&global_n);
    2827        if(pf && global_m*global_n){
    2928
     
    3231
    3332                /*pf = pf - Kfs * y_s;*/
    34                 MatGetLocalSize(Kfs,&Kfsm,&Kfsn);
    35                 Kfsy_s=NewVec(Kfsm,fromlocalsize);
     33                Kfs->GetLocalSize(&Kfsm,&Kfsn);
     34                Kfsy_s=new Vector(Kfsm,fromlocalsize);
    3635                if (flag_ys0){
    3736
    3837                        /*Create y_s0, full of 0: */
    39                         VecDuplicate(y_s,&y_s0);
    40                         VecSet(y_s0,0.0);
    41                         VecAssemblyBegin(y_s0);
    42                         VecAssemblyEnd(y_s0);
     38                        y_s0=y_s->Duplicate();
     39                        y_s0->Set(0.0);
     40                        y_s0->Assemble();
    4341
    44                         MatMultPatch(Kfs,y_s0,Kfsy_s);
     42                        Kfs->MatMult(y_s0,Kfsy_s);
    4543                }
    4644                else{
    47                         MatMultPatch(Kfs,y_s,Kfsy_s);
     45                        Kfs->MatMult(y_s,Kfsy_s);
    4846                }
    4947
    50                 a=-1;
    51                 VecAXPY(pf,a,Kfsy_s); 
     48                pf->AXPY(Kfsy_s,-1);
    5249        }
    5350
    5451
    5552        /*Free ressources and return*/
    56         VecFree(&y_s0);
    57         VecFree(&Kfsy_s);
     53        delete y_s0;
     54        delete Kfsy_s;
    5855
    5956}
Note: See TracChangeset for help on using the changeset viewer.