Changeset 14953


Ignore:
Timestamp:
05/07/13 22:35:09 (12 years ago)
Author:
Eric.Larour
Message:

CHG: some serious desentangling of the header files, which started from the src/c/shared/Exp/ directory.

Location:
issm/trunk-jpl/src/c
Files:
1 added
3 deleted
26 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Container/Constraints.cpp

    r14917 r14953  
    1111#endif
    1212
    13 #include <vector>
    14 #include <functional>
    15 #include <algorithm>
    16 #include <iostream>
    17 
    18 #include "./DataSet.h"
    19 #include "../shared/shared.h"
    20 #include "../EnumDefinitions/EnumDefinitions.h"
     13#include "./Constraints.h"
     14#include "../shared/io/Print/Print.h"
     15#include "../toolkits/mpi/mpiincludes.h"
    2116
    2217using namespace std;
    2318/*}}}*/
    2419
    25 /*Object constructors and destructor*/
    26 /*FUNCTION Constraints::Constraints(){{{*/
    27 Constraints::Constraints(){
    28         enum_type=ConstraintsEnum;
    29         return;
    30 }
    31 /*}}}*/
    32 /*FUNCTION Constraints::~Constraints(){{{*/
    33 Constraints::~Constraints(){
    34         return;
    35 }
    36 /*}}}*/
    3720
    3821/*Numerics: */
  • issm/trunk-jpl/src/c/Container/Constraints.h

    r14476 r14953  
    33
    44/*forward declarations */
     5#include "./DataSet.h"
    56class Materials;
    67class Parameters;
     
    910class Loads;
    1011class Nodes;
    11 class DataSet;
    1212class Inputs;
     13
     14#include "../EnumDefinitions/EnumDefinitions.h"
    1315
    1416/*! \brief Declaration of Constraints class.
     
    2123        public:
    2224
    23                 /*constructors, destructors*/
    24                 Constraints();
    25                 ~Constraints();
     25                /*Object constructors and destructor*/
     26                /*FUNCTION Constraints::Constraints(){{{*/
     27                Constraints(){
     28                        enum_type=ConstraintsEnum;
     29                        return;
     30                }
     31                /*}}}*/
     32                /*FUNCTION Constraints::~Constraints(){{{*/
     33                ~Constraints(){
     34                        return;
     35                }
     36                /*}}}*/
     37
    2638
    2739                /*numerics*/
  • issm/trunk-jpl/src/c/Container/DataSet.cpp

    r14950 r14953  
    251251}
    252252/*}}}*/
     253
     254/*Routines that relate to datasets, but which are not methods: */
     255int ExpWrite(DataSet* contours,char* domainname){/*{{{*/
     256
     257        /*I/O: */
     258        FILE* fid=NULL;
     259        Contour<double>* contour = NULL;
     260
     261        /*open domain outline file for writing: */
     262        if((fid=fopen(domainname,"w"))==NULL) _error_("could not open domain file " << domainname);
     263
     264        for(int counter=0;counter<contours->Size();counter++){
     265                contour=(Contour<double>*)contours->GetObjectByOffset(counter);
     266
     267                /*Write header: */
     268                fprintf(fid,"## Name:%s\n",domainname);
     269                fprintf(fid,"## Icon:0\n");
     270                fprintf(fid,"# Points Count     Value\n");
     271                fprintf(fid,"%u %s\n",contour->nods  ,"1.");
     272                fprintf(fid,"# X pos    Y pos\n");
     273
     274                /*Write vertices: */
     275                for(int i=0;i<contour->nods;i++){
     276                        fprintf(fid,"%lf\t%lf\n",contour->x[i],contour->y[i]);
     277                }
     278
     279                /*Write blank line: */
     280                if(counter<contours->Size()-1) fprintf(fid,"\n");
     281        }
     282
     283        /*close Exp file: */
     284        fclose(fid);
     285
     286        return 1;
     287}/*}}}*/
     288template <class doubletype> DataSet* ExpRead(char* domainname){ /*{{{*/
     289
     290        /*intermediary: */
     291        int                  nprof;
     292        int                 *profnvertices = NULL;
     293        doubletype         **pprofx        = NULL;
     294        doubletype         **pprofy        = NULL;
     295
     296        /*output: */
     297        DataSet *domain = NULL;
     298
     299        /*If domainname is an empty string, return empty dataset*/
     300        if (strcmp(domainname,"")==0){
     301                nprof=0;
     302        }
     303        else{
     304                ExpRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname);
     305        }
     306
     307        /*now create dataset of contours: */
     308        domain=new DataSet(0);
     309
     310        for(int i=0;i<nprof;i++){
     311                domain->AddObject(new Contour<doubletype>(i,profnvertices[i],pprofx[i],pprofy[i],1));
     312        }
     313        return domain;
     314} /*}}}*/
  • issm/trunk-jpl/src/c/Container/DataSet.h

    r14903 r14953  
    6060};
    6161
     62/*Methods that relate to datasets: */
     63int ExpWrite(DataSet* contours,char* domainname);
     64template <class doubletype> DataSet* ExpRead(char* domainname);
     65
    6266#endif
  • issm/trunk-jpl/src/c/Container/Elements.cpp

    r14951 r14953  
    1111#endif
    1212
    13 #include <vector>
    14 #include <functional>
    15 #include <algorithm>
    16 #include <iostream>
    17 
    18 #include "./DataSet.h"
    19 #include "../shared/shared.h"
     13#include "./Elements.h"
     14#include "./Parameters.h"
     15#include "../classes/classes.h"
    2016#include "../EnumDefinitions/EnumDefinitions.h"
    21 #include "../classes/objects/Elements/Element.h"
    22 #include "../classes/objects/ExternalResults/GenericExternalResult.h"
    23 #include "../classes/Patch.h"
    24 #include "../classes/toolkits/Vector.h"
     17
    2518
    2619using namespace std;
  • issm/trunk-jpl/src/c/Container/Elements.h

    r14476 r14953  
    33
    44/*forward declarations */
     5#include "./DataSet.h"
    56class Materials;
    67class Parameters;
     
    910class Loads;
    1011class Nodes;
    11 class DataSet;
    1212class Inputs;
    1313
  • issm/trunk-jpl/src/c/Container/Inputs.cpp

    r14951 r14953  
    1111#endif
    1212
    13 #include <vector>
    14 #include <functional>
    15 #include <algorithm>
    16 #include <iostream>
    17 
    18 #include "./DataSet.h"
     13#include "./Inputs.h"
     14#include "../classes/objects/Inputs/Input.h"
    1915#include "../shared/shared.h"
    2016#include "../EnumDefinitions/EnumDefinitions.h"
    21 #include "../classes/objects/Inputs/Input.h"
    2217
    2318using namespace std;
  • issm/trunk-jpl/src/c/Container/Inputs.h

    r14951 r14953  
    44/*forward declarations */
    55class Parameters;
    6 class DataSet;
    76class Input;
     7#include "./DataSet.h"
    88#include "../shared/Numerics/types.h"
    99
  • issm/trunk-jpl/src/c/Container/Materials.cpp

    r14951 r14953  
    1111#endif
    1212
    13 #include <vector>
    14 #include <functional>
    15 #include <algorithm>
    16 #include <iostream>
    17 
    18 #include "./DataSet.h"
     13#include "./Materials.h"
    1914#include "../shared/shared.h"
    2015#include "../EnumDefinitions/EnumDefinitions.h"
  • issm/trunk-jpl/src/c/Container/Materials.h

    r14476 r14953  
    33
    44/*forward declarations */
     5#include "./DataSet.h"
    56class Parameters;
    67class Elements;
     
    89class Loads;
    910class Nodes;
    10 class DataSet;
    1111class Inputs;
    1212
  • issm/trunk-jpl/src/c/Container/Nodes.cpp

    r14951 r14953  
    1111#endif
    1212
    13 #include <vector>
    14 #include <functional>
    15 #include <algorithm>
    16 #include <iostream>
    17 
    18 #include "./DataSet.h"
     13#include "./Nodes.h"
    1914#include "../shared/shared.h"
    2015#include "../EnumDefinitions/EnumDefinitions.h"
  • issm/trunk-jpl/src/c/Container/Nodes.h

    r14903 r14953  
    22#define  _CONTAINER_NODES_H_
    33
    4 class DataSet;
     4#include "./DataSet.h"
    55
    66/*!\brief Declaration of Nodes class.
  • issm/trunk-jpl/src/c/Container/Parameters.h

    r14476 r14953  
    1414class DataSet;
    1515class Inputs;
     16#include "../shared/Numerics/types.h"
    1617
    1718/*!\brief Declaration of Parameters class. 
  • issm/trunk-jpl/src/c/Container/Results.cpp

    r14951 r14953  
    1111#endif
    1212
    13 #include <vector>
    14 #include <functional>
    15 #include <algorithm>
    16 #include <iostream>
    17 
    18 #include "./DataSet.h"
     13#include "./Results.h"
     14#include "./Parameters.h"
    1915#include "../shared/shared.h"
    2016#include "../EnumDefinitions/EnumDefinitions.h"
  • issm/trunk-jpl/src/c/Container/Results.h

    r14476 r14953  
    11#ifndef _CONTAINER_RESULTS_H_
    22#define  _CONTAINER_RESULTS_H_
     3
     4#include "./DataSet.h"
    35
    46/*forward declarations */
     
    911class Loads;
    1012class Nodes;
    11 class DataSet;
    1213class Inputs;
    1314
  • issm/trunk-jpl/src/c/Makefile.am

    r14951 r14953  
    787787                        ./shared/Threads/PartitionRange.cpp\
    788788                        ./shared/Exp/exp.h\
    789                         ./shared/Exp/IsInPoly.cpp\
    790                         ./shared/Exp/IsInPolySerial.cpp\
    791                         ./shared/Exp/ExpWrite.cpp\
     789                        ./shared/Exp/exp.cpp\
    792790                        ./shared/TriMesh/trimesh.h\
    793791                        ./shared/TriMesh/AssociateSegmentToElement.cpp\
  • issm/trunk-jpl/src/c/classes/objects/Elements/Element.h

    r14951 r14953  
    2929
    3030                virtual void   Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
    31                 virtual void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
     31                virtual void   SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters)=0;
    3232                virtual void   SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum)=0;
    3333                virtual void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>*  Kfs)=0;
  • issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp

    r14923 r14953  
    27512751/*}}}*/
    27522752/*FUNCTION Penta::SetCurrentConfiguration {{{*/
    2753 void  Penta::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
     2753void  Penta::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, Nodes* nodesin, Materials* materialsin, Parameters* parametersin){
    27542754
    27552755        int analysis_counter;
  • issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h

    r14917 r14953  
    7979                void   ComputeStressTensor();
    8080                void   Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    81                 void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
     81                void   SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
    8282                void   SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum);
    8383                void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp

    r14928 r14953  
    25322532/*}}}*/
    25332533/*FUNCTION Tria::SetCurrentConfiguration {{{*/
    2534 void  Tria::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
     2534void  Tria::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, Nodes* nodesin, Materials* materialsin, Parameters* parametersin){
    25352535
    25362536        /*go into parameters and get the analysis_counter: */
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h

    r14917 r14953  
    7575                void   ComputeStressTensor();
    7676                void   Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters);
    77                 void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
     77                void   SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
    7878                void   SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum);
    7979                void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
  • issm/trunk-jpl/src/c/classes/objects/Inputs/Input.h

    r14951 r14953  
    1414class Parameters;
    1515class GaussPenta;
     16template <class doubletype> class Vector;
    1617/*}}}*/
     18
    1719
    1820class Input: public Object{
  • issm/trunk-jpl/src/c/classes/objects/Materials/Material.h

    r14951 r14953  
    88/*Headers:*/
    99/*{{{*/
    10 class Object;
     10class Inputs;
     11template <class doubletype> class Vector;
    1112#include "../Object.h"
    1213#include "../../Update.h"
    13 #include "../../../toolkits/toolkits.h"
    1414/*}}}*/
    1515
  • issm/trunk-jpl/src/c/classes/objects/Profiler.cpp

    r14951 r14953  
    1212#include "./Profiler.h"
    1313#include "./Params/DoubleParam.h"
     14#include "../../Container/Parameters.h"
    1415/*}}}*/
    1516
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h

    r14950 r14953  
    88#define RIFTINFOSIZE 12
    99
    10 class DataSet;
    11 class IoModel;
    12 class Parameters;
    13 class DofIndexing;
     10#include "../../Container/Container.h"
     11#include "../../classes/classes.h"
    1412
    15 #include "../../shared/io/io.h"
    1613
    1714void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads, Parameters** pparameters, FILE* iomodel_handle,char* rootpath,const int solution_type,const int nummodels,const int* analysis_type_listh);
  • issm/trunk-jpl/src/c/shared/Exp/exp.h

    r14680 r14953  
    77
    88#include <cstring>
    9 #include "../../classes/objects/Contour.h"
    10 #include "../../shared/Numerics/recast.h"
    11 #include "../../Container/Container.h"
     9#include "../Numerics/recast.h"
    1210#include "../../toolkits/toolkits.h"
    1311
    1412int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
    1513int ExpWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,char* domainname);
    16 int ExpWrite(DataSet* contours,char* domainname);
    1714int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
    1815
    19 /*IsInPoly {{{*/
    20 template <class doubletype>
    21 int IsInPoly(IssmSeqVec<doubletype>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
     16template <class doubletype> int IsInPoly(IssmSeqVec<doubletype>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ /*{{{*/
    2217
    2318        int i;
     
    5954         return 1;
    6055}/*}}}*/
    61 /*int      ExpRead(int* pnprof,int** pprofnvertices,doubletype*** ppprofx,doubletype*** ppprofy,bool** pclosed,char* domainname){{{*/
    62 template <class doubletype>
    63 int ExpRead(int* pnprof,int** pprofnvertices,doubletype*** ppprofx,doubletype*** ppprofy,bool** pclosed,char* domainname){
     56template <class doubletype> int ExpRead(int* pnprof,int** pprofnvertices,doubletype*** ppprofx,doubletype*** ppprofy,bool** pclosed,char* domainname){ /*{{{*/
    6457
    6558        /*indexing: */
     
    178171
    179172} /*}}}*/
    180 /*DataSet* ExpRead(char* domainname){{{*/
    181 template <class doubletype>
    182 DataSet* ExpRead(char* domainname){
    183 
    184         /*intermediary: */
    185         int                  nprof;
    186         int                 *profnvertices = NULL;
    187         doubletype         **pprofx        = NULL;
    188         doubletype         **pprofy        = NULL;
    189 
    190         /*output: */
    191         DataSet *domain = NULL;
    192 
    193         /*If domainname is an empty string, return empty dataset*/
    194         if (strcmp(domainname,"")==0){
    195                 nprof=0;
    196         }
    197         else{
    198                 ExpRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname);
    199         }
    200 
    201         /*now create dataset of contours: */
    202         domain=new DataSet(0);
    203 
    204         for(int i=0;i<nprof;i++){
    205                 domain->AddObject(new Contour<doubletype>(i,profnvertices[i],pprofx[i],pprofy[i],1));
    206         }
    207         return domain;
    208 } /*}}}*/
    209173
    210174#endif
Note: See TracChangeset for help on using the changeset viewer.