Skip to content
Snippets Groups Projects
Commit f9b3cffd authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

And moved Reinit library to src and updated makefiles.

parent 1829f405
No related branches found
No related tags found
No related merge requests found
Showing
with 188 additions and 1669 deletions
SHELL = /bin/sh
COMPILE = g++
DEFS = -DPACKAGE=\"AMDiS\" -DVERSION=\"0.1\" -DHAVE_DLFCN_H=1
DEBUG = 0
AMDIS_DIR = ../
INCLUDES = -I./src -I$(AMDIS_DIR)/src -I$(AMDIS_DIR)/compositeFEM/src -I$(AMDIS_DIR)/lib/mtl4
ifeq ($(strip $(DEBUG)), 0)
CPPFLAGS = -O2
else
CPPFLAGS = -g -O0
endif
CPPFLAGS += -ftemplate-depth-40
VPATH = .:$(AMDIS_DIR)/Reinit/src
LIBOFILES = \
BoundaryElementDist.o \
BoundaryElementNormalDist.o \
BoundaryElementLevelSetDist.o \
BoundaryElementTopDist.o \
BoundaryElementEdgeDist.o \
ElementLevelSet.o \
ElementUpdate_2d.o \
ElementUpdate_3d.o \
HL_SignedDist.o \
HL_SignedDistTraverse.o \
VelocityExt.o \
VelocityExtFromVelocityField.o \
NormEps.o
all: libreinit.a
# statische Bibliothek
libreinit.a: $(LIBOFILES)
rm -f lib/libreinit.a
ar cq lib/libreinit.a $(LIBOFILES)
.cc.o: $*.cc
$(COMPILE) $(DEFS) $(INCLUDES) $(CPPFLAGS) -c -o $*.o $<
clean:
-rm -rf *.o
This diff is collapsed.
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==
// == http://www.amdis-fem.org ==
// == ==
// ============================================================================
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.
#ifndef HL_SIGNEDDISTLEVELS
#define HL_SIGNEDDISTLEVELS
#include <queue>
#include <vector>
#include <time.h>
#include "ElInfo.h"
#include "FixVec.h"
#include "Traverse.h"
#include "ElementLevelSet.h"
#include "BoundaryElementDist.h"
#include "ElementUpdate.h"
#include "ElementUpdate_2d.h"
#include "ElementUpdate_3d.h"
#include "HL_SignedDist.h"
#include "VelocityExt.h"
#include "SMIAdapter.h"
#include "smi.h"
using namespace AMDiS;
typedef struct
{
int ElNum;
int VertNum;
} Vert_Struct;
class HL_SignedDistLevels : public HL_SignedDist
{
public:
HL_SignedDistLevels(const char *name_,
int dim_,
bool doVelocityExt = false,
Flag velExtType_ = VEL_EXT)
: HL_SignedDist(name_, dim_, doVelocityExt, velExtType_),
smiAdapter(NULL)
{
FUNCNAME("HL_SignedDistLevels::HL_SignedDistLevels()");
// ===== Read parameters from init file. =====
GET_PARAMETER(0, name + "->tolerance", "%f", &tol);
GET_PARAMETER(0, name + "->count_how_often_saved_in_list", "%d", &count_in_list);
GET_PARAMETER(0, name + "->save_in_list->the ..th", "%d", &print_in_list);
GET_PARAMETER(0, name + "->save_in_list->after the ..th traversing of the list", "%d", &print_in_list_2);
GET_PARAMETER(0, name + "->print_level", "%d", &chosen_level);
GET_PARAMETER(0, name + "->print_level_yes_no", "%d", &print_level);
TEST_EXIT(tol > 0)("illegal tolerance !\n");
}
protected:
/**
* Initializes the boundary: calculation of the distance of boundary
* vertices to the interface.
* Interface is given by \ref lS_DOF and result is stored in
* \ref sD_DOF.
*/
void initializeBoundary();
/**
* function for transvering Mesh to SMi an Adding the quantities
**/
void Mesh_to_SMI_and_quantity ();
/**
* function for creating the first list, in which elementnumber of
* boundary-elements are saved
*/
void createFirstList(const int elStatus,
const int *elVertStatusVec,
int ElNum,
const int NumVertIntPoints);
/**
* Calculates the distance function and stores result in sD_DOF.
* Requirement: The boundary values are already set in \ref sD_DOF.
*/
void HL_updateIteration();
/**
* function for traversing the list "List_Element"
* returns 1 if min one element is set in the new list
* returns 0 if no element is set in the new list
*/
int traverseListElement();
/**
* function for creating all levels higher than 1 an saving pairs of
* elements and node in the right list
**/
void createLevels ();
/**
* function collects the next neighbours, creates an according list
* and saves the pair in it
* returns true if one or more neighbours exist and false if not
**/
bool collectNeighbours_setLevels (const int Element,
const int currentIndex,
bool *elementInNewListSet);
/**
* function for traversing the list of list, named "Level_"
**/
void traversingListLevel_ ( DOFVector<double> *boundVal_DOF );
/**
* calls the next neighbours and puts them into the right list
* returns true if an element had to be saved in an lower level
* than the current index
* this means the loop over all lists Level_[i] has to be repaeated again
* "Vert" is a local node
**/
bool search_and_include_comb(int ElNum,
int Vert,
int *nodeIndices,
const int Index);
/**
* checking whether the element "ElNum_in" has to be included into
* the second list
* if yes it will be included
* returns true if the level of the element is smaler than he current index
* returns false if the level is greater thean the current index
* "Vert_1_in" and "Vert_2_in" are localvertizes
*/
bool includeIntoList (int ElNum_in,
int VertNum_1_in,
int VertNum_2_in,
const int Index);
/**
* gets the neighbour according to the node "VertNum_in" and two of
* its nodes (in local koordinates)
* returns "false" if the called neighbour exists and "true" if not
* Vert_Up_in is given in global coordinates, the other points are
* given in local coordinates
*/
bool getNextNeighbour (const int ElNum_in,
const int Vert_Up_in,
const int VertNum_in,
int &ElNum_out,
int &VertNum_1_out,
int &VertNum_2_out);
/**
* function needed in the function "traversingListELVert"
**/
int getNext_node_l_r (int elem_l_r_in,
int neighbour_l_r_in,
int node_l_r_in,
const int Vert);
//==================================
void print_quantity_5 (int cntr);
/**
* function for printinq the quantity 6
* attention: we need at least read_transaction in smi for calling
* this function
**/
void print_quantity_6 ();
//====================================
protected:
/**
* Tolerance for Hopf-Lax update iteration loop.
*/
double tol;
/**
* is needed for transfering the mesh to SMI
*/
SMIAdapter *smiAdapter;
/**
* in this list boundary-elements are saved;
* is needed for creating the list "List_El_Vert"
*/
queue<int> List_Element;
/**
* in this list structs filled with element-number and vertex-number
* are saved;
* is needed for traversing the mesh efficiently
*/
queue<Vert_Struct> Level;
queue<Vert_Struct> helpLevel;
queue<Vert_Struct> List_El_Vert; //Listen noch einmal kontrollieren!
/**
* in this vector the lists of different levels are saved
**/
vector<queue<Vert_Struct> > Level_;
/**
* 0 ->do not count updates
* 1 ->count updates
**/
int count_updates;
/**
* 1 -> it will be count how often a node is saved in the second list
* 0 ->it will not be count
**/
int count_in_list;
int print_in_list;
int print_in_list_2;
/**
* level which will be printed in a file
**/
int chosen_level;
/**
* 1->a special level will be printed in a file
* 0->no level is printed in a file
**/
int print_level;
};
#endif // HL_SIGNEDDISTLEVELS
lib_LTLIBRARIES = libamdis.la libcompositeFEM.la
lib_LTLIBRARIES = libamdis.la libcompositeFEM.la libreinit.la
LIB_DIR = ../lib
PARALLEL_DIR = $(SOURCE_DIR)
......@@ -249,6 +249,21 @@ parallel/ParMetisPartitioner.h \
parallel/PetscSolver.h \
parallel/StdMpi.h \
parallel/ZoltanPartitioner.h \
reinit/BoundaryElementDist.h \
reinit/BoundaryElementEdgeDist.h \
reinit/BoundaryElementLevelSetDist.h \
reinit/BoundaryElementNormalDist.h \
reinit/BoundaryElementTopDist.h \
reinit/ElementLevelSet.h \
reinit/ElementUpdate.h \
reinit/ElementUpdate_2d.h \
reinit/ElementUpdate_3d.h \
reinit/HL_SignedDist.h \
reinit/HL_SignedDistBornemann.h \
reinit/HL_SignedDistTraverse.h \
reinit/NormEps.h \
reinit/VelocityExt.h \
reinit/VelocityExtFromVelocityField.h \
time/RosenbrockAdaptInstationary.h \
time/RosenbrockStationary.h \
time/RosenbrockMethod.h
......@@ -377,3 +392,19 @@ compositeFEM/LevelSetAdaptMesh.cc \
compositeFEM/PenaltyOperator.cc \
compositeFEM/SubElementAssembler.cc \
compositeFEM/SubPolytope.cc
libreinit_la_CXXFLAGS = $(libamdis_la_CXXFLAGS)
libreinit_la_SOURCES = \
reinit/BoundaryElementDist.cc \
reinit/BoundaryElementEdgeDist.cc \
reinit/BoundaryElementLevelSetDist.cc \
reinit/BoundaryElementNormalDist.cc \
reinit/BoundaryElementTopDist.cc \
reinit/ElementLevelSet.cc \
reinit/ElementUpdate_2d.cc \
reinit/ElementUpdate_3d.cc \
reinit/HL_SignedDist.cc \
reinit/HL_SignedDistTraverse.cc \
reinit/NormEps.cc \
reinit/VelocityExt.cc \
reinit/VelocityExtFromVelocityField.cc
\ No newline at end of file
This diff is collapsed.
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment