Commit e071c60e authored by Adam Powell's avatar Adam Powell

Imported Upstream version 5.5.0.svn.5100.dfsg

parent 6e7157ee
......@@ -39,6 +39,19 @@
<Item> <Name> GiD </Name> </Item>
</Parameter>
<Parameter Widget="CheckBox">
<Name> Binary Output </Name>
<DefaultValue> False </DefaultValue>
<Whatis> Use binary format when available (vtu). </Whatis>
</Parameter>
<Parameter Widget="CheckBox">
<Name> Single Precision </Name>
<DefaultValue> False </DefaultValue>
<Whatis> Use single precision when available (vtu). </Whatis>
</Parameter>
<Parameter Widget="Edit" >
<Name> Output File Name </Name>
<DefaultValue> case </DefaultValue>
......
......@@ -50,15 +50,17 @@ EgIni::EgIni(QWidget *parent)
// Determine ini-file location and name:
//--------------------------------------
char *elmerGuiHome = NULL;
QString elmerGuiHome;
#ifdef __APPLE__
QString iniFileName = this->homePath + "/edf/egini.xml";
#else
QString iniFileName = "edf/egini.xml";
elmerGuiHome = getenv("ELMERGUI_HOME");
if(elmerGuiHome != NULL)
iniFileName = QString(elmerGuiHome) + "/edf/egini.xml";
QString iniFileName = QCoreApplication::applicationDirPath() + "/edf/egini.xml";
elmerGuiHome = QString(getenv("ELMERGUI_HOME"));
if(!elmerGuiHome.isEmpty())
iniFileName = elmerGuiHome + "/edf/egini.xml";
#endif
// Load initialization file:
......
......@@ -6826,18 +6826,19 @@ void MainWindow::synchronizeMenuToState()
//-----------------------------------------------------------------------------
void MainWindow::loadDefinitions()
{
// Determine edf-file location and name:
//--------------------------------------
char *elmerGuiHome = NULL;
QString elmerGuiHome;
#ifdef __APPLE__
QString generalDefs = this->homePath + "/edf/edf.xml";
#else
QString generalDefs = "edf/edf.xml";
elmerGuiHome = getenv("ELMERGUI_HOME");
if(elmerGuiHome != NULL)
generalDefs = QString(elmerGuiHome) + "/edf/edf.xml";
QString generalDefs = QCoreApplication::applicationDirPath() + "/edf/edf.xml";
elmerGuiHome = QString(getenv("ELMERGUI_HOME"));
if(!elmerGuiHome.isEmpty())
generalDefs = elmerGuiHome + "/edf/edf.xml";
// ML 5. August 2010
generalDefs.replace('\\', '/');
......@@ -6895,10 +6896,12 @@ void MainWindow::loadDefinitions()
#ifdef __APPLE__
QDirIterator iterator( homePath+"/edf", QDirIterator::Subdirectories);
#else
QString additionalEdfs = "edf";
if(elmerGuiHome != NULL)
additionalEdfs = QString(elmerGuiHome) + "/edf";
QDirIterator iterator( additionalEdfs, QDirIterator::Subdirectories);
QString additionalEdfs = QCoreApplication::applicationDirPath() + "/edf";
if(!elmerGuiHome.isEmpty())
additionalEdfs = elmerGuiHome + "/edf";
QDirIterator iterator(additionalEdfs, QDirIterator::Subdirectories);
#endif
while (iterator.hasNext()) {
......@@ -6967,14 +6970,14 @@ void MainWindow::loadDefinitions()
// Load qss:
//-----------
QString qssFileName = "elmergui.qss";
#ifdef __APPLE__
qssFileName = homePath + "/elmergui.qss";
#else
if(elmerGuiHome != NULL)
qssFileName = QString(elmerGuiHome) + "/elmergui.qss";
#endif
QString qssFileName = QCoreApplication::applicationDirPath() + "/elmergui.qss";
#ifdef __APPLE__
qssFileName = homePath + "/elmergui.qss";
#else
if(!elmerGuiHome.isEmpty())
qssFileName = elmerGuiHome + "/elmergui.qss";
#endif
QFile qssFile(qssFileName);
......
......@@ -56,15 +56,18 @@ MaterialLibrary::MaterialLibrary(QWidget *parent)
// Load library:
//--------------
char *elmerGuiHome = NULL;
QString elmerGuiHome;
#ifdef __APPLE__
QString matFileName = this->homePath + "/edf/egmaterials.xml";
#else
QString matFileName = "edf/egmaterials.xml";
elmerGuiHome = getenv("ELMERGUI_HOME");
if(elmerGuiHome != NULL)
matFileName = QString(elmerGuiHome) + "/edf/egmaterials.xml";
QString matFileName = QCoreApplication::applicationDirPath()
+ "/edf/egmaterials.xml";
elmerGuiHome = QString(getenv("ELMERGUI_HOME"));
if(!elmerGuiHome.isEmpty())
matFileName = elmerGuiHome + "/edf/egmaterials.xml";
#endif
QListWidget *list = ui.materialListWidget;
......
TEMPLATE = app
TARGET = ElmerGUIlogger
DEPENDPATH += . src
INCLUDEPATH += .
CONFIG += release
HEADERS += src/mainwindow.h
SOURCES += src/main.cpp src/mainwindow.cpp
RESOURCES += ElmerGUIlogger.qrc
RC_FILE = ElmerGUIlogger.rc
......@@ -51,13 +51,14 @@
#include <QPrintDialog>
#include <QPrinter>
#include <QByteArray>
#include <QCoreApplication>
#include "mainwindow.h"
MainWindow::MainWindow()
{
setWindowTitle("ElmerGUI log window");
setWindowIcon(QIcon(":/icons/ElmerGUI.png"));
resize(400, 240);
resize(600, 300);
textEdit = new QTextEdit(this);
setCentralWidget(textEdit);
......@@ -69,9 +70,19 @@ MainWindow::MainWindow()
QString ELMER_HOME = getenv("ELMER_HOME");
QString ELMERGUI_HOME = getenv("ELMERGUI_HOME");
QString ELMER_POST_HOME = getenv("ELMER_POST_HOME");
textEdit->append("ELMER_HOME: " + ELMER_HOME);
textEdit->append("ELMERGUI_HOME: " + ELMERGUI_HOME);
textEdit->append("ELMER_POST_HOME: " + ELMER_POST_HOME);
if(ELMER_HOME.isEmpty())
ELMER_HOME = QCoreApplication::applicationDirPath() + "/..";
if(ELMERGUI_HOME.isEmpty())
ELMERGUI_HOME = QCoreApplication::applicationDirPath();
if(ELMER_POST_HOME.isEmpty())
ELMER_POST_HOME = QCoreApplication::applicationDirPath() + "/../share/elmerpost";
textEdit->append("ELMER_HOME=" + ELMER_HOME);
textEdit->append("ELMERGUI_HOME=" + ELMERGUI_HOME);
textEdit->append("ELMER_POST_HOME=" + ELMER_POST_HOME);
elmerGUI = new QProcess(this);
......@@ -130,10 +141,8 @@ void MainWindow::startElmerGUISlot()
if(!elmerGUI->waitForStarted()) {
textEdit->setTextColor(Qt::darkGreen);
textEdit->append("Probably the executable ElmerGUI(.exe) is either missing, or "
"then there is no path to it (at least ELMER_HOME/bin and "
"ELMERGUI_HOME should be found from path). Please check your Elmer "
"installation.");
textEdit->append("The executable ElmerGUI(.exe) is either"
"missing, or then there is no path to it");
}
else {
startElmerGUIAct->setEnabled(false);
......
......@@ -3694,7 +3694,153 @@ int LoadGmshInput(struct FemType *data,struct BoundaryType *bound,
}
int LoadGeoInput(struct FemType *data,struct BoundaryType *bound,
char *filename,int info)
{
int noknots = 0,noelements = 0,maxnodes,elematts,nodeatts,nosides,dim,notags;
int sideind[MAXNODESD1],elemind[MAXNODESD2],tottypes,elementtype,bcmarkers;
int i,j,k,dummyint,*boundnodes,allocated,*revindx,maxindx;
int elemno, gmshtype, tagphys, taggeom, tagpart, elemnodes,maxelemtype,elemtype0,elemdim;
int usetaggeom,tagmat,verno;
FILE *in;
char *cp,line[MAXLINESIZE];
if ((in = fopen(filename,"r")) == NULL) {
printf("LoadGeoInput: The opening of the mesh file %s failed!\n",filename);
return(1);
}
if(info) printf("Loading mesh in geo format from file %s\n",filename);
allocated = FALSE;
dim = 3;
maxnodes = 0;
maxindx = 0;
maxelemtype = 0;
usetaggeom = FALSE;
omstart:
for(;;) {
if(Getrow(line,in,FALSE)) goto end;
if(!line) goto end;
if(strstr(line,"$End")) continue;
if(strstr(line,"TYPES")) {
if(!strstr(line,"ALL=TET04")) {
printf("Only all tets implemnted at the monment!\n");
return;
}
elemtype0 = 504;
getline;
}
else if(strstr(line,"COORDINATES")) {
i = 0;
for(;;) {
getline;
if( strstr(line,"END_COORDINATES")) break;
cp = line;
j = next_int(&cp);
i = i + 1;
if(allocated) {
if(maxindx > noknots) revindx[j] = i;
data->x[i] = next_real(&cp);
data->y[i] = next_real(&cp);
if(dim > 2) data->z[i] = next_real(&cp);
}
else {
maxindx = MAX(j,maxindx);
}
}
noknots = i;
}
else if(strstr(line,"ELEMENTS")) {
i = 0;
elementtype = elemtype0;
tagmat = 1;
for(;;) {
getline;
if( strstr(line,"END_ELEMENTS")) break;
cp = line;
j = next_int(&cp);
i = i + 1;
if(allocated) {
elemnodes = elementtype % 100;
data->elementtypes[i] = elementtype;
data->material[i] = tagmat;
for(k=0;k<elemnodes;k++)
elemind[k] = next_int(&cp);
for(k=0;k<elemnodes;k++)
data->topology[i][k] = elemind[k];
}
else {
maxelemtype = MAX(maxelemtype,elementtype);
}
}
noelements = i;
}
else if ( strstr(line,"BOUNDARIES")) {
for(;;) {
getline;
if( strstr(line,"END_BOUNDARIES")) break;
printf("Implement boundaries!\n");
}
}
}
end:
if(!allocated) {
maxnodes = maxelemtype % 100;
InitializeKnots(data);
data->dim = dim;
data->maxnodes = maxnodes;
data->noelements = noelements;
data->noknots = noknots;
if(info) printf("Allocating for %d knots and %d elements.\n",noknots,noelements);
AllocateKnots(data);
if(maxindx > noknots) {
revindx = Ivector(1,maxindx);
for(i=1;i<=maxindx;i++) revindx[i] = 0;
}
rewind(in);
allocated = TRUE;
goto omstart;
}
if(maxindx > noknots) {
printf("Renumbering the Geo nodes from %d to %d\n",maxindx,noknots);
for(i=1; i <= noelements; i++) {
elementtype = data->elementtypes[i];
elemnodes = elementtype % 100;
for(j=0;j<elemnodes;j++) {
k = data->topology[i][j];
if(k <= 0 || k > maxindx)
printf("index out of bounds %d\n",k);
else if(revindx[k] <= 0)
printf("unkonwn node %d %d in element %d\n",k,revindx[k],i);
else
data->topology[i][j] = revindx[k];
}
}
free_Ivector(revindx,1,maxindx);
}
if(0) ElementsToBoundaryConditions(data,bound,FALSE,info);
if(info) printf("Succesfully read the mesh from the Geo input file.\n");
return(0);
}
int UnvToElmerType(int unvtype)
......
......@@ -22,5 +22,7 @@ int LoadGidInput(struct FemType *data,struct BoundaryType *bound,
char *prefix,int info);
int LoadGmshInput(struct FemType *data,struct BoundaryType *bound,
char *prefix,int info);
int LoadGeoInput(struct FemType *data,struct BoundaryType *bound,
char *prefix,int info);
int LoadUniversalMesh(struct FemType *data,char *prefix,int info);
int LoadCGsimMesh(struct FemType *data,char *prefix,int info);
......@@ -100,6 +100,7 @@ static void Instructions()
#if 0
printf("16) .unv : Universal mesh file format\n");
printf("17) .msh : Nastran format\n");
printf("19) .geo : Geo format\n");
#endif
printf("\nThe second parameter defines the output file format:\n");
......@@ -502,6 +503,20 @@ int main(int argc, char *argv[])
break;
case 19:
printf("a1\n");
boundaries[nofile] = (struct BoundaryType*)
malloc((size_t) (MAXBOUNDARIES)*sizeof(struct BoundaryType));
for(i=0;i<MAXBOUNDARIES;i++) {
boundaries[nofile][i].created = FALSE;
boundaries[nofile][i].nosides = 0;
}
if (LoadGeoInput(&(data[nofile]),boundaries[nofile],eg.filesin[nofile],TRUE))
Goodbye();
nomeshes++;
break;
default:
Instructions();
Goodbye();
......
......@@ -148,6 +148,7 @@ MKOCTFILE_DL_LDFLAGS = @MKOCTFILE_DL_LDFLAGS@
MPI_F90 = @MPI_F90@
MPI_INCLUDE_DIR = @MPI_INCLUDE_DIR@
MPI_LIBS = @MPI_LIBS@
MUMPS_LIBS = @MUMPS_LIBS@
MV = @MV@
NO_OCT_FILE_STRIP = @NO_OCT_FILE_STRIP@
OBJEXT = @OBJEXT@
......@@ -182,6 +183,7 @@ SH_LINKING_TO_FLAGS = @SH_LINKING_TO_FLAGS@
SOLVER_LIBS = @SOLVER_LIBS@
SOLVER_MPI_LIBS = @SOLVER_MPI_LIBS@
SONAME_FLAGS = @SONAME_FLAGS@
STDCXX_LIBS = @STDCXX_LIBS@
STRIP = @STRIP@
TEMPLATE_AR = @TEMPLATE_AR@
TEMPLATE_ARFLAGS = @TEMPLATE_ARFLAGS@
......@@ -256,6 +258,10 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = src tests
EXTRA_DIST = autogen.sh acx_elmer.m4 acx_blas.m4 acx_lapack.m4 acx_mpi.m4 GPL-2 LICENSES
# if test `ls nodist.sh` != ""; then \
# sh nodist.sh; \
# fi
CLEANFILES = a.out
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
......@@ -611,6 +617,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
......@@ -705,9 +712,6 @@ dist-hook:
rm -rf `find $(distdir)/ -name \#*`
rm -rf `find $(distdir)/ -name \*~`
rm -rf `find $(distdir)/ -name \*.so`
# if test `ls nodist.sh` != ""; then \
# sh nodist.sh; \
# fi
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
......@@ -1400,6 +1400,7 @@ esac
# fi
AC_MSG_RESULT($acx_cv_fc_char_mangling)
rm testi$ac_exeext conftest.$ac_objext cfortran_test.$ac_objext],
......@@ -1443,6 +1444,26 @@ esac
])
AC_DEFUN([ACX_FC_CONTIG], [
AC_PREREQ(2.50)
AC_REQUIRE([ACX_LANG_COMPILER_MS])
AC_LANG_PUSH(Fortran)
AC_MSG_CHECKING([if fortran implements CONTIGUOUS attribute])
AC_COMPILE_IFELSE(
[ program test_contiguous
integer, pointer, contiguous :: x(:)
end program test_contiguous ],
[ acx_cv_fc_contig=yes ], [ acx_cv_fc_contig=no ] )
AC_MSG_RESULT([$acx_cv_fc_contig])
AC_LANG_POP(Fortran)
if test "$acx_cv_fc_contig" == yes ; then
FCPPFLAGS="$FCPPFLAGS -DCONTIG=\",CONTIGUOUS\""
else
FCPPFLAGS="$FCPPFLAGS -DCONTIG=\"\""
fi
])
AC_DEFUN([ACX_FC_INCLUDE_MODULE_FLAG],[
INCLUDE_MODULE_FLAG="-I"
......
This diff is collapsed.
......@@ -135,6 +135,9 @@
/* ... */
/* #undef HAVE_MPI */
/* Define if you have a MUMPS library. */
/* #undef HAVE_MUMPS */
/* Define if you have a PARPACK library. */
/* #undef HAVE_PARPACK */
......@@ -199,7 +202,7 @@
#define PACKAGE_VERSION ""
/* svn revision */
#define REVISION "4420M"
#define REVISION "4897:4904"
/* Detected platform. */
/* #undef SGI */
......@@ -229,7 +232,7 @@
/* #undef SUNOS */
/* Version number of package */
#define VERSION "6.0"
#define VERSION "6.1"
/* Detected platform2. */
/* #undef WIN32 */
......
......@@ -134,6 +134,9 @@
/* ... */
#undef HAVE_MPI
/* Define if you have a MUMPS library. */
#undef HAVE_MUMPS
/* Define if you have a PARPACK library. */
#undef HAVE_PARPACK
......
This diff is collapsed.
......@@ -45,6 +45,7 @@ AC_FC_WRAPPERS
ACX_FC_LINKTYP
ACX_FC_CHAR_MANGLING
ACX_FC_CONTIG
ACX_FC_ETIME
ACX_FC_FLUSH
......@@ -81,6 +82,7 @@ ACX_MPI_COMPILERS
if test "$MPI_INCLUDE_DIR" != ""; then
FCPPFLAGS="$FCPPFLAGS -I$MPI_INCLUDE_DIR"
CPPFLAGS="$CPPFLAGS -I$MPI_INCLUDE_DIR"
FFLAGS="$FFLAGS -I$MPI_INCLUDE_DIR"
CFLAGS="$CFLAGS -I$MPI_INCLUDE_DIR"
FCFLAGS="$FCFLAGS -I$MPI_INCLUDE_DIR"
......@@ -88,6 +90,7 @@ fi
if test "$MPI_INCLUDE" != ""; then
FCPPFLAGS="$FCPPFLAGS $MPI_INCLUDE"
CPPFLAGS="$CPPFLAGS $MPI_INCLUDE"
FFLAGS="$FFLAGS $MPI_INCLUDE"
CFLAGS="$CFLAGS $MPI_INCLUDE"
FCFLAGS="$FCFLAGS $MPI_INCLUDE"
......
......@@ -527,11 +527,14 @@
IonCharge = ListGetConstReal( Material, &
TRIM(ComponentName(Solver % Variable)) // &
' Ion Charge', GotIt )
IF ( .NOT. GotIt ) IonCharge = 0.0d0
NEConst(1:n) = IonCharge / LocalTemperature(1:n) * &
ListGetConstReal( Model % Constants,'Unit Charge') / &
ListGetConstReal( Model % Constants,'Boltzmann Constant')
IF ( .NOT. GotIt ) THEN
NEConst = 0._dp
IonCharge = 0._dp
ELSE
NEConst(1:n) = IonCharge / LocalTemperature(1:n) * &
ListGetConstReal( Model % Constants,'Unit Charge') / &
ListGetConstReal( Model % Constants,'Boltzmann Constant')
END IF
HeatCapacity(1:n) = ListGetReal( Material,'Heat Capacity', &
n,NodeIndexes,GotIt )
......
......@@ -192,6 +192,7 @@
!------------------------------------------------------------------------------
! non-linear system iteration loop
!------------------------------------------------------------------------------
totat = 0; totst = 0
DO iter=1,NonlinearIterMax
! Assembly of the bulk elements:
!-------------------------------
......
......@@ -293,7 +293,7 @@ use spariterglobals
END TYPE Stack_t
INTEGER :: stackp
TYPE(Stack_t), POINTER :: stack(:), copystack(:)
TYPE(Stack_t), POINTER CONTIG :: stack(:), copystack(:)
!-------------------------------------------------------------------------------
n = nin
Level=Levelin
......@@ -305,7 +305,9 @@ use spariterglobals
DO WHILE(ASSOCIATED(p))
IF ( stackp>=SIZE(stack) ) THEN
ALLOCATE( copystack(stackp*2) )
copystack(1:stackp) = stack(1:stackp)
DO j=1,stackp
copystack(j) = stack(j)
END DO
DEALLOCATE(stack)
stack => copystack
END IF
......
This diff is collapsed.
......@@ -109,7 +109,7 @@ SUBROUTINE OptimalSolutionUpdate( Model,Solver,dt,TransientSimulation )
INTEGER, ALLOCATABLE :: Indexes(:)
TYPE(Variable_t), POINTER :: FlowSol
REAL(KIND=dp), POINTER :: Mx(:),Mb(:),Mr(:)
REAL(KIND=dp), POINTER CONTIG :: Mx(:),Mb(:),Mr(:)
TYPE(ValueList_t), POINTER :: SolverParams
SAVE STIFF, LOAD, FORCE, rho, mu, Velocity, AllocationsDone, &
......
This diff is collapsed.
......@@ -65,6 +65,9 @@ CONTAINS
INTEGER :: i,j,k,istat,Subband,N
COMPLEX(KIND=dp), ALLOCATABLE :: BA(:,:)
REAL(KIND=dp), POINTER CONTIG :: Values(:)
INTEGER, POINTER CONTIG :: Rows(:), Cols(:), Diag(:)
SAVE BA
!------------------------------------------------------------------------------
......@@ -75,6 +78,11 @@ CONTAINS
END IF
END IF
Rows => A % Rows
Cols => A % Cols
Diag => A % Diag
Values => A % Values
n = A % NumberOfRows
x(1:n) = b(1:n)
n = n / 2
......@@ -82,8 +90,8 @@ CONTAINS
IF ( A % Format == MATRIX_CRS .AND. .NOT. A % Symmetric ) THEN
Subband = 0
DO i=1,N
DO j=A % Rows(2*i-1),A % Rows(2*i)-1,2
Subband = MAX(Subband,ABS((A % Cols(j)+1)/2-i))
DO j=Rows(2*i-1),Rows(2*i)-1,2
Subband = MAX(Subband,ABS((Cols(j)+1)/2-i))
END DO
END DO
......@@ -108,9 +116,9 @@ CONTAINS
BA = 0.0D0
DO i=1,N
DO j=A % Rows(2*i-1),A % Rows(2*i)-1,2
k = i - (A % Cols(j)+1)/2 + 2*Subband + 1
BA(k,(A % Cols(j)+1)/2) = CMPLX( A % Values(j), -A % Values(j+1), KIND=dp )
DO j=Rows(2*i-1),Rows(2*i)-1,2
k = i - (Cols(j)+1)/2 + 2*Subband + 1
BA(k,(Cols(j)+1)/2) = CMPLX(Values(j), -Values(j+1), KIND=dp )
END DO
END DO
......@@ -120,8 +128,8 @@ CONTAINS
Subband = 0