FEBio  1.5.0
Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Protected Member Functions | Protected Attributes
FEM Class Reference

The Finite Element Model class. More...

#include <fem.h>

Inheritance diagram for FEM:
FEModel

Public Member Functions

 FEM ()
 constructor - sets default variables
virtual ~FEM ()
 destructor
bool Configure (const char *szfile)
 read the configuration file
bool Restart (const char *szfile)
 Restart from restart point.
bool Init ()
 Initializes data structures.
bool Reset ()
 Resets data structures.
bool Solve ()
 Solves the problem.
bool Serialize (DumpFile &ar)
 Serialize the current state to/from restart file.
bool Input (const char *szfile)
 input data from file
void SetDebugFlag (bool b)
 set the debug level
bool GetDebugFlag ()
 get the debug level
void SetInputFilename (const char *szfile)
 Sets the name of the FEBio input file.
void SetLogFilename (const char *szfile)
void SetPlotFilename (const char *szfile)
void SetDumpFilename (const char *szfile)
void SetPlotFileNameExtension (const char *szext)
const char * GetInputFileName ()
const char * GetLogfileName ()
const char * GetPlotFileName ()
const char * GetDumpFileName ()
void SetTitle (const char *sz)
 set the problem title
const char * GetTitle ()
 get the problem title
const char * GetFileTitle ()
 get the file title
double * FindParameter (const char *szname)
 return a pointer to the named variable
double * ReturnParameter (FEParam *pp, const int index)
 return a pointer to the parameter variable
double * FindSolidMixtureParameter (const char *szvar, const int index, FEElasticMixture *pme)
 return a pointer to the named variable in a solid mixture
double * FindUncoupledSolidMixtureParameter (const char *szvar, const int index, FEUncoupledElasticMixture *pme)
 Return a pointer to the named variable in a uncoupled solid mixture.
int ContactInterfaces ()
 return number of contact interfaces
FEBoundaryConditionFindBC (int nid)
 find a boundary condition from the ID
void SetSymmetryFlag (bool bsymm)
 Set the sparse matrix symmetry flag.
void EvaluateParameterList (FEParameterList &pl)
 Evaluate parameter list.
void EvaluateMaterialParameters (FEMaterial *pm)
 FEM (const FEM &fem)
 copy constructor
void operator= (const FEM &fem)
 assignment operator
bool InitRigidBodies ()
 Initialize rigid bodies.
bool InitPoroSolute ()
 Initialize poroelastic/biphasic and solute data.
bool InitContact ()
 Initializes contact data.
bool InitConstraints ()
 Iniatialize linear constraint data.
bool InitMaterials ()
 Initialize material data.
bool InitMesh ()
 Initialize mesh data.
void AddCallback (FEBIO_CB_FNC pcb, void *pd)
 set callback function
void DoCallback ()
 call the callback function

Static Public Member Functions

static void SetGlobalConstant (const string &s, double v)
static double GetGlobalConstant (const string &s)
static void SetSD (FESoluteData *psd)
static FESoluteDataFindSD (int nid)

Data Fields

vector< FEAnalysis * > m_Step
 array of analysis steps
int m_nStep
 current analysis step
FEAnalysism_pStep
 pointer to current analysis step
double m_ftime
 current time value
double m_ftime0
 start time of current step
bool m_bsym_poro
 symmetric (old) poro-elastic flag
int m_nplane_strain
 run analysis in plain strain mode
Timer m_TotalTime
int m_nrm
 nr of rigid materials
vector< FERigidBody * > m_RB
 rigid body array
vector< FERigidJoint * > m_RJ
 rigid joint array
vector< FEContactInterface * > m_CI
 contact interface array
vector< FESurfaceLoad * > m_SL
 surface loads
vector< FERigidBodyDisplacement * > m_RDC
 rigid body displacements
vector< FERigidBodyForce * > m_RFC
 rigid body forces
list< FELinearConstraintm_LinC
 linear constraints data
vector< int > m_LCT
 linear constraint table
vector< FELinearConstraint * > m_LCA
 linear constraint array (temporary solution!)
list< FELinearConstraintSet * > m_LCSet
 aug lag linear constraint data
vector< FEPointConstraintm_PC
 point constraint data
int m_nsolver
 type of solver selected
int m_bwopt
 bandwidth optimization flag
bool m_bsymm
 symmetric flag
PlotFilem_plot
 the plot file
DataStore m_Data
 the data store used for data logging
bool m_bInterruptable
 true if this model can be interrupted with ctrl+c

Static Public Attributes

static map< string, double > m_Const
 Set globals section parameters and functions.
static vector< FESoluteData * > m_SD
 unique identifier of solutes in multiphasic materials

Protected Member Functions

void ShallowCopy (FEM &fem)
void SerializeMaterials (DumpFile &ar)
void SerializeAnalysisData (DumpFile &ar)
void SerializeGeometry (DumpFile &ar)
void SerializeMesh (DumpFile &ar)
void SerializeContactData (DumpFile &ar)
void SerializeBoundaryData (DumpFile &ar)
void SerializeIOData (DumpFile &ar)
 Serialization of FEM data.
void SerializeLoadData (DumpFile &ar)
void SerializeConstants (DumpFile &ar)

Protected Attributes

char * m_szfile_title
 master input file title
char m_szfile [MAX_STRING]
 master input file name (= path + title)
char m_szplot [MAX_STRING]
 plot output file name
char m_szlog [MAX_STRING]
 log output file name
char m_szdump [MAX_STRING]
 dump file name
char m_sztitle [MAX_STRING]
 problem title
bool m_debug
 debug flag
list< FEBIO_CALLBACKm_pcb
 pointer to callback function

Detailed Description

The Finite Element Model class.

This class stores solver parameters, geometry data, material data, and other data that is needed to solve the FE problem. FEBio is designed to solve finite element problems. All the finite element data is collected here in this class. This class also provides routines to initalize, input, output and update the FE data. Although this class provides the main solve routine it does not really solve anything. The actual solving is done by one of the classes derived from the FESolver class.


Constructor & Destructor Documentation

FEM::FEM ( )

constructor - sets default variables

Constructor of the FEM class Initializes default variables

FEM::~FEM ( ) [virtual]

destructor

destructor of FEM class. Delete all dynamically allocated data

FEM::FEM ( const FEM fem)

copy constructor

copy constructor for FEM class. The copy constructor and assignment operator are only used for push/pop'ing to a stack. This is used by the running restart feature. Note that not all data is copied. We only copy the data that changes during iterations. for push/pop'ing


Member Function Documentation

bool FEM::Configure ( const char *  szfile)

read the configuration file

Reads the FEBio configuration file. This file contains some default settings.

void FEM::EvaluateMaterialParameters ( FEMaterial pm)

This function evaluates material parameter lists. Since some of the materials can have other materials as sub-componenents, we need to set up a recursive call to evaluate the parameter lists of the sub-materials.

double * FEM::FindParameter ( const char *  szparam)

return a pointer to the named variable

Return a pointer to the named variable.

This function returns a pointer to a named variable. Currently, we support names of the form: material_name.parameter_name material_name.elastic.parameter_name (nested material) material_name.solid_name.parameter_name (solid mixture) material_name.solid.parameter_name (biphasic material) material_name.permeability.parameter_name (biphasic material) material_name.solid.solid_name.parameter_name (biphasic material with solid mixture) The 'material_name' is a user defined name for a material. The 'parameter_name' is the predefined name of the variable. The keywords 'elastic', 'solid', and 'permeability' must appear as shown.

Todo:
perhaps I should use XPath to refer to material parameters ?
double * FEM::FindSolidMixtureParameter ( const char *  szvar,
const int  index,
FEElasticMixture pme 
)

return a pointer to the named variable in a solid mixture

Return a pointer to the named variable in a solid mixture.

bool FEM::Init ( ) [virtual]

Initializes data structures.

This function performs one-time-initialization stuff. All the different modules are initialized here as well. This routine also performs some data checks

Implements FEModel.

bool FEM::InitConstraints ( )

Iniatialize linear constraint data.

This function initializes the linear constraint table (LCT). This table contains for each dof the linear constraint it belongs to. (or -1 if it is not constraint)

bool FEM::InitMesh ( )

Initialize mesh data.

Update the mesh data. This function calculates the initial directors for the shell elements.

bool FEM::InitPoroSolute ( )

Initialize poroelastic/biphasic and solute data.

Initialize solute-poroelastic data.

bool FEM::Input ( const char *  szfile) [virtual]

input data from file

This routine reads in an input file and performs some initialization stuff. The rest of the initialization is done in Init

Implements FEModel.

void FEM::operator= ( const FEM fem)

assignment operator

assignment operator for FEM class. The copy constructor and assignment operator are only used for push/pop'ing to a stack. This is used by the running restart feature. Note that not all data is copied. We only copy the data that changes during iterations. for push/pop'ing

bool FEM::Reset ( )

Resets data structures.

This function resets the FEM data so that a new run can be done. This routine is called from the optimization routine.

bool FEM::Restart ( const char *  szfile)

Restart from restart point.

This routine reads a binary archive that stores a restart point and prepares the FEM data to be restarted from this point

Parameters:
[in]szfilename of the file
double * FEM::ReturnParameter ( FEParam pp,
const int  index 
)

return a pointer to the parameter variable

Return a pointer to the parameter variable.

bool FEM::Serialize ( DumpFile ar)

Serialize the current state to/from restart file.

Reads or writes the current state to/from a binary file This is used to restart the solution from a saved position or to create a restart point. A version number is written to file to make sure the same format is used for reading and writing.

Parameters:
[in]arthe archive to which the data is serialized
See also:
DumpFile
void FEM::SerializeMesh ( DumpFile ar) [protected]

This function is used by the restart feature and reads or writes the mesh data to or from the binary archive

Parameters:
[in]arthe archive to which the data is serialized
See also:
FEM::Serialize()
DumpFile
Todo:
serialize nodesets
bool FEM::Solve ( ) [virtual]

Solves the problem.

This is the main solve method. This function loops over all analysis steps and solves each one in turn.

See also:
FEAnalysis

Implements FEModel.


The documentation for this class was generated from the following files: