Skip to content
Snippets Groups Projects
Commit a12f5827 authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

Solver lib gets nice. Added Taucs in cmake build system.

parent a53ad77f
Branches
Tags
No related merge requests found
......@@ -74,6 +74,7 @@ set(GMSH_API
Mesh/meshGFaceDelaunayInsertion.h
Post/PView.h Post/PViewData.h Plugin/PluginManager.h
Graphics/drawContext.h
Solver/dofManager.h Solver/elasticityTerm.h Solver/termOfFormulation.h
contrib/kbipack/gmp_normal_form.h contrib/kbipack/gmp_matrix.h
contrib/kbipack/gmp_blas.h
contrib/DiscreteIntegration/DILevelset.h)
......@@ -476,19 +477,21 @@ if(ENABLE_MED OR ENABLE_CGNS)
endif(ENABLE_MED OR ENABLE_CGNS)
if(ENABLE_TAUCS)
find_library(TAUCS_LIB taucs)
find_library(TAUCS_LIB taucs PATHS ENV CASROOT
PATH_SUFFIXES lib)
if(TAUCS_LIB)
find_path(TAUCS_INC "taucs.h" PATHS ENV CASROOT PATH_SUFFIXES src
include)
if(TAUCS_INC)
set(HAVE_TAUCS TRUE)
list(APPEND CONFIG_OPTIONS "Taucs")
list(APPEND EXTERNAL_LIBRARIES ${TAUCS_LIB})
list(APPEND EXTERNAL_INCLUDES ${TAUCS_INC})
endif(TAUCS_INC)
endif(TAUCS_LIB)
endif(ENABLE_TAUCS)
if(ENABLE_SOLVER)
add_subdirectory(Solver)
set(HAVE_SOLVER TRUE)
list(APPEND CONFIG_OPTIONS "Solver")
endif(ENABLE_SOLVER)
if(ENABLE_OCC)
if(WIN32)
......@@ -621,7 +624,7 @@ if(EXTERNAL_INCLUDES)
endif(EXTERNAL_INCLUDES)
# we could specify include dirs more selectively, but this is simpler
include_directories(Common Fltk Geo Graphics Mesh Numeric Parser Plugin
include_directories(Common Fltk Geo Graphics Mesh Solver Numeric Parser Plugin
Post Qt contrib/ANN/include contrib/Chaco/main contrib/DiscreteIntegration
contrib/MathEx contrib/Metis contrib/NativeFileChooser contrib/Netgen
contrib/Netgen/libsrc/include contrib/Netgen/libsrc/interface
......
This diff is collapsed.
......@@ -10,13 +10,13 @@
#include <vector>
#include "SVector3.h"
#include "GmshMatrix.h"
#include "dofManager.h"
#include "elasticityTerm.h"
class MVertex;
class MElement;
class GFace;
class GRegion;
template<class T> class gmshAssembler;
class gmshElasticityTerm;
class gmshHighOrderSmoother
{
......@@ -38,9 +38,9 @@ public:
}
void smooth ( std::vector<MElement*> & );
double smooth_metric_ ( std::vector<MElement*> &, GFace *gf,
gmshAssembler<double> &myAssembler,
gsolver::dofManager<double,double> &myAssembler,
std::set<MVertex*> &verticesToMove,
gmshElasticityTerm &El);
gsolver::elasticityTerm &El);
void smooth_metric ( std::vector<MElement*> &, GFace *gf );
void smooth ( GFace* , bool metric = false);
void smooth_p2point ( GFace* );
......
......@@ -334,32 +334,3 @@ int gmshLinearSystemCSRGmm<double>::checkSystem()
}
#endif
#if defined(HAVE_TAUCS)
#include "taucs.h"
template<>
int gmshLinearSystemCSRTaucs<double>::systemSolve()
{
if(!sorted)
sortColumns(_b->size(),
CSRList_Nbr(a_),
(INDEX_TYPE *) ptr_->array,
(INDEX_TYPE *) jptr_->array,
(INDEX_TYPE *) ai_->array,
(double*) a_->array);
sorted = true;
taucs_ccs_matrix myVeryCuteTaucsMatrix;
myVeryCuteTaucsMatrix.n = myVeryCuteTaucsMatrix.m = _b->size();
myVeryCuteTaucsMatrix.rowind = (INDEX_TYPE*)jptr_->array;
myVeryCuteTaucsMatrix.colptr = (INDEX_TYPE*)ai_->array;
myVeryCuteTaucsMatrix.values.d = (double*) a_->array;
char* options[] = { "taucs.factor.LLT=true", NULL };
int result = taucs_linsolve(&myVeryCuteTaucsMatrix,
NULL, 1, &(*_x)[0],&(*_b)[0],
options,NULL);
if (result != TAUCS_SUCCESS){
Msg::Error("Taucs Was Not Successfull");
}
return 1;
}
#endif
......@@ -159,23 +159,4 @@ class gmshLinearSystemCSRGmm : public gmshLinearSystemCSR<scalar> {
};
template <class scalar>
class gmshLinearSystemCSRTaucs : public gmshLinearSystemCSR<scalar> {
private:
public:
gmshLinearSystemCSRTaucs()
{}
virtual ~gmshLinearSystemCSRTaucs()
{}
virtual int systemSolve()
#if defined(HAVE_TAUCS)
;
#else
{
Msg::Error("Taucs is not available in this version of Gmsh");
return 0;
}
#endif
};
#endif
......@@ -73,7 +73,7 @@ namespace gsolver {
private:
public:
dofManager(linearSystem<dataMat> *l) : _current(l){
_linearSystems["default"]= l;
_linearSystems["A"]= l;
}
inline void fixDof(long int ent, int type, const dataVec & value)
{
......
......@@ -13,6 +13,7 @@
#define SWAP(a,b) temp=(a);(a)=(b);(b)=temp;
#define SWAPI(a,b) tempi=(a);(a)=(b);(b)=tempi;
namespace gsolver {
void *CSRMalloc(size_t size)
{
void *ptr;
......@@ -74,7 +75,7 @@ namespace gsolver {
}
}
void CSRList_Add(CSRList_T *liste, void *data)
void CSRList_Add(gsolver::CSRList_T *liste, void *data)
{
liste->n++;
......
......@@ -24,7 +24,7 @@ namespace gsolver {
scalar *a);
template<>
int linearSystemCSRTaucs_<double>::systemSolve()
int linearSystemCSRTaucs<double>::systemSolve()
{
if(!sorted){
sortColumns(_b->size(),
......@@ -46,6 +46,7 @@ namespace gsolver {
myVeryCuteTaucsMatrix.flags = TAUCS_SYMMETRIC | TAUCS_LOWER | TAUCS_DOUBLE;
char* options[] = { "taucs.factor.LLT=true", NULL };
Msg::Info("TAUCS solves %d unknowns", _b->size());
int result = taucs_linsolve(&myVeryCuteTaucsMatrix,
NULL,
1,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment