Changeset 16125 for issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
- Timestamp:
- 09/11/13 14:22:13 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.cpp ¶
r16042 r16125 1767 1767 void Tria::InputUpdateFromVector(IssmDouble* vector, int name, int type){ 1768 1768 1769 const int numnodes = NUMVERTICES;1770 int *doflist = NULL;1771 IssmDouble values[numnodes];1772 1769 1773 1770 /*Check that name is an element input*/ 1774 1771 if (!IsInput(name)) return; 1772 1773 int numnodes; 1774 int *doflist = NULL; 1775 IssmDouble *values = NULL; 1775 1776 1776 1777 switch(type){ … … 1802 1803 1803 1804 case NodesEnum: 1804 _assert_(this->element_type==P1Enum); 1805 /*Get dof list: */ 1805 1806 /*Get number of nodes and dof list: */ 1807 numnodes = this->NumberofNodes(); 1808 values = xNew<IssmDouble>(numnodes); 1806 1809 GetDofList(&doflist,NoneApproximationEnum,GsetEnum); 1807 1810 … … 1809 1812 for(int i=0;i<numnodes;i++){ 1810 1813 values[i]=vector[doflist[i]]; 1811 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector"); 1812 } 1814 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in vector"); 1815 } 1816 1813 1817 /*Add input to the element: */ 1814 this->inputs->AddInput(new TriaInput(name,values, P1Enum));1818 this->inputs->AddInput(new TriaInput(name,values,this->element_type)); 1815 1819 1816 1820 /*Free ressources:*/ … … 1819 1823 1820 1824 case NodeSIdEnum: 1821 _assert_(this->element_type==P1Enum); 1822 for(int i=0;i<NUMVERTICES;i++){ 1825 1826 /*Get number of nodes and dof list: */ 1827 numnodes = this->NumberofNodes(); 1828 values = xNew<IssmDouble>(numnodes); 1829 1830 for(int i=0;i<numnodes;i++){ 1823 1831 values[i]=vector[nodes[i]->Sid()]; 1824 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solutionvector");1832 if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in vector"); 1825 1833 } 1826 1834 /*Add input to the element: */ 1827 this->inputs->AddInput(new TriaInput(name,values, P1Enum));1835 this->inputs->AddInput(new TriaInput(name,values,this->element_type)); 1828 1836 return; 1829 1837 … … 1832 1840 } 1833 1841 1834 } 1835 /*}}}*/ 1836 /*FUNCTION Tria::InputUpdateFromVector(int* vector, int name, int type);{{{*/ 1837 void Tria::InputUpdateFromVector(int* vector, int name, int type){ 1838 _error_("not supported yet!"); 1839 } 1840 /*}}}*/ 1841 /*FUNCTION Tria::InputUpdateFromVector(bool* vector, int name, int type);{{{*/ 1842 void Tria::InputUpdateFromVector(bool* vector, int name, int type){ 1843 _error_("not supported yet!"); 1842 /*Clean-up*/ 1843 xDelete<int>(doflist); 1844 xDelete<IssmDouble>(values); 1845 1844 1846 } 1845 1847 /*}}}*/ … … 5574 5576 5575 5577 gauss=new GaussTria(); 5576 for 5578 for(int iv=0;iv<NUMVERTICES;iv++){ 5577 5579 gauss->GaussVertex(iv); 5578 5580 surfaceslopex_input->GetInputValue(&dsdx,gauss); … … 7003 7005 } 7004 7006 7005 }7006 /*}}}*/7007 /*FUNCTION Tria::InputUpdateFromVectorDakota(int* vector, int name, int type);{{{*/7008 void Tria::InputUpdateFromVectorDakota(int* vector, int name, int type){7009 _error_("not supported yet!");7010 }7011 /*}}}*/7012 /*FUNCTION Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type);{{{*/7013 void Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type){7014 _error_("not supported yet!");7015 7007 } 7016 7008 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.