Changeset 16740
- Timestamp:
- 11/13/13 15:25:50 (11 years ago)
- Location:
- issm/trunk-jpl/src/c/classes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r16739 r16740 1931 1931 else if(M==iomodel->numberofvertices+1){ 1932 1932 /*create transient input: */ 1933 for(t=0;t<N;t++){ //N is the number of times 1934 1935 /*create input values: */ 1936 for(i=0;i<6;i++){ 1937 row=penta_vertex_ids[i]-1; 1938 nodeinputs[i]=(IssmDouble)vector[N*row+t]; 1939 } 1940 1941 /*time? :*/ 1942 time=(IssmDouble)vector[(M-1)*N+t]; 1943 1944 if(t==0)transientinput=new TransientInput(vector_enum); 1945 transientinput->AddTimeInput(new PentaInput(vector_enum,nodeinputs,P1Enum),time); 1933 IssmDouble* times = xNew<IssmDouble>(N); 1934 for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t]; 1935 transientinput=new TransientInput(vector_enum,times,N); 1936 for(t=0;t<N;t++){ 1937 for(i=0;i<NUMVERTICES;i++) nodeinputs[i]=vector[N*(penta_vertex_ids[i]-1)+t]; 1938 transientinput->AddTimeInput(new PentaInput(vector_enum,nodeinputs,P1Enum)); 1946 1939 } 1947 1940 this->inputs->AddInput(transientinput); 1941 xDelete<IssmDouble>(times); 1948 1942 } 1949 1943 else _error_("nodal vector is either numberofvertices (" << iomodel->numberofvertices << "), or numberofvertices+1 long. Field provided is " << M << " long. Enum " << EnumToStringx(vector_enum)); -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r16727 r16740 2095 2095 else if(M==iomodel->numberofvertices+1){ 2096 2096 /*create transient input: */ 2097 for(t=0;t<N;t++){ //N is the number of times 2098 2099 /*create input values: */ 2100 for(i=0;i<3;i++){ 2101 row=tria_vertex_ids[i]-1; 2102 nodeinputs[i]=vector[N*row+t]; 2103 } 2104 2105 /*time? :*/ 2106 time=vector[(M-1)*N+t]; 2107 2108 if(t==0) transientinput=new TransientInput(vector_enum); 2109 transientinput->AddTimeInput(new TriaInput(vector_enum,nodeinputs,P1Enum),time); 2097 IssmDouble* times = xNew<IssmDouble>(N); 2098 for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t]; 2099 transientinput=new TransientInput(vector_enum,times,N); 2100 for(t=0;t<N;t++){ 2101 for(i=0;i<NUMVERTICES;i++) nodeinputs[i]=vector[N*(tria_vertex_ids[i]-1)+t]; 2102 transientinput->AddTimeInput(new TriaInput(vector_enum,nodeinputs,P1Enum)); 2110 2103 } 2111 2104 this->inputs->AddInput(transientinput); 2105 xDelete<IssmDouble>(times); 2112 2106 } 2113 2107 else _error_("nodal vector is either numberofvertices or numberofvertices+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long"); -
issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
r16675 r16740 39 39 } 40 40 /*}}}*/ 41 /*FUNCTION TransientInput::TransientInput(int in_enum_type,IssmDouble* timesin,int N){{{*/ 42 TransientInput::TransientInput(int in_enum_type,IssmDouble* timesin,int N){ 43 44 /*Set Enum*/ 45 enum_type=in_enum_type; 46 47 /*Allocate values and timesteps, and copy: */ 48 this->numtimesteps=N; 49 this->timesteps=xNew<IssmDouble>(N); 50 xMemCpy(this->timesteps,timesin,N); 51 52 inputs = new Inputs(); 53 this->parameters=NULL; 54 } 55 /*}}}*/ 41 56 /*FUNCTION TransientInput::~TransientInput{{{*/ 42 57 TransientInput::~TransientInput(){ … … 66 81 _printf_("---inputs: \n"); 67 82 for(i=0;i<this->numtimesteps;i++){ 68 _printf_(" time: " << this->timesteps[i] << " \n");83 _printf_(" time: " << this->timesteps[i]<<" "); 69 84 ((Input*)this->inputs->GetObjectByOffset(i))->Echo(); 70 85 } … … 314 329 } 315 330 /*}}}*/ 331 /*FUNCTION TransientInput::AddTimeInput{{{*/ 332 void TransientInput::AddTimeInput(Input* input){ 333 334 _assert_(this->inputs->Size()<this->numtimesteps); 335 inputs->AddObject(input); 336 337 } 338 /*}}}*/ 316 339 /*FUNCTION TransientInput::GetResultInterpolation{{{*/ 317 340 int TransientInput::GetResultInterpolation(void){ -
issm/trunk-jpl/src/c/classes/Inputs/TransientInput.h
r16675 r16740 26 26 TransientInput(); 27 27 TransientInput(int enum_type); 28 TransientInput(int in_enum_type,IssmDouble* times,int N); 28 29 ~TransientInput(); 29 30 void AddTimeInput(Input* input,IssmDouble time); 31 void AddTimeInput(Input* input); 30 32 /*}}}*/ 31 33 /*Object virtual functions definitions:{{{*/
Note:
See TracChangeset
for help on using the changeset viewer.