IFEM  90A354
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
AnaSol Class Reference

Class for analytical solution fields (primary and secondary solution). More...

#include <AnaSol.h>

Collaboration diagram for AnaSol:
Collaboration graph
[legend]

Public Member Functions

 AnaSol (RealFunc *s1=nullptr, VecFunc *s2=nullptr, VecFunc *v1=nullptr, TensorFunc *v2=nullptr, STensorFunc *v3=nullptr)
 Default constructor initializing all solution fields. More...
 
 AnaSol (RealFunc *s, STensorFunc *sigma)
 Constructor initializing the primary and secondary solution fields. More...
 
 AnaSol (VecFunc *v, STensorFunc *sigma)
 Constructor initializing the primary and secondary solution fields. More...
 
 AnaSol (STensorFunc *sigma)
 Constructor initializing the symmetric stress tensor field only. More...
 
 AnaSol (std::istream &is, const int nlines, bool scalarSol=true)
 Constructor initializing expression functions by parsing a stream. More...
 
 AnaSol (const tinyxml2::XMLElement *elem, bool scalarSol=true)
 Constructor initializing expression functions by parsing XML tags. More...
 
 AnaSol (const AnaSol &)=delete
 No copying of this class.
 
virtual ~AnaSol ()
 The destructor frees the analytical solution fields.
 
char hasScalarSol () const
 Checks whether a scalar solution is defined.
 
char hasVectorSol () const
 Checks whether a vector solution is defined.
 
RealFuncgetScalarSol (size_t idx=0) const
 Returns the scalar solution, if any.
 
VecFuncgetScalarSecSol (size_t idx=0) const
 Returns the secondary scalar solution, if any.
 
VecFuncgetVectorSol () const
 Returns the vector solution, if any.
 
TensorFuncgetVectorSecSol () const
 Returns the secondary vector solution, if any.
 
STensorFuncgetStressSol () const
 Returns the stress solution, if any.
 
void initPatch (size_t pIdx)
 Sets the patch to use.
 
virtual void setupSecondarySolutions ()
 Make sure we have a secondary solution. More...
 

Protected Attributes

bool symmetric = false
 True to use symmetric secondary solution.
 
std::vector< RealFunc * > scalSol
 Primary scalar solution fields.
 
std::vector< VecFunc * > scalSecSol
 Secondary scalar solution fields.
 
VecFuncvecSol
 Primary vector solution field.
 
TensorFuncvecSecSol
 Secondary solution field (vector gradient field)
 
STensorFuncstressSol
 Secondary solution field (stress field)
 

Private Member Functions

template<class Scalar >
void parseExpressionFunctions (const tinyxml2::XMLElement *elem, bool scalarSol)
 Parses expression functions from XML definition.
 
void parseFieldFunctions (const tinyxml2::XMLElement *elem, bool scalarSol)
 Parses field functions from XML definition.
 

Detailed Description

Class for analytical solution fields (primary and secondary solution).

Constructor & Destructor Documentation

◆ AnaSol() [1/6]

AnaSol::AnaSol ( RealFunc s1 = nullptr,
VecFunc s2 = nullptr,
VecFunc v1 = nullptr,
TensorFunc v2 = nullptr,
STensorFunc v3 = nullptr 
)
explicit

Default constructor initializing all solution fields.

Parameters
[in]s1Primary scalar solution field
[in]s2Secondary solution field, gradient
[in]v1Primary vector solution field
[in]v2Secondary solution field, gradient
[in]v3Secondary solution field, symmetric stress tensor

It is assumed that all the arguments are pointers to dynamically allocated objects, as the class destructor will attempt to delete them.

References scalSecSol, and scalSol.

◆ AnaSol() [2/6]

AnaSol::AnaSol ( RealFunc s,
STensorFunc sigma 
)

Constructor initializing the primary and secondary solution fields.

Parameters
[in]sPrimary scalar solution field
[in]sigmaSymmetric stress tensor field

References scalSol.

◆ AnaSol() [3/6]

AnaSol::AnaSol ( VecFunc v,
STensorFunc sigma 
)
inline

Constructor initializing the primary and secondary solution fields.

Parameters
[in]vPrimary vector solution field
[in]sigmaSymmetric stress tensor field

◆ AnaSol() [4/6]

AnaSol::AnaSol ( STensorFunc sigma)
inlineexplicit

Constructor initializing the symmetric stress tensor field only.

Parameters
[in]sigmaSymmetric stress tensor field

◆ AnaSol() [5/6]

AnaSol::AnaSol ( std::istream &  is,
const int  nlines,
bool  scalarSol = true 
)

Constructor initializing expression functions by parsing a stream.

Parameters
isThe file stream to read function definition from
[in]nlinesNumber of lines to read
[in]scalarSolIf true, the primary solution is a scalar field

References IFEM::cout, utl::readLine(), scalSecSol, scalSol, stressSol, vecSecSol, and vecSol.

◆ AnaSol() [6/6]

AnaSol::AnaSol ( const tinyxml2::XMLElement *  elem,
bool  scalarSol = true 
)
explicit

Constructor initializing expression functions by parsing XML tags.

Parameters
[in]elemPointer to XML-element to extract data from
[in]scalarSolIf true, the primary solution is a scalar field

References utl::getAttribute(), parseFieldFunctions(), and symmetric.

Member Function Documentation

◆ setupSecondarySolutions()

void AnaSol::setupSecondarySolutions ( )
virtual

Make sure we have a secondary solution.

If none is given, we use derivation (automatic or finite difference) to obtain one.

References scalSecSol, scalSol, stressSol, symmetric, vecSecSol, and vecSol.

Referenced by SIMbase::preprocessC().


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