forked from libMesh/libmesh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Singletons for each reference element type.
This patch implements singleton objects for each reference element type. At presenent they are read from our "reference_elements/" files, but that does not scale. My next attempt will be to embed those definitions automatically through static stringstream objects. This is an incrimental feature to support the following usage: Elem *phys_elem; Elem const * ref_elem = phys_elem->reference_elem(); where phys_elem is a typical element and ref_elem is its reference element in parametric coordinates.
- Loading branch information
Showing
8 changed files
with
557 additions
and
81 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// The libMesh Finite Element Library. | ||
// Copyright (C) 2002-2013 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner | ||
|
||
// 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 | ||
|
||
|
||
|
||
#ifndef LIBMESH_REFERENCE_ELEM_H | ||
#define LIBMESH_REFERENCE_ELEM_H | ||
|
||
// Local includes | ||
#include "libmesh/libmesh_common.h" | ||
#include "libmesh/enum_elem_type.h" | ||
|
||
// C++ includes | ||
|
||
namespace libMesh | ||
{ | ||
|
||
// forward declarations | ||
class Elem; | ||
|
||
/** | ||
* This namespace implements singleton reference elements for each | ||
* fundamental element type supported by \p libMesh. | ||
* | ||
* \author Benjamin S. Kirk, 2013. | ||
*/ | ||
namespace ReferenceElem | ||
{ | ||
/** | ||
* @returns a constant reference to the reference element of | ||
* the user-requested type. | ||
*/ | ||
Elem const* get (const ElemType Type); | ||
|
||
/** | ||
* Cleans up static singleton data. | ||
*/ | ||
void clear(); | ||
|
||
} // namespace ReferenceElem | ||
|
||
|
||
} // namespace libMesh | ||
|
||
|
||
#endif // LIBMESH_REFERENCE_ELEM_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.