Changeset 567 for issm/trunk


Ignore:
Timestamp:
05/21/09 14:17:28 (16 years ago)
Author:
Mathieu Morlighem
Message:

added time output for thermal transient

Location:
issm/trunk/src/c/parallel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/parallel/OutputThermal.cpp

    r561 r567  
    1212#include "../objects/objects.h"
    1313
    14 void OutputThermal(Vec* t_g,Vec* m_g, FemModel* femmodels,char* filename){
     14void OutputThermal(Vec* t_g,Vec* m_g, double* time,FemModel* femmodels,char* filename){
    1515
    1616        int i;
     
    9090                WriteDataToDisk(&nsteps,NULL,NULL,"Integer",fid);
    9191
     92                /*Write time steps: */
     93                WriteDataToDisk(&time,&nsteps,&one,"Mat",fid);
     94
    9295                /*Write solutions to disk: */
    9396                for(i=0;i<=nsteps;i++){
  • issm/trunk/src/c/parallel/thermal.cpp

    r561 r567  
    3232        double* u_g=NULL;
    3333        double* p_g=NULL;
     34        double* time=NULL;
    3435        double  dt;
    3536        double  ndt;
     
    100101        if(sub_analysis_type==SteadyAnalysisEnum()){
    101102
     103                time=(double*)xmalloc(sizeof(double));
     104                time[0]=0;
     105
    102106                /*allocate t_g and m_g arrays: */
    103107                t_g=(Vec*)xmalloc(sizeof(Vec));
     
    111115                if(debug)_printf_("computing melting:\n");
    112116                diagnostic_core_linear(&m_g[0],&femmodels[1],inputs,MeltingAnalysisEnum(),SteadyAnalysisEnum());
     117                PetscSynchronizedPrintf(MPI_COMM_WORLD,"melting_offset=%g\n",melting_offset);
     118                PetscSynchronizedFlush(MPI_COMM_WORLD);
     119                VecView(m_g[0],PETSC_VIEWER_STDOUT_WORLD);
     120
    113121        }
    114122        else{
    115123               
    116124                nsteps=(int)(ndt/dt);
     125                time=(double*)xmalloc((nsteps+1)*sizeof(double));
    117126
    118127                /*allocate t_g and m_g arrays: */
     
    132141                for(i=0;i<nsteps;i++){
    133142                        if(debug)_printf_("time step: %i/%i\n",n,nsteps);
     143                        time[i]=n*dt;
    134144                       
    135145                        if(debug)_printf_("computing temperatures:\n");
     
    145155
    146156        _printf_("write results to disk:\n");
    147         OutputThermal(t_g,m_g,&femmodels[0],outputfilename);
     157        OutputThermal(t_g,m_g,time,&femmodels[0],outputfilename);
    148158
    149159        _printf_("write lock file:\n");
Note: See TracChangeset for help on using the changeset viewer.