Changeset 7833


Ignore:
Timestamp:
04/12/11 08:08:02 (14 years ago)
Author:
Mathieu Morlighem
Message:

Added penalties to prognostic

Location:
issm/trunk/src/c
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp

    r4739 r7833  
    1616        int i;
    1717        int element;
     18        int penpair_ids[2];
     19        int count=0;
    1820
    1921        /*DataSet*/
     
    5456        }
    5557
     58        /*Create Penpair for penalties: */
     59        IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
     60
     61        for(i=0;i<iomodel->numpenalties;i++){
     62
     63                if(iomodel->my_vertices[(int)iomodel->penalties[2*i+0]-1]){
     64
     65                        /*In debugging mode, check that the second node is in the same cpu*/
     66                        _assert_(iomodel->my_vertices[(int)iomodel->penalties[2*i+1]-1]);
     67
     68                        /*Get node ids*/
     69                        penpair_ids[0]=iomodel->nodecounter+(int)iomodel->penalties[2*i+0];
     70                        penpair_ids[1]=iomodel->nodecounter+(int)iomodel->penalties[2*i+1];
     71
     72                        /*Create Load*/
     73                        loads->AddObject(new Penpair(
     74                                                        iomodel->loadcounter+count+1,
     75                                                        &penpair_ids[0],
     76                                                        PrognosticAnalysisEnum));
     77                        count++;
     78                }
     79        }
     80
     81        /*free ressources: */
     82        xfree((void**)&iomodel->penalties);
     83
     84
    5685        /*Assign output pointer: */
    5786        *ploads=loads;
  • issm/trunk/src/c/objects/Loads/Penpair.cpp

    r6413 r7833  
    223223                case DiagnosticHorizAnalysisEnum:
    224224                        Ke=PenaltyCreateKMatrixDiagnosticHoriz(kmax);
     225                        break;
     226                case PrognosticAnalysisEnum:
     227                        Ke=PenaltyCreateKMatrixPrognostic(kmax);
    225228                        break;
    226229                default:
     
    365368}
    366369/*}}}1*/
     370/*FUNCTION Penpair::PenaltyCreateKMatrixPrognostic {{{1*/
     371ElementMatrix* Penpair::PenaltyCreateKMatrixPrognostic(double kmax){
     372
     373        const int numdof=NUMVERTICES*NDOF1;
     374        double penalty_offset;
     375
     376        /*Initialize Element vector and return if necessary*/
     377        ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters);
     378
     379        /*recover parameters: */
     380        parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
     381
     382        //Create elementary matrix: add penalty to
     383        Ke->values[0*numdof+0]=+kmax*pow((double)10.0,penalty_offset);
     384        Ke->values[0*numdof+1]=-kmax*pow((double)10.0,penalty_offset);
     385        Ke->values[1*numdof+0]=-kmax*pow((double)10.0,penalty_offset);
     386        Ke->values[1*numdof+1]=+kmax*pow((double)10.0,penalty_offset);
     387
     388        /*Clean up and return*/
     389        return Ke;
     390}
     391/*}}}1*/
  • issm/trunk/src/c/objects/Loads/Penpair.h

    r6412 r7833  
    6969                ElementMatrix* PenaltyCreateKMatrixDiagnosticMacAyealPattyn(double kmax);
    7070                ElementMatrix* PenaltyCreateKMatrixDiagnosticStokes(double kmax);
     71                ElementMatrix* PenaltyCreateKMatrixPrognostic(double kmax);
    7172                /*}}}*/
    7273};
Note: See TracChangeset for help on using the changeset viewer.