| 1987 | |
| 1988 | |
| 1989 | SectionForceDeformation* |
| 1990 | |
| 1991 | FiberSection2dInt::getCopy(void) |
| 1992 | |
| 1993 | { |
| 1994 | |
| 1995 | FiberSection2dInt *theCopy = new FiberSection2dInt (); |
| 1996 | |
| 1997 | theCopy->setTag(this->getTag()); |
| 1998 | |
| 1999 | |
| 2000 | |
| 2001 | theCopy->numFibers = numFibers; |
| 2002 | |
| 2003 | |
| 2004 | |
| 2005 | if (numFibers != 0) { |
| 2006 | |
| 2007 | theCopy->theMaterials1 = new UniaxialMaterial *[numFibers]; |
| 2008 | |
| 2009 | theCopy->theMaterials2 = new UniaxialMaterial *[numFibers]; |
| 2010 | |
| 2011 | |
| 2012 | |
| 2013 | if (theCopy->theMaterials1 == 0) { |
| 2014 | |
| 2015 | opserr <<"FiberSection2dInt::getCopy -- failed to allocate Material pointers\n"; |
| 2016 | |
| 2017 | exit(-1); |
| 2018 | |
| 2019 | } |
| 2020 | |
| 2021 | |
| 2022 | |
| 2023 | theCopy->matData = new double [numFibers*2]; |
| 2024 | |
| 2025 | |
| 2026 | |
| 2027 | if (theCopy->matData == 0) { |
| 2028 | |
| 2029 | opserr << "FiberSection2dInt::getCopy -- failed to allocate double array for material data\n"; |
| 2030 | |
| 2031 | exit(-1); |
| 2032 | |
| 2033 | } |
| 2034 | |
| 2035 | |
| 2036 | |
| 2037 | for (int i = 0; i < numFibers; i++) { |
| 2038 | |
| 2039 | theCopy->matData[i*2] = matData[i*2]; |
| 2040 | |
| 2041 | theCopy->matData[i*2+1] = matData[i*2+1]; |
| 2042 | |
| 2043 | theCopy->theMaterials1[i] = theMaterials1[i]->getCopy(); |
| 2044 | |
| 2045 | theCopy->theMaterials2[i] = theMaterials2[i]->getCopy(); |
| 2046 |
no test coverage detected