Changeset 27939
- Timestamp:
- 10/04/23 18:01:45 (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r27938 r27939 1903 1903 /*Are we in transient or static? */ 1904 1904 if(M==1){ 1905 values[0]=vector[0];1905 _assert_(N==1); 1906 1906 this->SetElementInput(inputs,vector_enum,vector[0]); 1907 1907 } 1908 1908 1909 else if(M==iomodel->numberofvertices){ 1910 _assert_(N==1); 1909 1911 for(int i=0;i<NUM_VERTICES;i++) values[i]=vector[vertexids[i]-1]; 1910 1912 this->SetElementInput(inputs,NUM_VERTICES,vertexlids,values,vector_enum); … … 1956 1958 else if(vector_type==2){ //element vector 1957 1959 1958 IssmDouble value;1959 1960 1960 /*Are we in transient or static? */ 1961 if(M==iomodel->numberofelements){ 1961 if(M==1){ 1962 _assert_(N==1); 1963 this->SetElementInput(inputs,vector_enum,vector[0]); 1964 } 1965 else if(M==2){ 1966 /*create transient input: */ 1967 IssmDouble* times = xNew<IssmDouble>(N); 1968 for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t]; 1969 1970 inputs->SetTransientInput(vector_enum,times,N); 1971 TransientInput* transientinput = inputs->GetTransientInput(vector_enum); 1972 1973 for(int t=0;t<N;t++){ 1974 IssmDouble value=vector[t]; //values are on the first line, times are on the second line 1975 switch(this->ObjectEnum()){ 1976 case TriaEnum: transientinput->AddTriaTimeInput( t,1,&(this->lid),&value,P0Enum); break; 1977 case PentaEnum: transientinput->AddPentaTimeInput(t,1,&(this->lid),&value,P0Enum); break; 1978 default: _error_("Not implemented yet"); 1979 } 1980 } 1981 xDelete<IssmDouble>(times); 1982 } 1983 else if(M==iomodel->numberofelements){ 1984 _assert_(N==1); 1962 1985 if (code==5){ //boolean 1963 1986 this->SetBoolInput(inputs,vector_enum,reCast<bool>(vector[this->Sid()])); … … 1978 2001 TransientInput* transientinput = inputs->GetTransientInput(vector_enum); 1979 2002 for(int t=0;t<N;t++){ 1980 value=vector[N*this->Sid()+t];2003 IssmDouble value=vector[N*this->Sid()+t]; 1981 2004 switch(this->ObjectEnum()){ 1982 2005 case TriaEnum: transientinput->AddTriaTimeInput( t,1,&(this->lid),&value,P0Enum); break; … … 1987 2010 xDelete<IssmDouble>(times); 1988 2011 } 1989 else if(M==2){ 1990 /*create transient input: */ 1991 IssmDouble* times = xNew<IssmDouble>(N); 1992 for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t]; 1993 1994 inputs->SetTransientInput(vector_enum,times,N); 1995 TransientInput* transientinput = inputs->GetTransientInput(vector_enum); 1996 1997 for(int t=0;t<N;t++){ 1998 value=vector[t]; //values are on the first line, times are on the second line 1999 switch(this->ObjectEnum()){ 2000 case TriaEnum: transientinput->AddTriaTimeInput( t,1,&(this->lid),&value,P0Enum); break; 2001 case PentaEnum: transientinput->AddPentaTimeInput(t,1,&(this->lid),&value,P0Enum); break; 2002 default: _error_("Not implemented yet"); 2003 } 2004 } 2005 xDelete<IssmDouble>(times); 2006 } 2012 2007 2013 else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long"); 2008 2014 }
Note:
See TracChangeset
for help on using the changeset viewer.