Moved linear elasticity simulator to Apps/LinearElasticity. Moved Doxyfile up from src-folder and renamed SplinedFEM.dox to IFEM.dox. Fixed some doxygen warnings from Utility and LinAlg.

git-svn-id: http://svn.sintef.no/trondheim/IFEM/trunk@850 e10b68d5-8a6e-419e-a041-bce267b0401d
This commit is contained in:
kmo 2011-02-27 15:00:33 +00:00 committed by Knut Morten Okstad
parent 715a0cddb8
commit cf0c64a1c1
16 changed files with 124 additions and 203 deletions

View File

@ -48,7 +48,7 @@ ENDIF(${ENABLE_SAMG})
FIND_PACKAGE(VTFWriter)
# Required include directories
SET(INCLUDES ${IFEM_INCLUDES} ${PROJECT_SOURCE_DIR}/..)
SET(INCLUDES ${IFEM_INCLUDES} ${PROJECT_SOURCE_DIR}/../LinearElasticity)
# Required libraries
SET(DEPLIBS ${IFEM_LIBRARIES}
@ -94,8 +94,9 @@ ENDIF(NOT WIN32)
# Enable all warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
FILE(GLOB_RECURSE NonLinEl_SRCS ${PROJECT_SOURCE_DIR}/../SIMLinEl?D.C
${PROJECT_SOURCE_DIR}/*.[Cf])
FILE(GLOB_RECURSE NonLinEl_SRCS
${PROJECT_SOURCE_DIR}/../LinearElasticity/SIMLinEl*.C
${PROJECT_SOURCE_DIR}/*.[Cf])
ADD_EXECUTABLE(NonLinEl ${NonLinEl_SRCS})
TARGET_LINK_LIBRARIES(NonLinEl ${DEPLIBS})

View File

@ -13,7 +13,6 @@
#include "SIMLinEl2D.h"
#include "LinearElasticity.h"
#include "FiniteDefElasticity/NonlinearElasticity.h"
#include "AnalyticSolutions.h"
#include "Functions.h"
#include "Utilities.h"
@ -24,17 +23,9 @@
#include <string.h>
SIMLinEl2D::SIMLinEl2D (int form, bool planeStress)
SIMLinEl2D::SIMLinEl2D (int, bool planeStress)
{
switch (form)
{
case SIM::LINEAR:
myProblem = new LinearElasticity(2,planeStress);
break;
case SIM::NONLINEAR:
myProblem = new NonlinearElasticity(2,planeStress);
break;
}
myProblem = new LinearElasticity(2,planeStress);
}

View File

@ -13,7 +13,6 @@
#include "SIMLinEl3D.h"
#include "LinearElasticity.h"
#include "FiniteDefElasticity/NonlinearElasticity.h"
#include "AnalyticSolutions.h"
#include "Functions.h"
#include "Utilities.h"
@ -151,17 +150,9 @@ private:
};
SIMLinEl3D::SIMLinEl3D (bool checkRHS, int form) : SIM3D(checkRHS)
SIMLinEl3D::SIMLinEl3D (bool checkRHS, int) : SIM3D(checkRHS)
{
switch (form)
{
case SIM::LINEAR:
myProblem = new LinearElasticity();
break;
case SIM::NONLINEAR:
myProblem = new NonlinearElasticity();
break;
}
myProblem = new LinearElasticity();
}

View File

@ -1,4 +1,4 @@
// $Id: main_LinEl3D.C,v 1.27 2011-02-08 09:32:18 kmo Exp $
// $Id$
//==============================================================================
//!
//! \file main_LinEl3D.C
@ -52,7 +52,6 @@
\arg -fixDup : Resolve co-located nodes by merging them into a single node
\arg -2D : Use two-parametric simulation driver (plane stress)
\arg -2Dpstrain : Use two-parametric simulation driver (plane strain)
\arg -TL : Use the nonlinear total-lagrangian elasticity integrand
\arg -lag : Use Lagrangian basis functions instead of splines/NURBS
\arg -spec : Use Spectral basis functions instead of splines/NURBS
*/
@ -62,7 +61,6 @@ int main (int argc, char** argv)
Profiler prof(argv[0]);
utl::profiler->start("Initialization");
SIM::Formulation form = SIM::LINEAR;
SystemMatrix::Type solver = SystemMatrix::SPARSE;
int nGauss = 4;
int format = -1;
@ -141,8 +139,6 @@ int main (int argc, char** argv)
fixDup = true;
else if (!strncmp(argv[i],"-2D",3))
twoD = strcmp(argv[i],"-2Dpstrain") ? 1 : 2;
else if (!strcmp(argv[i],"-TL"))
form = SIM::NONLINEAR;
else if (!strncmp(argv[i],"-lag",4))
SIMbase::discretization = SIMbase::Lagrange;
else if (!strncmp(argv[i],"-spec",5))
@ -155,8 +151,8 @@ int main (int argc, char** argv)
if (!infile)
{
std::cout <<"usage: "<< argv[0]
<<" <inputfile> [-dense|-spr|-superlu<nt>|-samg|-petsc]\n "
<<" [-free] [-lag] [-spec] [-2D[pstrain]] [-TL] [-nGauss <n>]\n"
<<" <inputfile> [-dense|-spr|-superlu<nt>|-samg|-petsc]\n"
<<" [-free] [-lag] [-spec] [-2D[pstrain]] [-nGauss <n>]\n"
<<" [-vtf <format>] [-nviz <nviz>]"
<<" [-nu <nu>] [-nv <nv>] [-nw <nw>]\n"
<<" [-eig <iop>] [-nev <nev>] [-ncv <ncv] [-shift <shf>]\n"
@ -192,8 +188,6 @@ int main (int argc, char** argv)
<<"\nNumber of eigenvalues: "<< nev
<<"\nNumber of Arnoldi vectors: "<< ncv
<<"\nShift value: "<< shf;
if (form == SIM::NONLINEAR)
std::cout <<"\nGreen-Lagrange strains are used";
if (SIMbase::discretization == SIMbase::Lagrange)
std::cout <<"\nLagrangian basis functions are used";
else if (SIMbase::discretization == SIMbase::Spectral)
@ -218,9 +212,9 @@ int main (int argc, char** argv)
// Read in model definitions and establish the FE data structures
SIMbase* model;
if (twoD)
model = new SIMLinEl2D(form,twoD==1);
model = new SIMLinEl2D(SIM::LINEAR,twoD==1);
else
model = new SIMLinEl3D(checkRHS,form);
model = new SIMLinEl3D(checkRHS);
if (!model->read(infile))
return 1;

View File

@ -1,4 +1,4 @@
// $Id: main_LinElStep.C,v 1.7 2011-02-05 18:32:25 kmo Exp $
// $Id$
//==============================================================================
//!
//! \file main_LinElStep.C

View File

@ -72,8 +72,7 @@ ELSEIF(SuperLU_LIBRARIES AND SuperLU_INCLUDES)
ENDIF(SuperLU_MT_LIBRARIES AND SuperLU_MT_INCLUDES AND "${ENABLE_SUPERLU_MT}")
IF(PETSC_LIBRARIES AND PETSC_INCLUDE_DIR)
SET(INCLUDES ${INCLUDES} ${PETSC_INCLUDE_DIR})
SET(INCLUDES ${INCLUDES} ${PETSCCONF_INCLUDE_DIR})
SET(INCLUDES ${INCLUDES} ${PETSC_INCLUDE_DIR} ${PETSCCONF_INCLUDE_DIR})
SET(DEPLIBS ${DEPLIBS} ${PETSC_LIBRARIES})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAS_PETSC")
FIND_PACKAGE(MPI REQUIRED)
@ -124,12 +123,9 @@ FILE(GLOB_RECURSE Poisson_SRCS ${PROJECT_SOURCE_DIR}/Apps/Poisson/*.C)
ADD_EXECUTABLE(Poisson ${Poisson_SRCS})
TARGET_LINK_LIBRARIES(Poisson IFEM ${DEPLIBS})
FILE(GLOB_RECURSE LinEl_SRCS ${PROJECT_SOURCE_DIR}/Apps/main_LinEl3D.C
${PROJECT_SOURCE_DIR}/Apps/SIMLinEl2D.C
${PROJECT_SOURCE_DIR}/Apps/SIMLinEl3D.C
${PROJECT_SOURCE_DIR}/Apps/FiniteDefElasticity/NonlinearElasticity.C
${PROJECT_SOURCE_DIR}/Apps/FiniteDefElasticity/NonlinearElasticityTL.C
${PROJECT_SOURCE_DIR}/Apps/FiniteDefElasticity/stiff_TL.f)
FILE(GLOB_RECURSE LinEl_SRCS
${PROJECT_SOURCE_DIR}/Apps/LinearElasticity/main_LinEl3D.C
${PROJECT_SOURCE_DIR}/Apps/LinearElasticity/SIMLinEl*.C)
ADD_EXECUTABLE(LinEl ${LinEl_SRCS})
TARGET_LINK_LIBRARIES(LinEl IFEM ${DEPLIBS})

View File

@ -25,7 +25,7 @@ DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = ICADA
PROJECT_NAME = IFEM
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
@ -38,7 +38,7 @@ PROJECT_NUMBER = 90A354
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = ../doc
OUTPUT_DIRECTORY = doc
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
@ -564,8 +564,9 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = Apps/FiniteDefElasticity Apps/Stokes Apps/Poisson \
Apps SIM ASM Integrands Eig LinAlg Utility ../doc
INPUT = doc Apps/Poisson Apps/LinearElasticity \
src/SIM src/ASM src/Integrands \
src/Eig src/LinAlg src/Utility
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is

54
doc/IFEM.dox Normal file
View File

@ -0,0 +1,54 @@
// $Id$
//==============================================================================
//!
//! \file IFEM.dox
//!
//! \date Jan 12 2010
//!
//! \author Knut Morten Okstad / SINTEF
//!
//! \brief File containing the Main Page of the spline FEM documentation.
//!
//==============================================================================
/*! \mainpage Toolbox for Isogeometric Finite Element analysis
\author Knut Morten Okstad, Sintef ICT, Trondheim
\section intro Introduction
IFEM is an object-oriented toolbox for implementing isogeometric finite element
solvers for linear and nonlinear partial differential equations.
The toolbox is developed through the ICADA project at SINTEF ICT, Trondheim.
The purpose of this code is to serve as a common base for isogeometric
PDE-simulators, using splines and NURBS as basis functions in the finite element
formulations. The toolbox contains methods for doing linear and non-linear,
stationary and dynamic time-domain analyses, as well as eigenvalue analyses.
\section overview Module overview
The simulation toolbox is organized into a set of modules,
organized as class hierarchies implemented in the C++ language.
The top-level driver is organized in the class SIMbase and its sub-classes.
These classes have methods for reading model data from an input file,
to assemble the linearized algebraic system of equations resulting from the
finite element discretization, and to solve that system.
It also contains methods for writing a VTF-file with results.
Problem-specific drivers and main programs are found in the sub-folder Apps.
The core of the finite element implementation is contained in the class
ASMbase and its sub-classes, which have methods for evaluating the element
matrices involved and assembling them into the system matrices.
There is typically one ASMbase object for each spline patch in the model.
The physical problem-dependent data and methods is accessed via an abstract
interface class, Integrand, through which the application programmer can
implement the weak form of the underlying finite element problem.
The actual splines evaluation is performed through the GoTools library, which is
not part of the current package. In addition, this code depends on the ARPACK,
LAPACK and BLAS libraries. Optionally, the SAMG algebraic multi-grid solver and
the SuperLU direct solver (public domain http://crd.lbl.gov/~xiaoye/SuperLU)
may be included. The Ceetron VTFAPI library may also be included for direct
export of simulations results to GLview VTF-files.
*/

View File

@ -1,45 +0,0 @@
// $Id: SplineFEM.dox,v 1.1 2010-01-12 15:35:06 kmo Exp $
//==============================================================================
//!
//! \file SplineFEM.dox
//!
//! \date Jan 12 2010
//!
//! \author Knut Morten Okstad / SINTEF
//!
//! \brief File containing the Main Page of the spline FEM documentation.
//!
//==============================================================================
/*! \mainpage The ICADA Spline FEM analysis toolbox
\author Knut Morten Okstad, Sintef ICT, Trondheim
\section intro Introduction
This is the source code documentation of the Spline FEM simulation toolbox
developed in the ICADA project at SINTEF ICT.
\section overview Module overview
The simulation toolbox is organized into a set of modules,
organized as class hierarchies implemented in the C++ language.
The top-level driver is organized in the class SIMbase and its sub-classes.
These classes have methods for reading model data from an input file,
to assemble the algebraic system of equations resulting from the finite element
discretization, and to solve that system. It also contains a method for writing
a VTF-file with results.
Problem-specific drivers and main programs are found in the sub-folder Apps.
The core of the finite element implementation is contained in the class
ASMbase and its sub-classes, which have methods for evaluating the element
matrices involved and assembling them into the system matrices.
There is typically one ASMbase object for each spline patch in the model.
The actual NURBS evaluation is performed through the GoTools library, which is
not part of the current package. In addition, this code depends on the ARPACK,
LAPACK and BLAS libraries, the VTFAPI library, and portions of the SAM library
(ASM and optionally SPR). Optionally, the SAMG algebraic multi-grid solver and
the SuperLU direct solver (public domain http://crd.lbl.gov/~xiaoye/SuperLU)
may be included.
*/

View File

@ -1,4 +1,4 @@
// $Id: MatVec.C,v 1.6 2010-12-18 19:54:54 kmo Exp $
// $Id$
//==============================================================================
//!
//! \file MatVec.C
@ -138,7 +138,7 @@ bool utl::invert (Matrix& A)
dgetrf_(N,N,A.ptr(),A.rows(),IPIV,INFO);
if (INFO != 0)
{
delete IPIV;
delete[] IPIV;
std::cerr <<" *** utl::invert:DGETRF: INFO = "<< INFO << std::endl;
return false;
}
@ -146,8 +146,8 @@ bool utl::invert (Matrix& A)
dgetri_(N,A.ptr(),A.rows(),IPIV,&NWORK,-1,INFO);
double* WORK = new double[int(NWORK)];
dgetri_(N,A.ptr(),A.rows(),IPIV,WORK,int(NWORK),INFO);
delete IPIV;
delete WORK;
delete[] IPIV;
delete[] WORK;
if (INFO == 0) return true;
std::cerr <<" *** utl::invert:DGETRI: INFO = "<< INFO << std::endl;
#else

View File

@ -1,4 +1,4 @@
// $Id: PETScMatrix.h,v 1.7 2011-02-08 12:46:29 rho Exp $
// $Id$
//==============================================================================
//!
//! \file PETScMatrix.h
@ -16,13 +16,7 @@
#define _PETSC_MATRIX_H
#include "SystemMatrix.h"
#ifdef HAS_PETSC
#include "LinSolParams.h"
#include "petscksp.h"
#endif
#ifdef HAS_SLEPC
#include "slepceps.h"
#endif
/*!
@ -72,12 +66,12 @@ public:
virtual void init(real value = real(0));
//! \brief Begins communication step needed in parallel vector assembly.
//! \details Must be called together with endAssembly after vector assembly
//! \details Must be called together with endAssembly after vector assembly
//! is completed on each processor and before the linear system is solved.
bool beginAssembly();
//! \brief Ends communication step needed in parallel vector assembly.
//! \details Must be called together with beginAssembly after vector assembly
//! \details Must be called together with beginAssembly after vector assembly
//! is completed on each processor and before the linear system is solved.
bool endAssembly();
@ -134,6 +128,9 @@ public:
PETScMatrix(const PETScMatrix& A);
//! \brief The destructor frees the dynamically allocated arrays.
virtual ~PETScMatrix();
#else
//! \brief Constructor.
PETScMatrix(const LinSolParams&) {}
#endif
//! \brief Returns the matrix type.
@ -150,12 +147,11 @@ public:
virtual void init();
//! \brief Begins communication step needed in parallel matrix assembly.
//! \details Must be called together with endAssembly after matrix assembly
//! \details Must be called together with endAssembly after matrix assembly
//! is completed on each processor and before the linear system is solved.
bool beginAssembly();
//! \brief Ends communication step needed in parallel matrix assembly.
//! \details Must be called together with beginAssembly after matrix assembly
//! \details Must be called together with beginAssembly after matrix assembly
//! is completed on each processor and before the linear system is solved.
bool endAssembly();
@ -212,10 +208,8 @@ private:
KSP ksp; //!< Linear solver
MatNullSpace nsp; //!< Null-space of linear operator
const LinSolParams& solParams; //!< Linear solver parameters
//EPS eps; //!< Eigenvalue solver
#else // dummy implementation when PETSc is not included
PETScMatrix(const LinSolParams&) {}
virtual SystemMatrix* copy() const { return 0; }
virtual void init() {}
virtual void initAssembly(const SAM&) {}

View File

@ -1,50 +0,0 @@
// $Id: SplineFEM.dox,v 1.3 2009-09-15 07:12:54 kmo Exp $
//==============================================================================
//!
//! \file SplineFEM.dox
//!
//! \date Apr 20 2009
//!
//! \author Knut Morten Okstad / SINTEF
//!
//! \brief File containing the Main Page of the spline FEM documentation.
//!
//==============================================================================
/*! \mainpage The prototype Spline FEM elasticity solver
\author Knut Morten Okstad, Sintef ICT, Trondheim
\section intro Introduction
SplineFEM is the prototype FE elasticity solver developed in the ICADA project.
The purpose of this code is to try out different implementations and the learn
about the isogeometric analysis technology itself.
The code can solve static elasticity problems for a varity of load conditions,
such as normal and component pressure loads and gravity load.
It can also solve for the natural eigenfrequencies and associated mode shapes,
as well as performing linearized buckling analysis.
The program writes the results to a standard VTF-file, by first converting the
geometry into a mesh of standard HEX8 elements, and then mapping the results
onto that mesh.
\section overview Overview of the source code documentation
The top-level driver is organized in the class LinearEl. This class has methods
for reading model data from an input file, to assemble the algebraic system of
equations resulting from the finite element discretization, and to solve that
system. It also contains a method for writing a VTF-file with results.
These methods are invoked from the main program, which is found in main_LinEl.C.
The core of the finite element implementation is contained in the class
VolumePatch, which has methods for evaluating the element matrices involved and
assembling them into the system matrices. There is typically one VolumePatch
object for each spline patch in the model.
The actual NURBS evaluation is performed through the GoTools library, which is
not part of the current package. In addition, this code depends on the ARPACK,
LAPACK and BLAS libraries, the VTFAPI library, and portions of the SAM library
(ASM and optionally SPR). Optionally, the SAMG algebraic multi-grid solver and
the SuperLU direct solver (public domain http://crd.lbl.gov/~xiaoye/SuperLU)
may be included.
*/

View File

@ -1,4 +1,4 @@
// $Id: Functions.h,v 1.7 2011-02-08 12:55:33 rho Exp $
// $Id$
//==============================================================================
//!
//! \file Functions.h
@ -28,7 +28,7 @@ class LinearFunc : public ScalarFunc
public:
//! \brief Constructor initializing the function parameter.
LinearFunc(real s = real(1)) { scale = s; }
LinearFunc(real s = real(1)) : scale(s) {}
protected:
//! \brief Evaluates the scalar function.
@ -49,7 +49,7 @@ class SineFunc : public ScalarFunc
public:
//! \brief Constructor initializing the function parameters.
SineFunc(real s = real(1), real f = real(1), real p = real(0))
{ scale = s; freq = f; phase = p; }
: scale(s), freq(f), phase(p) {}
protected:
//! \brief Evaluates the scalar function.
@ -67,7 +67,7 @@ class ConstFunc : public RealFunc
public:
//! \brief Constructor initializing the function value.
ConstFunc(real v) { fval = v; }
ConstFunc(real v) : fval(v) {}
protected:
//! \brief Evaluates the constant function.
@ -125,11 +125,11 @@ protected:
class LinearTinitFunc : public RealFunc
{
real value; //!< Max function value
real Tinit; //!< Function is linear from 0 to t = Tinit
real Tinit; //!< Function is linear from t = 0 to t = Tinit
public:
//! \brief Constructor initializing the function parameters.
LinearTinitFunc(real value_, real Tinit_) { value = value_; Tinit = Tinit_; }
LinearTinitFunc(real value_, real Tinit_) : value(value_), Tinit(Tinit_) {}
protected:
//! \brief Evaluates the linear function.
@ -148,7 +148,7 @@ class LinearXFunc : public RealFunc
public:
//! \brief Constructor initializing the function parameters.
LinearXFunc(real A, real B = real(0)) { a = A; b = B; }
LinearXFunc(real A, real B = real(0)) : a(A), b(B) {}
protected:
//! \brief Evaluates the linear function.
@ -167,7 +167,7 @@ class LinearYFunc : public RealFunc
public:
//! \brief Constructor initializing the function parameters.
LinearYFunc(real A, real B = real(0)) { a = A; b = B; }
LinearYFunc(real A, real B = real(0)) : a(A), b(B) {}
protected:
//! \brief Evaluates the linear function.
@ -186,7 +186,7 @@ class LinearZFunc : public RealFunc
public:
//! \brief Constructor initializing the function parameters.
LinearZFunc(real A, real B = real(0)) { a = A; b = B; }
LinearZFunc(real A, real B = real(0)) : a(A), b(B) {}
protected:
//! \brief Evaluates the linear function.
@ -200,14 +200,15 @@ protected:
class QuadraticXFunc : public RealFunc
{
real max; // Max value of function
real a, b; // Roots where function is \a 0
real max; //!< Max value of function
real a; //!< First root where function is zero
real b; //!< Second root where function is zero
public:
public:
//! \brief Constructor initializing the function parameters.
QuadraticXFunc(real MAX, real A, real B) { max = MAX; a = A; b = B; }
QuadraticXFunc(real MAX, real A, real B) : max(MAX), a(A), b(B) {}
protected:
protected:
//! \brief Evaluates the quadratic function.
virtual real evaluate(const Vec3& X) const;
};
@ -219,14 +220,15 @@ class QuadraticXFunc : public RealFunc
class QuadraticYFunc : public RealFunc
{
real max; // Max value of function
real a, b; // Roots where function is \a 0
real max; //!< Max value of function
real a; //!< First root where function is zero
real b; //!< Second root where function is zero
public:
public:
//! \brief Constructor initializing the function parameters.
QuadraticYFunc(real MAX, real A, real B) { max = MAX; a = A; b = B; }
QuadraticYFunc(real MAX, real A, real B) : max(MAX), a(A), b(B) {}
protected:
protected:
//! \brief Evaluates the quadratic function.
virtual real evaluate(const Vec3& X) const;
};
@ -238,14 +240,15 @@ class QuadraticYFunc : public RealFunc
class QuadraticZFunc : public RealFunc
{
real max; // Max value of function
real a, b; // Roots where function is \a 0
real max; //!< Max value of function
real a; //!< First root where function is zero
real b; //!< Second root where function is zero
public:
public:
//! \brief Constructor initializing the function parameters.
QuadraticZFunc(real MAX, real A, real B) { max = MAX; a = A; b = B; }
QuadraticZFunc(real MAX, real A, real B) : max(MAX), a(A), b(B) {}
protected:
protected:
//! \brief Evaluates the quadratic function.
virtual real evaluate(const Vec3& X) const;
};
@ -273,7 +276,7 @@ class LinearRotZFunc : public RealFunc
public:
//! \brief Constructor initializing the function parameters.
LinearRotZFunc(bool retX, real a, real x_0 = real(0), real y_0 = real(0))
{ rX = retX; A = a; x0 = x_0; y0 = y_0; }
: rX(retX), A(a), x0(x_0), y0(y_0) {}
protected:
//! \brief Evaluates the rotation function.
@ -294,7 +297,7 @@ class StepXFunc : public RealFunc
public:
//! \brief Constructor initializing the function parameters.
StepXFunc(real v, real X0 = real(0), real X1 = real(1))
{ fv = v; x0 = X0; x1 = X1; }
: fv(v), x0(X0), x1(X1) {}
protected:
//! \brief Evaluates the linear function.
@ -319,7 +322,7 @@ public:
StepXYFunc(real v,
real X1 = real(1), real Y1 = real(1),
real X0 = real(-1), real Y0 = real(-1))
{ fv = v; x0 = X0; y0 = Y0; x1 = X1; y1 = Y1; }
: fv(v), x0(X0), y0(Y0), x1(X1), y1(Y1) {}
protected:
//! \brief Evaluates the linear function.

View File

@ -1,4 +1,4 @@
// $Id: MPC.h,v 1.4 2010-10-14 19:10:56 kmo Exp $
// $Id$
//==============================================================================
//!
//! \file MPC.h
@ -59,23 +59,14 @@ public:
*/
struct DOF
{
//! \brief Default constructor with no arguments.
DOF()
{
node = dof = 0;
coeff = real(0);
};
//! \brief Default constructor.
DOF() : node(0), dof(0), coeff(real(0)) {}
//! \brief Convenience constructor creating a valid DOF object.
//! \param[in] n Node number (1...NNOD)
//! \param[in] d The local DOF number (1...3)
//! \param[in] c Associated coefficient or constrained value
DOF(int n, int d, real c = real(0))
{
node = n;
dof = d;
coeff = c;
};
DOF(int n, int d, real c = real(0)) : node(n), dof(d), coeff(c) {}
//! \brief Global stream operator printing a DOF instance.
friend std::ostream& operator<<(std::ostream& s, const DOF& dof)
@ -94,7 +85,7 @@ public:
//! \param[in] d The local DOF number of the slave DOF (1...3)
//! \param[in] c The actual value that this slave DOF is constrained to
//! when there are no master DOFs, or all master DOFs are zero
MPC(int n, int d, real c = real(0)) { iceq = -1; slave = DOF(n,d,c); }
MPC(int n, int d, real c = real(0)) : slave(n,d,c) { iceq = -1; }
//! \brief Adds a master DOF to the constraint equation.
//! \param[in] n The node number of the master DOF (1...NNOD)