Changeset 4773


Ignore:
Timestamp:
07/22/10 18:57:52 (15 years ago)
Author:
Eric.Larour
Message:

New MeshProfileIntersection module, with local routines.
Needed a new object, Segment, because this is highly dynamic in nature.

More qmu debugging, especially dealing with segments for Mass flux computation.

Location:
issm/trunk
Files:
11 added
12 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/configs/linux64/linux64.sh.petsc2

    r4656 r4773  
    11#!/bin/sh
    22
    3 ./configure --prefix=$ISSM_DIR --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install --with-metis-dir=$ISSM_DIR/externalpackages/metis/install --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich" --with-petsc-arch=$ISSM_ARCH --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH -lPLAPACK" --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH/INCLUDE" --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3/$ISSM_ARCH --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" --with-graphics-lib=/usr/lib64/libX11.so --with-cxxoptflags="-march=opteron -O2" --with-numthreads=32 --with-petsc-version=2 --with-chaco-dir=$ISSM_DIR/externalpackages/chaco/install
     3./configure --prefix=$ISSM_DIR --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install --with-metis-dir=$ISSM_DIR/externalpackages/metis/install --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich" --with-petsc-arch=$ISSM_ARCH --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH -lPLAPACK" --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH/INCLUDE" --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3/$ISSM_ARCH --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" --with-graphics-lib=/usr/lib64/libX11.so --with-cxxoptflags="-march=opteron -O2" --with-numthreads=32 --with-petsc-version=2  --with-scotch-dir=$ISSM_DIR/externalpackages/scotch/install --with-chaco-dir=$ISSM_DIR/externalpackages/chaco/install
  • issm/trunk/etc/cluster.rc

    r4667 r4773  
    5454cluster_name=larsen
    5555cluster_codepath=/u/astrid-r1b/larour/issm/trunk/bin
    56 cluster_executionpath=/u/astrid-r1b/larour/Testing/Execution
     56cluster_executionpath=/u/astrid-r1b/larour/issm/execution
    5757cluster_login=larour
    5858cluster_port=0
  • issm/trunk/src/c/Makefile.am

    r4765 r4773  
    9494                                        ./objects/Node.h\
    9595                                        ./objects/Node.cpp\
     96                                        ./objects/Segment.h\
     97                                        ./objects/Segment.cpp\
    9698                                        ./objects/Vertex.h\
    9799                                        ./objects/Vertex.cpp\
     
    499501                                        ./modules/MeshPartitionx/MeshPartitionx.cpp\
    500502                                        ./modules/MeshPartitionx/MeshPartitionx.h\
     503                                        ./modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp\
     504                                        ./modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h\
     505                                        ./modules/MeshProfileIntersectionx/MeshSegmentsIntersection.cpp\
     506                                        ./modules/MeshProfileIntersectionx/ElementSegmentsIntersection.cpp\
     507                                        ./modules/MeshProfileIntersectionx/ElementSegment.cpp\
    501508                                        ./modules/ContourToMeshx/ContourToMeshx.cpp\
    502509                                        ./modules/ContourToMeshx/ContourToMeshxt.cpp\
     
    653660                                        ./objects/Node.h\
    654661                                        ./objects/Node.cpp\
     662                                        ./objects/Segment.h\
     663                                        ./objects/Segment.cpp\
    655664                                        ./objects/Vertex.h\
    656665                                        ./objects/Vertex.cpp\
     
    10511060                                        ./modules/MeshPartitionx/MeshPartitionx.cpp\
    10521061                                        ./modules/MeshPartitionx/MeshPartitionx.h\
     1062                                        ./modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp\
     1063                                        ./modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h\
     1064                                        ./modules/MeshProfileIntersectionx/MeshSegmentsIntersection.cpp\
     1065                                        ./modules/MeshProfileIntersectionx/ElementSegmentsIntersection.cpp\
     1066                                        ./modules/MeshProfileIntersectionx/ElementSegment.cpp\
    10531067                                        ./modules/ContourToMeshx/ContourToMeshx.cpp\
    10541068                                        ./modules/ContourToMeshx/ContourToMeshxt.cpp\
     
    11461160endif
    11471161
    1148 LDADD =    ./libpISSM.a $(PETSCLIB)    $(FLIBS)  $(PLAPACKLIB)  $(MUMPSLIB) $(SCALAPACKLIB)  $(BLACSLIB)  $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB)  $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) libOverload.a $(MULTITHREADINGLIB)
     1162LDADD =    ./libpISSM.a $(PETSCLIB)     $(FLIBS)  $(PLAPACKLIB)  $(MUMPSLIB) $(SCALAPACKLIB)  $(BLACSLIB)  $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB)  $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) libOverload.a $(MULTITHREADINGLIB)
    11491163
    11501164issm_exe_SOURCES = solutions/issm.cpp
  • issm/trunk/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp

    r4451 r4773  
    3434                /*Compute response for this response_descriptor:*/
    3535
    36                 if(strcmp(response_descriptor,"min_vel")==0){
     36                if(strcmp(response_descriptor,"MinVel")==0){
    3737                        MinVelx( &femmodel_response, elements,nodes, vertices, loads, materials, parameters);
    3838                }
    39                 else if(strcmp(response_descriptor,"max_vel")==0){
     39                else if(strcmp(response_descriptor,"MaxVel")==0){
    4040                        MaxVelx( &femmodel_response, elements,nodes, vertices, loads, materials, parameters);
    4141                }
    42                 else if(strcmp(response_descriptor,"min_vx")==0){
     42                else if(strcmp(response_descriptor,"MinVx")==0){
    4343                        MinVxx( &femmodel_response, elements,nodes, vertices, loads, materials, parameters);
    4444                }
    45                 else if(strcmp(response_descriptor,"max_vx")==0){
     45                else if(strcmp(response_descriptor,"MaxVx")==0){
    4646                        MaxVxx( &femmodel_response, elements,nodes, vertices, loads, materials, parameters);
    4747                }
    48                 else if(strcmp(response_descriptor,"max_abs_vx")==0){
     48                else if(strcmp(response_descriptor,"MaxAbsVx")==0){
    4949                        MaxAbsVxx( &femmodel_response, elements,nodes, vertices, loads, materials, parameters);
    5050                }
    51                 else if(strcmp(response_descriptor,"min_vy")==0){
     51                else if(strcmp(response_descriptor,"MinVy")==0){
    5252                        MinVyx( &femmodel_response, elements,nodes, vertices, loads, materials, parameters);
    5353                }
    54                 else if(strcmp(response_descriptor,"max_vy")==0){
     54                else if(strcmp(response_descriptor,"MaxVy")==0){
    5555                        MaxVyx( &femmodel_response, elements,nodes, vertices, loads, materials, parameters);
    5656                }
    57                 else if(strcmp(response_descriptor,"max_abs_vy")==0){
     57                else if(strcmp(response_descriptor,"MaxAbsVy")==0){
    5858                        MaxAbsVyx( &femmodel_response, elements,nodes, vertices, loads, materials, parameters);
    5959                }
    60                 else if(strcmp(response_descriptor,"min_vz")==0){
     60                else if(strcmp(response_descriptor,"MinVz")==0){
    6161                        MinVzx( &femmodel_response, elements,nodes, vertices, loads, materials, parameters);
    6262                }
    63                 else if(strcmp(response_descriptor,"max_vz")==0){
     63                else if(strcmp(response_descriptor,"MaxVz")==0){
    6464                        MaxVzx( &femmodel_response, elements,nodes, vertices, loads, materials, parameters);
    6565                }
    66                 else if(strcmp(response_descriptor,"max_abs_vz")==0){
     66                else if(strcmp(response_descriptor,"MaxAbsVz")==0){
    6767                        MaxAbsVzx( &femmodel_response, elements,nodes, vertices, loads, materials, parameters);
    6868                }
    69                 else if(strcmp(response_descriptor,"misfit")==0){
     69                else if(strcmp(response_descriptor,"Misfit")==0){
    7070                        Misfitx( &femmodel_response, elements,nodes, vertices, loads, materials, parameters);
    7171                }
    72                 else if(strcmp(response_descriptor,"mass_flux")==0){
     72                else if(strlen(response_descriptor)>=8){
    7373
    74                         double*   segments=NULL;
    75                         int       num_segments;
    76                        
    77                         /*retrieve qmu_mass_flux_segments: */
    78                         parameters->FindParam(&segments,&num_segments,&dummy,QmuMassFluxSegmentsEnum);
     74                        if(strncmp(response_descriptor,"MassFlux",8)==0){
    7975
    80                         /*call mass flux module: */
    81                         MassFluxx(&femmodel_response,elements,nodes,vertices,loads,materials,parameters,segments,num_segments);
     76                                double*   segments=NULL;
     77                                int       num_segments;
    8278
    83                         /*Free ressources:*/
    84                         xfree((void**)&segments);
     79                                /*retrieve qmu_mass_flux_segments: */
     80                                parameters->FindParam(&segments,&num_segments,&dummy,QmuMassFluxSegmentsEnum);
     81
     82                                /*call mass flux module: */
     83                                MassFluxx(&femmodel_response,elements,nodes,vertices,loads,materials,parameters,segments,num_segments);
     84
     85                                /*Free ressources:*/
     86                                xfree((void**)&segments);
     87                        }
    8588
    8689                }
  • issm/trunk/src/c/modules/modules.h

    r4702 r4773  
    5656#include "./Mergesolutionfromftogx/Mergesolutionfromftogx.h"
    5757#include "./MeshPartitionx/MeshPartitionx.h"
     58#include "./MeshProfileIntersectionx/MeshProfileIntersectionx.h"
    5859#include "./MinVelx/MinVelx.h"
    5960#include "./MinVxx/MinVxx.h"
  • issm/trunk/src/c/objects/objects.h

    r4244 r4773  
    1414#include "./Vertex.h"
    1515#include "./Node.h"
     16#include "./Segment.h"
    1617#include "./NodeSets.h"
    1718#include "./IoModel.h"
  • issm/trunk/src/m/classes/@model/model.m

    r4739 r4773  
    300300        md.variabledescriptors=NaN;
    301301        md.responsedescriptors=NaN;
    302         md.qmu_mass_flux_profile=NaN;
     302        md.qmu_mass_flux_num_profiles=NaN;
     303        md.qmu_mass_flux_profile_directory=NaN;
     304        md.qmu_mass_flux_profiles=NaN;
    303305        md.qmu_mass_flux_segments=NaN;
    304         md.qmu_mass_flux_num_segments=NaN;
    305306
    306307        %partitioner:
  • issm/trunk/src/m/qmu/MassFluxProcessProfile.m

    r4761 r4773  
    1 function segments=MassFluxProcessProfile(md);
     1function segments=MassFluxProcessProfile(md,directory,profilename);
    22%MASSFLUXPROCESSPROFILE: process an argus domain outlien profile into a list of segments.
    33%
     
    99
    1010%first read the profile points.
    11 profile=expread(['../' md.qmu_mass_flux_profile],1); %go to ../ because the exp file is in the root directory.
     11profile=expread([directory '/' profilename]);
    1212
    1313%project this profile onto mesh.
  • issm/trunk/src/m/qmu/process_qmu_response_data.m

    r4430 r4773  
    77
    88
     9%preliminary data
     10process_mass_flux_profiles=0;
    911
     12
     13%loop through response descriptors, and act accordingly
    1014for i=1:numel(md.responsedescriptors),
    11         if strncmpi(md.responsedescriptors{i},'mass_flux',9),
    12                 indx=str2int(md.responsedescriptors{i}(10:end));
    13                 if isempty(indx) || ~indx
    14                         indx=1;
    15                 end
    1615
    17                 %we need a profile of points on which to compute the mass_flux, is it here?
    18                 if isnans(md.qmu_mass_flux_profile),
    19                         error('process_qmu_response_data error message: could not find a mass_flux exp profile!');
    20                 end
    21                 if ~(ischar(md.qmu_mass_flux_profile) && (indx == 1)) && ...
    22                    ~(iscell(md.qmu_mass_flux_profile) && length(md.qmu_mass_flux_profile) >= indx && ischar(md.qmu_mass_flux_profile{indx})),
    23                         error('process_qmu_response_data error message: mass_flux exp profile should be a domain outline name');
    24                 end
    25 
    26                 %ok, process the qmu_mass_flux_profile to build a list of segments:
    27                 if ischar(md.qmu_mass_flux_profile),
    28                         md.qmu_mass_flux_segments=MassFluxProcessProfile(md);
    29                         md.qmu_mass_flux_num_segments=size(md.qmu_mass_flux_segments,1);
    30                 else
    31                         if isempty(md.qmu_mass_flux_segments) || ~iscell(md.qmu_mass_flux_segments)
    32                                 md.qmu_mass_flux_segments=cell(numel(md.qmu_mass_flux_profile),1);
    33                         end
    34                         if isempty(md.qmu_mass_flux_num_segments) || ...
    35                            (numel(md.qmu_mass_flux_num_segments) == 1 && isnan(md.qmu_mass_flux_num_segments))
    36                                 md.qmu_mass_flux_num_segments=zeros(numel(md.qmu_mass_flux_profile),1);
    37                         end
    38                         save=md.qmu_mass_flux_profile;
    39                         md.qmu_mass_flux_profile=md.qmu_mass_flux_profile{indx};
    40                         md.qmu_mass_flux_segments{indx,1}=MassFluxProcessProfile(md);
    41                         md.qmu_mass_flux_num_segments(indx,1)=size(md.qmu_mass_flux_segments{indx},1);
    42                         md.qmu_mass_flux_profile=save;
    43                         clear save
    44                 end
     16        %Do we have to process  mass flux profiles?
     17        if strncmpi(md.responsedescriptors{i},'MassFlux',8),
     18                process_mass_flux_profiles=1;
    4519        end
    4620end
    4721
    48 % for now, concatenate all segments from cells to make a double array for parallel
    49 if iscell(md.qmu_mass_flux_segments)
    50         segments=zeros(0,5);
    51         for i=1:length(md.qmu_mass_flux_num_segments)
    52                 if md.qmu_mass_flux_num_segments(i)
    53                         segments=[segments; md.qmu_mass_flux_segments{i}];
    54                 end
     22
     23%deal with mass flux profiles
     24if process_mass_flux_profiles,
     25
     26        %we need a profile of points on which to compute the mass_flux, is it here?
     27        if isnans(md.qmu_mass_flux_profiles),
     28                error('process_qmu_response_data error message: could not find a mass_flux exp profile!');
    5529        end
    56         md.qmu_mass_flux_segments=segments;
    57         clear segments
     30       
     31        if ~iscell(md.qmu_mass_flux_profiles),
     32                error('process_qmu_response_data error message: qmu_mass_flux_profiles field should be a cell array of domain outline names');
     33        end
     34
     35        if isempty(md.qmu_mass_flux_profiles),
     36                error('process_qmu_response_data error message: qmu_mass_flux_profiles cannot be empty!');
     37        end
     38
     39        %ok, process the domains named in qmu_mass_flux_profiles,  to build a list of segments
     40        md.qmu_mass_flux_segments=cell(numel(md.qmu_mass_flux_profiles),1);
     41
     42        for i=1:numel(md.qmu_mass_flux_profiles),
     43                md.qmu_mass_flux_segments{i}=MassFluxProcessProfile(md,md.qmu_mass_flux_profile_directory,md.qmu_mass_flux_profiles{i});
     44        end
    5845end
    5946
     47error;
     48
  • issm/trunk/src/m/utils/Mesh/ProfileProjectOntoMesh.m

    r4040 r4773  
    1414%[x0,y0] = intersections(profile.x,profile.y,x,y,1);
    1515[x0,y0,indices,j] = intersections(profile.x,profile.y,x,y);
     16
    1617%  sort intersections to create segments in order and continuous along profile
    1718[indices,isort]=sort(indices);
  • issm/trunk/src/mex/Makefile.am

    r4750 r4773  
    4444                                Mergesolutionfromftog\
    4545                                MeshPartition\
     46                                MeshProfileIntersection\
    4647                                Misfit \
    4748                                ModelProcessor \
     
    228229                          MeshPartition/MeshPartition.h
    229230
     231MeshProfileIntersection_SOURCES = MeshProfileIntersection/MeshProfileIntersection.cpp\
     232                          MeshProfileIntersection/MeshProfileIntersection.h
     233
    230234ModelProcessor_SOURCES =  ModelProcessor/ModelProcessor.cpp \
    231235                                                  ModelProcessor/ModelProcessor.h
  • issm/trunk/src/mex/ModelProcessor/ModelProcessor.cpp

    r4218 r4773  
    3535        FetchData(&double_analyses,&numanalyses,ANALYSES);
    3636        analyses=(int*)xmalloc(numanalyses*sizeof(int));
    37         for(i=0;i<numanalyses;i++)analyses[i]=double_analyses[i];
     37        for(i=0;i<numanalyses;i++)analyses[i]=(int)double_analyses[i];
    3838
    3939        /*call x code ModelProcessorx: */
Note: See TracChangeset for help on using the changeset viewer.