aFemCode Classes
-
template<typename T>
class FemCase FemCase is the base class for a run. It reads inputs, meshes, prepares the run, assembles matrices and performs the resolution.
A main.cpp can for instance look like:
FemCase<complex<double>> fc(setupFile.c_str()); if (fc.isLoaded()) { fc.displayInfo(); fc.prepareComputation(); fc.buildKM(); fc.buildF(); fc.performResolution(); }
performResolution() solves \begin{equation} (\Delta+k^2)p=f \end{equation}
the template <T> allows to use double and complex<double> equally
Subclassed by AcousticFemCase< T >, AcousticRotatingFemCase< T >
Public Functions
-
FemCase()
-
FemCase(std::string setupFile)
-
~FemCase()
-
int addAtribute(int cursor, std::string entry, std::string value)
-
bool setInfo(std::string value)
-
std::string getInfo() const
-
bool writeInfo(std::string info) const
-
bool setError(std::string value)
-
std::string getError() const
-
bool writeError(std::string error) const
-
bool setMeshFile(std::string meshFile, int iCoupling)
-
std::string getMeshFile(int iCoupling)
-
bool displayInfo()
-
bool isLoaded() const
Returns truc if all usefull info are loaded correctly.
-
bool prepareComputation()
Prepares the computation this method loops over the couplings, creates the meshes, and computes basic stuff (volumes, jacobians, etc)
-
bool buildKM()
Assembles the mass and stiffness matrices for 1D 2D and 3D elements.
// au programme : loop over the couplings A CODER loop over the elements to know which matrices must be initialized (et quand on bossera en sparse, pour faire un assemblage fictif et determiner la taille des matrices) loop over the elements check element type compute elementary matrices K and M
assemble in main matrices check if everything is alright (volume compared to theory)
-
bool buildF()
-
bool performCoupling()
-
virtual bool performResolution()
Prepares the computation this method loops over the couplings, creates the meshes, and computes basic stuff (volumes, jacobians, etc)
-
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> *getGauss(int element, int order)
return gauss points and weights for a specified element type
-
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> *getN(int element, Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> gp)
returns the shape function matrices for a given element type
-
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> *getB(int element, Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> gp)
returns the gradient matrices for a given element type
-
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> computeFemB(Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> Jac, Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> Bref) const
returns the shape function matrices for a specific element, given the jacobian matrix and the gradient matrix
-
bool exportResults()
-
bool writeMicValuesHeader()
-
bool writeMicFrequencies()
-
bool writeVtkData(string filename, string dataName, Eigen::SparseMatrix<T> data, bool firstTime, Mesh *m) const
-
bool addToVtkFile(ostream &out, Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic> const &mat) const
-
bool addToVtkFile(ostream &out, Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> const &mat) const
-
vector<int> swapLines(vector<int> v, vector<int> perm) const
swaps the lines of a vector reorganizes the lines of the vector according to perm.
-
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> swapLines(Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> m, vector<int> perm) const
-
void removeDoublons(std::vector<size_t>)
-
FemCase()
-
template<typename T>
class fLinSys
-
class Mesh
Public Functions
-
Mesh()
-
Mesh(std::string info, std::string error)
-
~Mesh()
-
bool unvImport(std::string unvFileToRead)
-
int import2411(std::string unvFileToRead, int position)
-
int import2412(std::string unvFileToRead, int position)
-
int import2467(std::string unvFileToRead, int position)
-
bool addNode(int index, float x, float y, float z)
-
bool addElement(int index, std::vector<Node*> nodes, int feDescriptor, int physicalProperty, int materialProperty, int color, int numberOfNodes)
-
bool printConnectivities() const
-
bool printCoordinates() const
-
Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic> getConnectivities() const
-
Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic> getConecAndNN() const
-
Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> getCoordinates() const
-
Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic> getElemTypesVtk() const
-
int typeAssign(int nbOfNodes)
-
bool isBeginEnd(std::string line)
-
bool calculateVolume()
-
int getElementNumber() const
-
size_t getNodesNumber() const
-
bool setInfo(std::string value)
-
std::string getInfo() const
-
bool writeInfo(std::string info) const
-
bool setError(std::string value)
-
std::string getError() const
-
bool writeError(std::string error) const
-
bool computeAspectRatio()
-
bool computeJacobians()
-
bool contains1D() const
-
bool contains2D() const
-
bool contains3D() const
-
bool displayInfo() const
-
std::vector<std::string> getGroupNames()
-
std::vector<std::vector<size_t>> getGroups()
-
std::vector<size_t> getGroup(size_t iG)
-
bool renumberMesh(std::vector<size_t>)
-
Mesh()
-
class Element
Public Functions
-
Element()
-
Element(int index, std::vector<Node*> nodes, int feDescriptor, int physicalProperty, int materialProperty, int color, int numberOfNodes)
-
~Element()
-
bool is1D() const
-
bool is2D() const
-
bool is3D() const
-
bool calculateVolume()
-
bool checkElem() const
-
bool getDisplay() const
-
int getIndex() const
-
bool setIndex(int newIndex)
-
int getFeDescriptor() const
-
int getPhysicalProperty() const
-
int getMaterialProperty() const
-
int getColor() const
-
bool computeAspectRatio()
-
int getAspectRatio() const
-
float getVolume() const
-
int getnN() const
-
std::vector<int> getNodesIds() const
-
Eigen::Matrix<float, Eigen::Dynamic, 3> getCoordinates() const
-
Element()
-
class Node
-
class Setup
Subclassed by AcousticRotatingSetup, AcousticSetup
Public Functions
-
Setup()
-
virtual ~Setup()
-
bool set3D(bool dim)
-
bool setInfo(std::string value)
-
std::string getInfo() const
-
bool writeInfo(std::string info) const
-
bool setError(std::string value)
-
std::string getError() const
-
bool writeError(std::string error) const
-
bool readFrequencies(std::string fileToRead, int end)
-
bool readMicros(std::string fileToRead, int end)
-
bool readLoads(std::string fileToRead)
-
bool readRotatingParams(std::string fileToRead)
-
virtual int addAtribute(int cursor, std::string entry, std::string value) = 0
-
bool displayFrequencies()
-
std::vector<double> getFrequencies()
-
std::vector<int> getMics()
-
double getC()
-
virtual bool displayInfo() = 0
-
bool isLoaded()
-
size_t getAxis()
-
size_t getEta()
-
size_t getFsbcC()
-
size_t getN()
-
size_t getL()
-
float getRadius()
-
float getOmega()
-
bool getRotating()
-
std::string getInterfaceName()
-
size_t getInterfaceGroup()
-
bool setInterfaceGroup(size_t iG)
Protected Attributes
-
std::string m_setupFile
-
std::string m_path
-
bool m_loaded
-
std::string m_info
-
std::string m_error
-
std::vector<double> m_frequencies
-
std::vector<int> m_microsIndex
-
std::vector<int> m_loadsListTemp
-
bool m_3D
-
bool m_nodal
-
bool timeOverMemory
-
double m_rho
-
double m_c
-
size_t m_couplingType
-
size_t m_axis
-
size_t m_eta
-
size_t m_C
-
size_t m_N
-
size_t m_L
-
float m_radius
-
float m_Omega
-
bool m_rotating
-
std::string m_interfaceName
-
size_t m_interfaceGroup
-
Setup()
notes
Rien pour l’instant