Commit a9b3abcc authored by Kirill Terekhov's avatar Kirill Terekhov

Start fix case-sensitive issue

parent 8b7ef6c0
project(ADFVDiscr)
set(SOURCE main.cpp)
add_executable(ADFVDiscr ${SOURCE})
target_link_libraries(ADFVDiscr inmost)
#target_include_directories(ADFVDiscr PRIVATE $<TARGET_PROPERTY:inmost,INTERFACE_INCLUDE_DIRECTORIES>)
if(USE_SOLVER)
if(USE_SOLVER_ANI)
message("linking ADFVDiscr with ani3d and BLAS")
target_link_libraries(ADFVDiscr ani3d ${BLAS_LIBRARIES})
if(BLAS_LINKER_FLAGS)
set_target_properties(ADFVDiscr PROPERTIES LINK_FLAGS "${BLAS_LINKER_FLAGS}")
endif()
endif()
if(USE_SOLVER_PETSC)
message("linking ADFVDiscr with PETSc")
target_link_libraries(ADFVDiscr ${PETSC_LIBRARIES})
endif()
if(USE_SOLVER_TRILINOS)
message("linking ADFVDiscr with Trilinos")
target_link_libraries(ADFVDiscr ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
endif()
if(USE_SOLVER_METIS)
message("linking ADFVDiscr with Metis")
target_link_libraries(ADFVDiscr ${METIS_LIBRARIES})
endif()
if(USE_SOLVER_MONDRIAAN)
message("linking ADFVDiscr with Mondriaan")
target_link_libraries(ADFVDiscr ${MONDRIAAN_LIBRARIES})
endif()
endif()
if(USE_PARTITIONER)
if(USE_PARTITIONER_ZOLTAN)
message("linking ADFVDiscr with Zoltan")
target_link_libraries(ADFVDiscr ${ZOLTAN_LIBRARIES})
endif()
if(USE_PARTITIONER_PARMETIS)
message("linking ADFVDiscr with ParMETIS")
target_link_libraries(ADFVDiscr ${PARMETIS_LIBRARIES})
endif()
endif()
if(USE_MPI)
message("linking ADFVDiscr with MPI")
target_link_libraries(ADFVDiscr ${MPI_LIBRARIES})
if(MPI_LINK_FLAGS)
set_target_properties(ADFVDiscr PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()
endif(USE_MPI)
install(TARGETS ADFVDiscr EXPORT inmost-targets RUNTIME DESTINATION bin)
This diff is collapsed.
project(ADMFD)
set(SOURCE main.cpp matrix.hpp)
add_executable(ADMFD ${SOURCE})
target_link_libraries(ADMFD inmost)
if(USE_SOLVER)
if(USE_SOLVER_ANI)
message("linking ADMFD with ani3d and BLAS")
target_link_libraries(ADMFD ani3d ${BLAS_LIBRARIES})
if(BLAS_LINKER_FLAGS)
set_target_properties(ADMFD PROPERTIES LINK_FLAGS "${BLAS_LINKER_FLAGS}")
endif()
endif()
if(USE_SOLVER_PETSC)
message("linking ADMFD with PETSc")
target_link_libraries(ADMFD ${PETSC_LIBRARIES})
endif()
if(USE_SOLVER_TRILINOS)
message("linking ADMFD with Trilinos")
target_link_libraries(ADMFD ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
endif()
if(USE_SOLVER_METIS)
message("linking ADMFD with Metis")
target_link_libraries(ADMFD ${METIS_LIBRARIES})
endif()
if(USE_SOLVER_MONDRIAAN)
message("linking ADMFD with Mondriaan")
target_link_libraries(ADMFD ${MONDRIAAN_LIBRARIES})
endif()
endif()
if(USE_PARTITIONER)
if(USE_PARTITIONER_ZOLTAN)
message("linking ADMFD with Zoltan")
target_link_libraries(ADMFD ${ZOLTAN_LIBRARIES})
endif()
if(USE_PARTITIONER_PARMETIS)
message("linking ADMFD with ParMETIS")
target_link_libraries(ADMFD ${PARMETIS_LIBRARIES})
endif()
endif()
if(USE_MPI)
message("linking ADMFD with MPI")
target_link_libraries(ADMFD ${MPI_LIBRARIES})
if(MPI_LINK_FLAGS)
set_target_properties(ADMFD PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()
endif(USE_MPI)
install(TARGETS ADMFD EXPORT inmost-targets RUNTIME DESTINATION bin)
This diff is collapsed.
This diff is collapsed.
#add_subdirectory(DrawGrid)
add_subdirectory(OldDrawGrid)
add_subdirectory(DrawMatrix)
add_subdirectory(MatSolve)
add_subdirectory(GridGen)
add_subdirectory(FVDiscr)
add_subdirectory(ADFVDiscr)
add_subdirectory(ADMFD)
#add_subdirectory(OctreeCutcell)
add_subdirectory(Solver)
project(DrawGrid)
set(SOURCE main.cpp
rotate.cpp
rotate.h
my_glut.h)
find_package(OpenGL)
find_package(GLUT)
if(OPENGL_FOUND)
if(GLUT_FOUND)
include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${GLUT_INCLUDE_DIR})
add_executable(DrawGrid ${SOURCE})
target_link_libraries(DrawGrid inmost ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
if(USE_MPI)
target_link_libraries(DrawGrid ${MPI_LIBRARIES})
if(MPI_LINK_FLAGS)
set_target_properties(DrawGrid PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()
endif(USE_MPI)
install(TARGETS DrawGrid EXPORT inmost-targets RUNTIME DESTINATION bin)
else(GLUT_FOUND)
message("GLUT not found")
endif(GLUT_FOUND)
else(OPENGL_FOUND)
message("OpenGL not found")
endif(OPENGL_FOUND)
CXX=mpicxx
CC=mpicxx
#links for cluster
#PETSC_DIR=/data4t/terekhov/Packages/petsc-3.3-p3
#PETSC_ARCH=arch-linux2-c-opt
#INCPATH = -I${PETSC_DIR}/${PETSC_ARCH}/include -I${PETSC_DIR}/include
MSPPLIB = ../../mspp.a
#MSPPLIB = ../../msppd.a
#OPTFLAGS= -O0 -g -Wall -Wno-unused-function
OPTFLAGS= -Ofast -flto -fwhole-program -march=native -DNDEBUG -ftree-vectorize
OPENGL=-L/usr/X11R6/lib -lX11 -lXi -lXmu -lGL -lglut -lGLU
#OPENGL=-framework GLUT -framework OpenGL
#OPENGL=-lglut -lgl -lglu32 -lopengl32
#OPENGL=-L/lib -lglu32 -lopengl32
MYLIBS= $(OPENGL)
CXXFLAGS=$(OPTFLAGS) $(INCPATH)
LDFLAGS=$(OPTFLAGS)
LDLIBS=$(MYLIBS) $(PETSC)
targets=main
all: $(targets)
main: main.o rotate.o $(MSPPLIB)
clean:
rm -f $(targets) *.o
This diff is collapsed.
#if defined (__APPLE__) || defined(MAXOSX)
#include <GLUT/glut.h>
#endif
#if defined(_WIN32)
//#include <GL/glut.h>
// В windows следует скачать тот самый glut по ссылке
// http://www.opengl.org/resources/libraries/glut/
// и положить в папку с компилирующимся файлом
// так же следует установить пару библиотек
#define NOMINMAX
#include <windows.h>
#include <GL/glut.h>
//#include "glut.h"
#pragma comment(lib,"glut32.lib")
#endif
#if defined(__linux__)
#include <GL/glut.h>
#endif
/*********************************
Implementation of quaternion-based
object rotation
Functions
clickmotion - call when holded mouse moved
click - call when user clicks
motion - call when mouse just moves
quatinit - flush rotation value
rotate - multiply GL matrix
Dependency: rotate.h,
Standard: math.h
Specific: glut.h
**********************************/
#include "my_glut.h"
#include "rotate.h"
#include "math.h"
struct quaternion
{
double x,y,z,w;
};
struct vector
{
double x,y,z;
};
// Rotation
struct quaternion q;
struct vector drag, onclick;
double mx,my;
extern int width, height;
extern int interactive;
//
void clickmotion(int nmx, int nmy) // Mouse
{
struct vector n;
double norm,length,t;
mx = 2.*(nmx/(double)width - 0.5);
my = 2.*(0.5 - nmy/(double)height);
norm = mx*mx + my*my;
if( norm > 1.0 )
{
length = sqrt(norm);
drag.x = mx/length;
drag.y = my/length;
drag.z = 0.0;
}
else
{
drag.x = mx;
drag.y = my;
drag.z = sqrt(1.0-norm);
}
n.x = drag.y*onclick.z - drag.z*onclick.y;
n.y = drag.z*onclick.x - drag.x*onclick.z;
n.z = drag.x*onclick.y - drag.y*onclick.x;
if ( n.x*n.x + n.y*n.y + n.z*n.z > 10e-7 )
{
t = drag.x*onclick.x + drag.y*onclick.y + drag.z*onclick.z;
q.x = + q.x*t + q.y*n.z - q.z*n.y + q.w*n.x;
q.y = - q.x*n.z + q.y*t + q.z*n.x + q.w*n.y;
q.z = + q.x*n.y - q.y*n.x + q.z*t + q.w*n.z;
q.w = - q.x*n.x - q.y*n.y - q.z*n.z + q.w*t;
onclick.x = drag.x;
onclick.y = drag.y;
onclick.z = drag.z;
}
glutPostRedisplay();
}
void motion(int nmx, int nmy) // Mouse
{
mx = 2.*(nmx/(double)width - 0.5);
my = 2.*(0.5 - nmy/(double)height);
}
void click(int b, int s, int nmx, int nmy) // Mouse
{
double norm,length;
switch(b)
{
case GLUT_LEFT_BUTTON:
if( s == GLUT_DOWN ) interactive = 1;
else interactive = 0;
mx = 2.*(nmx/(double)width - 0.5);
my = 2.*(0.5 - nmy/(double)height);
norm = mx*mx + my*my;
if( norm > 1.0 )
{
length = sqrt(norm);
drag.x = mx/length;
drag.y = my/length;
drag.z = 0.0;
}
else
{
drag.x = mx;
drag.y = my;
drag.z = sqrt(1.0-norm);
}
onclick.x = drag.x;
onclick.y = drag.y;
onclick.z = drag.z;
break;
}
glutPostRedisplay();
}
void quatinit()
{
q.x = 0.0;
q.y = 0.0;
q.z = 0.0;
q.w = 1.0;
}
void rotatevector(double * vec)
{
int i;
double rot[16];
double temp[4] = {vec[0],vec[1],vec[2],1.0};
double ret[4];
rot[ 0] = (q.w*q.w + q.x*q.x - q.y*q.y - q.z*q.z);
rot[ 1] = 2.*(q.x*q.y - q.w*q.z);
rot[ 2] = 2.*(q.x*q.z + q.w*q.y);
rot[ 3] = 0.0;
rot[ 4] = 2.*(q.x*q.y + q.w*q.z);
rot[ 5] = (q.w*q.w - q.x*q.x + q.y*q.y - q.z*q.z);
rot[ 6] = 2.*(q.y*q.z - q.w*q.x);
rot[ 7] = 0.0;
rot[ 8] = 2.*(q.x*q.z - q.w*q.y);
rot[ 9] = 2.*(q.y*q.z + q.w*q.x);
rot[10] = (q.w*q.w - q.x*q.x - q.y*q.y + q.z*q.z);
rot[11] = 0.0;
rot[12] = 0.0;
rot[13] = 0.0;
rot[14] = 0.0;
rot[15] = (q.w*q.w + q.x*q.x + q.y*q.y + q.z*q.z);
for(i=0; i < 4; i++)
{
ret[i] = temp[0] * rot[i*4];
ret[i] += temp[1] * rot[i*4+1];
ret[i] += temp[2] * rot[i*4+2];
ret[i] += temp[3] * rot[i*4+3];
}
vec[0] = ret[0]/ret[3];
vec[1] = ret[1]/ret[3];
vec[2] = ret[2]/ret[3];
}
void rotate()
{
double rot[16];
rot[ 0] = (q.w*q.w + q.x*q.x - q.y*q.y - q.z*q.z);
rot[ 1] = 2.*(q.x*q.y - q.w*q.z);
rot[ 2] = 2.*(q.x*q.z + q.w*q.y);
rot[ 3] = 0.0;
rot[ 4] = 2.*(q.x*q.y + q.w*q.z);
rot[ 5] = (q.w*q.w - q.x*q.x + q.y*q.y - q.z*q.z);
rot[ 6] = 2.*(q.y*q.z - q.w*q.x);
rot[ 7] = 0.0;
rot[ 8] = 2.*(q.x*q.z - q.w*q.y);
rot[ 9] = 2.*(q.y*q.z + q.w*q.x);
rot[10] = (q.w*q.w - q.x*q.x - q.y*q.y + q.z*q.z);
rot[11] = 0.0;
rot[12] = 0.0;
rot[13] = 0.0;
rot[14] = 0.0;
rot[15] = (q.w*q.w + q.x*q.x + q.y*q.y + q.z*q.z);
glMultMatrixd(rot);
}
/*********************************
Implementation of quaternion-based
object rotation
Functions
clickmotion - call when holded mouse moved
click - call when user clicks
motion - call when mouse just moves
quatinit - flush rotation value
rotate - multiply GL matrix
Dependency: rotate.h,
Standard: math.h
Specific: glut.h
**********************************/
#ifndef _ROTATE_H
#define _ROTATE_H
void clickmotion(int nmx, int nmy);
void motion(int nmx, int nmy);
void click(int b, int s, int nmx, int nmy);
void quatinit();
void rotate();
void rotatevector(double * vec);
#endif
project(DrawMatrix)
set(SOURCE main.cpp my_glut.h)
find_package(OpenGL)
find_package(GLUT)
if(OPENGL_FOUND)
if(GLUT_FOUND)
message("linking DrawMatrix with GLUT and OpenGL")
include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${GLUT_INCLUDE_DIR})
add_executable(DrawMatrix ${SOURCE})
target_link_libraries(DrawMatrix inmost ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
if(USE_MPI)
target_link_libraries(DrawMatrix ${MPI_LIBRARIES})
if(MPI_LINK_FLAGS)
set_target_properties(DrawMatrix PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()
endif(USE_MPI)
if(USE_SOLVER)
if(USE_SOLVER_ANI3D)
message("linking DrawMatrix with ANI3d")
target_link_libraries(DrawMatrix ani3d)
endif()
if(USE_SOLVER_PETSC)
message("linking DrawMatrix with PETSc")
add_definitions(${PETSC_DEFINITIONS})
target_link_libraries(DrawMatrix ${PETSC_LIBRARIES})
endif()
if(USE_SOLVER_TRILINOS)
message("linking DrawMatrix with Trilinos")
target_link_libraries(DrawMatrix ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
endif()
if(USE_SOLVER_METIS)
message("linking DrawMatrix with Metis")
target_link_libraries(DrawMatrix ${METIS_LIBRARIES})
endif()
if(USE_SOLVER_MONDRIAAN)
message("linking DrawMatrix with Mondriaan")
target_link_libraries(DrawMatrix ${MONDRIAAN_LIBRARIES})
endif()
endif()
install(TARGETS DrawMatrix EXPORT inmost-targets RUNTIME DESTINATION bin)
else(GLUT_FOUND)
message("GLUT not found, not building DrawMatrix")
endif(GLUT_FOUND)
else(OPENGL_FOUND)
message("OpenGL not found, not building DrawMatrix")
endif(OPENGL_FOUND)
CXX=mpicxx
CC=mpicxx
PETSC_DIR=#/data4t/terekhov/Packages/petsc-3.3-p3
PETSC_ARCH=#arch-linux2-c-opt
INCPATH = -I../../ -I${PETSC_DIR}/${PETSC_ARCH}/include -I${PETSC_DIR}/include
OPENGL = -L/usr/X11R6/lib -lX11 -lXi -lXmu -lGL -lglut -lGLU
#OPENGL = -framework GLUT -framework OpenGL
#OPENGL = -lglut -lgl -lglu32 -lopengl32
#OPENGL = -L/lib -lglu32 -lopengl32
PETSC = -L${PETSC_DIR}/${PETSC_ARCH}/lib/ -lpetsc -L/usr/X11R6/lib -lX11 -lparmetis -lmetis -lmpi_f77 -lflapack -lfblas -lgfortran
ILU2 = ../../ILU2/lib/libilu-2.3.a -lgfortran
#OPTFLAGS= -O0 -g -Wall
OPTFLAGS= -O3
MYLIBS=../../mspp.a
#MYLIBS= ../../msppd.a
CXXFLAGS=$(OPTFLAGS) $(INCPATH)
LDFLAGS=$(OPTFLAGS)
LDLIBS=$(MYLIBS) $(OPENGL) $(PETSC) $(ILU2)
targets=main
all: $(targets)
main: main.o
clean:
rm -f $(targets) *.o
This diff is collapsed.
#if defined (__APPLE__) || defined(MAXOSX)
#include <GLUT/glut.h>
#endif
#if defined(_WIN32)
//#include <GL/glut.h>
// В windows следует скачать тот самый glut по ссылке
// http://www.opengl.org/resources/libraries/glut/
// и положить в папку с компилирующимся файлом
// так же следует установить пару библиотек
#define NOMINMAX
#include <windows.h>
#include <GL/glut.h>
//#include "glut.h"
#pragma comment(lib,"glut32.lib")
#endif
#if defined(__linux__)
#include <GL/glut.h>
#endif
project(FVDiscr)
set(SOURCE main.cpp)
add_executable(FVDiscr ${SOURCE})
target_link_libraries(FVDiscr inmost)
if(USE_SOLVER)
if(USE_SOLVER_ANI)
message("linking FVDiscr with ani3d and BLAS")
target_link_libraries(FVDiscr ani3d ${BLAS_LIBRARIES})
if(BLAS_LINKER_FLAGS)
set_target_properties(FVDiscr PROPERTIES LINK_FLAGS "${BLAS_LINKER_FLAGS}")
endif()
endif()
if(USE_SOLVER_PETSC)
message("linking FVDiscr with PETSc")
target_link_libraries(FVDiscr ${PETSC_LIBRARIES})
endif()
if(USE_SOLVER_TRILINOS)
message("linking FVDiscr with Trilinos")
target_link_libraries(FVDiscr ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
endif()
if(USE_SOLVER_METIS)
message("linking FVDiscr with Metis")
target_link_libraries(FVDiscr ${METIS_LIBRARIES})
endif()
if(USE_SOLVER_MONDRIAAN)
message("linking FVDiscr with Mondriaan")
target_link_libraries(FVDiscr ${MONDRIAAN_LIBRARIES})
endif()
endif()
if(USE_PARTITIONER)
if(USE_PARTITIONER_ZOLTAN)
message("linking FVDiscr with Zoltan")
target_link_libraries(FVDiscr ${ZOLTAN_LIBRARIES})
endif()
if(USE_PARTITIONER_PARMETIS)
message("linking FVDiscr with ParMETIS")
target_link_libraries(FVDiscr ${PARMETIS_LIBRARIES})
endif()
endif()
if(USE_MPI)
message("linking FVDiscr with MPI")
target_link_libraries(FVDiscr ${MPI_LIBRARIES})
if(MPI_LINK_FLAGS)
set_target_properties(FVDiscr PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()
endif(USE_MPI)
install(TARGETS FVDiscr EXPORT inmost-targets RUNTIME DESTINATION bin)
This diff is collapsed.
project(GridGen)
set(SOURCE main.cpp)
add_executable(GridGen ${SOURCE})
target_link_libraries(GridGen inmost)
if(USE_MPI)
message("linking GridGen with MPI")
target_link_libraries(GridGen ${MPI_LIBRARIES})
if(MPI_LINK_FLAGS)
set_target_properties(GridGen PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()
endif(USE_MPI)
install(TARGETS GridGen EXPORT inmost-targets RUNTIME DESTINATION bin)
\ No newline at end of file
This diff is collapsed.
project(MatSolve)
set(SOURCE main.cpp)
add_executable(MatSolve ${SOURCE})
target_link_libraries(MatSolve inmost)
if(USE_MPI)
message("linking MatSolve with MPI")
target_link_libraries(MatSolve ${MPI_LIBRARIES})
if(MPI_LINK_FLAGS)
set_target_properties(MatSolve PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()
endif(USE_MPI)
if(USE_SOLVER)
if(USE_SOLVER_ANI)
message("linking MatSolve with ani3d and BLAS")
target_link_libraries(MatSolve ani3d ${BLAS_LIBRARIES})
if(BLAS_LINKER_FLAGS)
set_target_properties(MatSolve PROPERTIES LINK_FLAGS "${BLAS_LINKER_FLAGS}")
endif()
endif()
if(USE_SOLVER_PETSC)
message("linking MatSolve with PETSc")
target_link_libraries(MatSolve ${PETSC_LIBRARIES})
endif()
if(USE_SOLVER_TRILINOS)
message("linking MatSolve with Trilinos")
target_link_libraries(MatSolve ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
endif()
if(USE_SOLVER_METIS)
message("linking MatSolve with Metis")
target_link_libraries(MatSolve ${METIS_LIBRARIES})
endif()
if(USE_SOLVER_MONDRIAAN)
message("linking MatSolve with Mondriaan")
target_link_libraries(MatSolve ${MONDRIAAN_LIBRARIES})
endif()
endif()
if(USE_PARTITIONER)
if(USE_PARTITIONER_ZOLTAN)
message("linking MatSolve with Zoltan")
target_link_libraries(MatSolve ${ZOLTAN_LIBRARIES})
endif()
if(USE_PARTITIONER_PARMETIS)
message("linking MatSolve with ParMETIS")
target_link_libraries(MatSolve ${PARMETIS_LIBRARIES})
endif()
endif()
install(TARGETS MatSolve EXPORT inmost-targets RUNTIME DESTINATION bin)