Changeset 4592


Ignore:
Timestamp:
07/14/10 11:37:14 (15 years ago)
Author:
Mathieu Morlighem
Message:

Do not extrude Vx and Vy if non collapsed

Location:
issm/trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/Gradjx/Gradjx.cpp

    r4573 r4592  
    1212void Gradjx( Vec* pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int control_type){
    1313
    14         int i;
    15         int dim;
    16         int numberofvertices;
    17         Vec gradient=NULL;
     14        int  i;
     15        int  dim;
     16        int  numberofvertices;
     17        bool extrude;
     18        Vec  gradient = NULL;
    1819       
    1920        /*retrieve some parameters: */
    2021        parameters->FindParam(&dim,DimEnum);
     22        parameters->FindParam(&extrude,ExtrudeParamEnum);
    2123        numberofvertices=vertices->NumberOfVertices();
    2224
     
    3537
    3638        /*Extrude if needed: */
    37         if(dim==3) VecExtrudex(gradient, elements,nodes, vertices, loads, materials, parameters,0);
     39        if(dim==3 && extrude) VecExtrudex(gradient, elements,nodes, vertices, loads, materials, parameters,0);
    3840
    3941        /*Assign output pointers: */
  • issm/trunk/src/c/modules/InputExtrudex/InputExtrudex.cpp

    r4573 r4592  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void InputExtrudex( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int enum_type){
     11void InputExtrudex( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int enum_type,bool only_if_collapsed){
    1212
    1313        int i;
     
    1818                if (element->Enum()==PentaEnum){
    1919                        Penta* penta=(Penta*)element;
    20                         penta->InputExtrude(enum_type);
     20                        penta->InputExtrude(enum_type,only_if_collapsed);
    2121                }
    2222        }
  • issm/trunk/src/c/modules/InputExtrudex/InputExtrudex.h

    r4236 r4592  
    99
    1010/* local prototypes: */
    11 void InputExtrudex( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int enum_type);
     11void InputExtrudex( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int enum_type,bool only_if_collapsed=false);
    1212
    1313#endif  /* _INPUTEXTRUDEX_H */
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r4578 r4592  
    47674767/*}}}*/
    47684768/*FUNCTION Penta::InputExtrude {{{1*/
    4769 void  Penta::InputExtrude(int enum_type){
    4770 
    4771         bool onbed;
    4772         bool onsurface;
    4773 
    4774         Penta* penta=NULL;
    4775         Input* original_input=NULL;
     4769void  Penta::InputExtrude(int enum_type,bool only_if_collapsed){
     4770
     4771        bool   onbed,onsurface,collapse;
     4772        Penta *penta          = NULL;
     4773        Input *original_input = NULL;
    47764774
    47774775        /*recover parameters: */
     4776        inputs->GetParameterValue(&collapse,CollapseEnum);
    47784777        inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    47794778        inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
     4779
     4780        /*First: if only_if_collapsed, check wether this penta is collapsed*/
     4781        if (only_if_collapsed && !collapse) return;
    47804782
    47814783        /*Are we on the base, not on the surface?:*/
  • issm/trunk/src/c/objects/Elements/Penta.h

    r4575 r4592  
    168168                void      GetStrainRateStokes(double* epsilon, double* velocity, double* xyz_list, double* gauss_coord);
    169169                Penta*  GetUpperElement(void);
    170                 void      InputExtrude(int enum_type);
     170                void      InputExtrude(int enum_type,bool only_if_collapsed);
    171171                void    InputUpdateFromSolutionAdjointHoriz( double* solutiong);
    172172                void    InputUpdateFromSolutionAdjointStokes( double* solutiong);
  • issm/trunk/src/c/solvers/solver_diagnostic_nonlinear.cpp

    r4557 r4592  
    131131        /*extrude if we are in 3D: */
    132132        if (dim==3){
    133                 if(verbose)_printf_("%s\n","extruding velocity and pressure in 3d...");
    134                 InputExtrudex( femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum);
    135                 InputExtrudex( femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum);
     133                if(verbose)_printf_("%s\n","extruding velocity of collapsed elements...");
     134                InputExtrudex( femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum,true); //true means that the velocity is only extruded if collapsed
     135                InputExtrudex( femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum,true);
    136136        }
    137137
  • issm/trunk/src/m/solvers/solver_diagnostic_nonlinear.m

    r4558 r4592  
    8585        if dim==3,
    8686                displaystring(femmodel.parameters.Verbose,'%s','   extruding horizontal velocity in 3d...');
    87                 femmodel.elements=InputExtrude( femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,VxEnum);
    88                 femmodel.elements=InputExtrude( femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,VyEnum);
     87                femmodel.elements=InputExtrude( femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,VxEnum,true);%true means only if collapsed
     88                femmodel.elements=InputExtrude( femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,VyEnum,true);
    8989        end
    9090                       
  • issm/trunk/src/mex/InputExtrude/InputExtrude.cpp

    r4573 r4592  
    88
    99        /*input datasets: */
    10         Elements* elements=NULL;
    11         Nodes* nodes=NULL;
    12         Vertices* vertices=NULL;
    13         Loads* loads=NULL;
    14         Materials* materials=NULL;
    15         Parameters* parameters=NULL;
    16         int      NameEnum;
     10        Elements   *elements   = NULL;
     11        Nodes      *nodes      = NULL;
     12        Vertices   *vertices   = NULL;
     13        Loads      *loads      = NULL;
     14        Materials  *materials  = NULL;
     15        Parameters *parameters = NULL;
     16        int         NameEnum;
     17        bool        ifcollapsed=false;
    1718
    1819        /*Boot module: */
     
    2021
    2122        /*checks on arguments on the matlab side: */
    22         CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InputExtrudeUsage);
     23        //CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InputExtrudeUsage); Cant' use it here, as we have variable inputs.
     24        if((nlhs!=NLHS) || (nrhs!=7 && nrhs!=8)){
     25                InputExtrudeUsage();
     26                ISSMERROR(" usage. See above");
     27        }
    2328
    2429        /*Input datasets: */
     
    3035        FetchParams(&parameters,PARAMETERS);
    3136        FetchData(&NameEnum,NAME);
     37        if (nrhs==8){
     38                FetchData(&ifcollapsed,IFCOLLAPSED);
     39        }
    3240
    3341        /*configure: */
     
    3745
    3846        /*!Call core code: */
    39         InputExtrudex(elements,nodes,vertices,loads,materials,parameters,NameEnum);
     47        if (nrhs==7)
     48         InputExtrudex(elements,nodes,vertices,loads,materials,parameters,NameEnum);
     49        else
     50         InputExtrudex(elements,nodes,vertices,loads,materials,parameters,NameEnum,ifcollapsed);
    4051
    4152        /*write output : */
     
    5970        _printf_("\n");
    6071        _printf_("   usage: [elements] = %s(elements, nodes, vertices, loads, materials, parameters, name_enum);\n",__FUNCT__);
     72        _printf_("   usage: [elements] = %s(elements, nodes, vertices, loads, materials, parameters, name_enum,true);\n",__FUNCT__);
    6173        _printf_("\n");
    6274}
  • issm/trunk/src/mex/InputExtrude/InputExtrude.h

    r4236 r4592  
    2424#define PARAMETERS (mxArray*)prhs[5]
    2525#define NAME (mxArray*)prhs[6]
     26#define IFCOLLAPSED (mxArray*)prhs[7]
    2627
    2728/* serial output macros: */
     
    3233#define NLHS  1
    3334#undef NRHS
    34 #define NRHS  7
     35#define NRHS  8
    3536
    3637#endif  /* _EXTRUDEINPUT_H */
Note: See TracChangeset for help on using the changeset viewer.