Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thm seg parallel #6

Open
wants to merge 28 commits into
base: Treasure_Island
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ DEAL_II_INITIALIZE_CACHED_VARIABLES()
PROJECT(${TARGET})
DEAL_II_INVOKE_AUTOPILOT()


#add_library(lthm SHARED ${thm_src})

# add_executable(geothm ${thm_SOURCE_DIR}/src/main.cc)
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Please refer to [CB-Geo thm Documentation](https://cb-geo.github.io/thm-doc) for
#login TACC
ssh [email protected]

nano ~/.bashrc
# Write the following commands into the .bashrc file
module load impi-largemem
export CC=icc
export CXX=icpc
Expand All @@ -66,10 +68,10 @@ wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz && \
module load boost

# Clone and compile dealii
cd $HOME
cds
git clone https://github.com/dealii/dealii --depth=1 dealii-src
cd dealii-src/ && mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/dealii -DPETSC_DIR=$PETSC_DIR -DPETSC_ARCH=clx -DDEAL_II_WITH_PETSC=On -DDEAL_II_WITH_METIS=On -DMETIS_DIR=$HOME/metis/ -DDEAL_II_WITH_MPI=On ..
cmake -DCMAKE_INSTALL_PREFIX=$SCRATCH/dealii -DPETSC_DIR=$PETSC_DIR -DPETSC_ARCH=clx -DDEAL_II_WITH_PETSC=On -DDEAL_II_WITH_METIS=On -DMETIS_DIR=$HOME/metis/ -DDEAL_II_WITH_MPI=On ..
make install -j4


Expand All @@ -79,7 +81,7 @@ git clone https://github.com/cb-geo/thm
cd thm
git checkout thm_seg_parallel
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DDEAL_II_DIR=$HOME/dealii/ ..
cmake -DCMAKE_BUILD_TYPE=Release -DDEAL_II_DIR=$SCRATCH/dealii/ ..
make -j
```

Expand Down
26 changes: 18 additions & 8 deletions include/boundaryvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ class PressureDirichletBoundaryValues : public Function<dim> {
private:
const double period_; // value
int boundary_id_{-1};
int bd_i_;

public:
PressureDirichletBoundaryValues()
: Function<dim>(), period_(0.2) {} // 之前的没有
: Function<dim>(), period_(0.2), bd_i_(0) {} // 之前的没有
virtual double value(const Point<dim>& p,
const unsigned int component = 0) const; // boundary

virtual void get_bd_i(int bd_i) {bd_i_ = bd_i;}
// virtual void vector_value(const Point<dim>& p, //放在这里没啥用
// Vector<double>& value) const;
virtual void set_boundary_id(int bnd_id) { boundary_id_ = bnd_id; }
Expand Down Expand Up @@ -56,10 +57,12 @@ class TemperatureDirichletBoundaryValues : public Function<dim> {
private:
const double period_; // value
int boundary_id_{-1};
int bd_i_;

public:
TemperatureDirichletBoundaryValues()
: Function<dim>(), period_(0.2) {} // 之前的没有
: Function<dim>(), period_(0.2) ,bd_i_(0){} // 之前的没有
virtual void get_bd_i(int bd_i) {bd_i_ = bd_i;}
virtual double value(const Point<dim>& p,
const unsigned int component = 0) const; // boundary
// virtual void vector_value(const Point<dim>& p, //放在这里没啥用
Expand Down Expand Up @@ -88,7 +91,8 @@ double TemperatureDirichletBoundaryValues<dim>::value(
// }
if (boundary_id_ == 4) {
return g_Tb_well;
} else if (boundary_id_ == 3 || boundary_id_ == 8 || boundary_id_ == 12 ||
}
if (boundary_id_ == 3 || boundary_id_ == 8 || boundary_id_ == 12 ||
boundary_id_ == 13 || boundary_id_ == 14) {
return g_Tb_top + g_T_grad * (0. - p[2]);
}
Expand All @@ -106,10 +110,12 @@ class PressureNeumanBoundaryValues : public Function<dim> {
private:
const double period_; // value
int boundary_id_{-1};
int bd_i_;

public:
PressureNeumanBoundaryValues()
: Function<dim>(), period_(0.2) {} // 之前的没有
: Function<dim>(), period_(0.2), bd_i_(0){} // 之前的没有
virtual void get_bd_i(int bd_i) {bd_i_ = bd_i;}
virtual double value(const Point<dim>& p,
const unsigned int component = 0) const; // boundary

Expand All @@ -136,10 +142,12 @@ class TemperatureNeumanBoundaryValues : public Function<dim> {
private:
const double period; // value
int boundary_id_{-1};
int bd_i_;

public:
TemperatureNeumanBoundaryValues()
: Function<dim>(), period(0.2) {} // 之前的没有
: Function<dim>(), period(0.2), bd_i_(0) {} // 之前的没有
virtual void get_bd_i(int bd_i) {bd_i_ = bd_i;}
virtual double value(const Point<dim>& p,
const unsigned int component = 0) const; // boundary
// virtual void vector_value(const Point<dim>& p, //放在这里没啥用
Expand All @@ -159,9 +167,11 @@ double TemperatureNeumanBoundaryValues<dim>::value(
if (boundary_id_ == 4) {
return g_QT_well; // boundary value is set to zero in
// this case
} else if (boundary_id_ == 3) {
}
if (boundary_id_ == 8) {
return g_QT_top;
} else if (boundary_id_ == 8) {
}
if (boundary_id_ == 3) {
return g_QT_bottom;
}
}
Expand Down
Loading