⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fe_base.c

📁 一个用来实现偏微分方程中网格的计算库
💻 C
📖 第 1 页 / 共 5 页
字号:
// $Id: fe_base.C 2829 2008-05-02 21:53:09Z roystgnr $// The libMesh Finite Element Library.// Copyright (C) 2002-2007  Benjamin S. Kirk, John W. Peterson  // This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation; either// version 2.1 of the License, or (at your option) any later version.  // This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU// Lesser General Public License for more details.  // You should have received a copy of the GNU Lesser General Public// License along with this library; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA// Local includes#include "fe.h"#include "inf_fe.h"#include "libmesh_logging.h"// For projection code:#include "boundary_info.h"#include "mesh_base.h"#include "dense_matrix.h"#include "dense_vector.h"#include "dof_map.h"#include "elem.h"#include "fe_interface.h"#include "numeric_vector.h"#include "quadrature.h"#include "quadrature_gauss.h"#include "threads.h"// ------------------------------------------------------------// FEBase class membersAutoPtr<FEBase> FEBase::build (const unsigned int dim,			       const FEType& fet){  // The stupid AutoPtr<FEBase> ap(); return ap;  // construct is required to satisfy IBM's xlC  switch (dim)    {      // 1D    case 1:      {	switch (fet.family)	  {	  case CLOUGH:	    {	      AutoPtr<FEBase> ap(new FE<1,CLOUGH>(fet));	      return ap;	    }	    	  case HERMITE:	    {	      AutoPtr<FEBase> ap(new FE<1,HERMITE>(fet));	      return ap;	    }	    	  case LAGRANGE:	    {	      AutoPtr<FEBase> ap(new FE<1,LAGRANGE>(fet));	      return ap;	    }		   	  case HIERARCHIC:	    {	      AutoPtr<FEBase> ap(new FE<1,HIERARCHIC>(fet));	      return ap;	    }	    	  case MONOMIAL:	    {	      AutoPtr<FEBase> ap(new FE<1,MONOMIAL>(fet));	      return ap;	    }	    #ifdef ENABLE_HIGHER_ORDER_SHAPES	  case SZABAB:	    {	      AutoPtr<FEBase> ap(new FE<1,SZABAB>(fet));	      return ap;	    }	  case BERNSTEIN:	    {	      AutoPtr<FEBase> ap(new FE<1,BERNSTEIN>(fet));	      return ap;	    }#endif	  case XYZ:	    {	      AutoPtr<FEBase> ap(new FEXYZ<1>(fet));	      return ap;	    }	  default:	    std::cout << "ERROR: Bad FEType.family= " << fet.family << std::endl;	    libmesh_error();	  }      }            // 2D    case 2:      {	switch (fet.family)	  {	  case CLOUGH:	    {	      AutoPtr<FEBase> ap(new FE<2,CLOUGH>(fet));	      return ap;	    }	    	  case HERMITE:	    {	      AutoPtr<FEBase> ap(new FE<2,HERMITE>(fet));	      return ap;	    }	  case LAGRANGE:	    {	      AutoPtr<FEBase> ap(new FE<2,LAGRANGE>(fet));	      return ap;	    }	    	  case HIERARCHIC:	    {	      AutoPtr<FEBase> ap(new FE<2,HIERARCHIC>(fet));	      return ap;	    }	    	  case MONOMIAL:	    {	      AutoPtr<FEBase> ap(new FE<2,MONOMIAL>(fet));	      return ap;	    }	    #ifdef ENABLE_HIGHER_ORDER_SHAPES	  case SZABAB:	    {	      AutoPtr<FEBase> ap(new FE<2,SZABAB>(fet));	      return ap;	    }	  case BERNSTEIN:	    {	      AutoPtr<FEBase> ap(new FE<2,BERNSTEIN>(fet));	      return ap;	    }#endif	  case XYZ:	    {	      AutoPtr<FEBase> ap(new FEXYZ<2>(fet));	      return ap;	    }	  default:	    std::cout << "ERROR: Bad FEType.family= " << fet.family << std::endl;	    libmesh_error();	  }      }            // 3D    case 3:      {	switch (fet.family)	  {	  case CLOUGH:	    {	      std::cout << "ERROR: Clough-Tocher elements currently only support 1D and 2D" <<		      std::endl;	      libmesh_error();	    }	    	  case HERMITE:	    {	      AutoPtr<FEBase> ap(new FE<3,HERMITE>(fet));	      return ap;	    }	    	  case LAGRANGE:	    {	      AutoPtr<FEBase> ap(new FE<3,LAGRANGE>(fet));	      return ap;	    }	    	  case HIERARCHIC:	    {	      AutoPtr<FEBase> ap(new FE<3,HIERARCHIC>(fet));	      return ap;	    }	    	  case MONOMIAL:	    {	      AutoPtr<FEBase> ap(new FE<3,MONOMIAL>(fet));	      return ap;	    }	    #ifdef ENABLE_HIGHER_ORDER_SHAPES	  case SZABAB:	    {	      AutoPtr<FEBase> ap(new FE<3,SZABAB>(fet));	      return ap;	    }	  case BERNSTEIN:	    {	      AutoPtr<FEBase> ap(new FE<3,BERNSTEIN>(fet));	      return ap;	    }#endif	  case XYZ:	    {	      AutoPtr<FEBase> ap(new FEXYZ<3>(fet));	      return ap;	    }	  default:	    std::cout << "ERROR: Bad FEType.family= " << fet.family << std::endl;	    libmesh_error();	  }      }    default:      libmesh_error();    }  libmesh_error();  AutoPtr<FEBase> ap(NULL);  return ap;}#ifdef ENABLE_INFINITE_ELEMENTSAutoPtr<FEBase> FEBase::build_InfFE (const unsigned int dim,				     const FEType& fet){  // The stupid AutoPtr<FEBase> ap(); return ap;  // construct is required to satisfy IBM's xlC  switch (dim)    {      // 1D    case 1:      {	switch (fet.radial_family)	  {	  case INFINITE_MAP:	    {	      std::cerr << "ERROR: Don't build an infinite element " << std::endl			<< " with FEFamily = " << fet.radial_family << std::endl;	      libmesh_error();	    }	  case JACOBI_20_00:	    {  	      switch (fet.inf_map)	        {		  case CARTESIAN:		    {		      AutoPtr<FEBase> ap(new InfFE<1,JACOBI_20_00,CARTESIAN>(fet));		      return ap;		    }		  default:		    std::cerr << "ERROR: Don't build an infinite element " << std::endl			      << " with InfMapType = " << fet.inf_map << std::endl;		    libmesh_error();		}	    }	  case JACOBI_30_00:	    {  	      switch (fet.inf_map)	        {		  case CARTESIAN:		    {		      AutoPtr<FEBase> ap(new InfFE<1,JACOBI_30_00,CARTESIAN>(fet));		      return ap;		    }		  default:		    std::cerr << "ERROR: Don't build an infinite element " << std::endl			      << " with InfMapType = " << fet.inf_map << std::endl;		    libmesh_error();		}	    }	  case LEGENDRE:	    {  	      switch (fet.inf_map)	        {		  case CARTESIAN:		    {		      AutoPtr<FEBase> ap(new InfFE<1,LEGENDRE,CARTESIAN>(fet));		      return ap;		    }		  default:		    std::cerr << "ERROR: Don't build an infinite element " << std::endl			      << " with InfMapType = " << fet.inf_map << std::endl;		    libmesh_error();		}	    }	  case LAGRANGE:	    {  	      switch (fet.inf_map)	        {		  case CARTESIAN:		    {		      AutoPtr<FEBase> ap(new InfFE<1,LAGRANGE,CARTESIAN>(fet));		      return ap;		    }		  default:		    std::cerr << "ERROR: Don't build an infinite element " << std::endl			      << " with InfMapType = " << fet.inf_map << std::endl;		    libmesh_error();		}	    }	    	  default:	    std::cerr << "ERROR: Bad FEType.radial_family= " << fet.radial_family << std::endl;	    libmesh_error();	  }      }            // 2D    case 2:      {	switch (fet.radial_family)	  {	  case INFINITE_MAP:	    {	      std::cerr << "ERROR: Don't build an infinite element " << std::endl			<< " with FEFamily = " << fet.radial_family << std::endl;	      libmesh_error();	    }	  case JACOBI_20_00:	    {  	      switch (fet.inf_map)	        {		  case CARTESIAN:		    {		      AutoPtr<FEBase> ap(new InfFE<2,JACOBI_20_00,CARTESIAN>(fet));		      return ap;		    }		  default:		    std::cerr << "ERROR: Don't build an infinite element " << std::endl			      << " with InfMapType = " << fet.inf_map << std::endl;		    libmesh_error();		}	    }	  case JACOBI_30_00:	    {  	      switch (fet.inf_map)	        {		  case CARTESIAN:		    {		      AutoPtr<FEBase> ap(new InfFE<2,JACOBI_30_00,CARTESIAN>(fet));		      return ap;		    }		  default:		    std::cerr << "ERROR: Don't build an infinite element " << std::endl			      << " with InfMapType = " << fet.inf_map << std::endl;		    libmesh_error();		}	    }	  case LEGENDRE:	    {  	      switch (fet.inf_map)	        {		  case CARTESIAN:		    {		      AutoPtr<FEBase> ap(new InfFE<2,LEGENDRE,CARTESIAN>(fet));		      return ap;		    }		  default:		    std::cerr << "ERROR: Don't build an infinite element " << std::endl			      << " with InfMapType = " << fet.inf_map << std::endl;		    libmesh_error();		}	    }	  case LAGRANGE:	    {  	      switch (fet.inf_map)	        {		  case CARTESIAN:		    {		      AutoPtr<FEBase> ap(new InfFE<2,LAGRANGE,CARTESIAN>(fet));		      return ap;		    }		  default:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -