aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrideout <rideout@6a38eb6e-646e-4a02-a296-d141613ad6c4>2003-01-06 21:32:52 +0000
committerrideout <rideout@6a38eb6e-646e-4a02-a296-d141613ad6c4>2003-01-06 21:32:52 +0000
commitf83e20b34998c8529ba12a6993975b32f1251442 (patch)
treef165f39e1884a47302a8577057e7ff8ae8776c49
parenta7800642d5c843f56c0d83a81303de98cf8f5159 (diff)
Implement dummy "None" boundary condition, which does nothing.
This is useful for selecting a variable for bcs (e.g. to ensure that symmetry conditions are applied to it), even though some other routine will execute the physical bcs. It is also used as a dummy local physical bc for non-local physical bcs. (See spec). git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@190 6a38eb6e-646e-4a02-a296-d141613ad6c4
-rw-r--r--src/Boundary.h2
-rw-r--r--src/NoneBoundary.c86
-rw-r--r--src/Register.c10
-rw-r--r--src/make.code.defn1
4 files changed, 97 insertions, 2 deletions
diff --git a/src/Boundary.h b/src/Boundary.h
index f43e9e0..5db4b35 100644
--- a/src/Boundary.h
+++ b/src/Boundary.h
@@ -17,6 +17,8 @@ extern "C"
{
#endif
+/* prototype for routine registed as providing 'None' boundary condition */
+int BndNone(const cGH *GH, int num_vars, int *var_indicies, int *table_handle);
/* Scalar boundaries */
int BndScalarDirGI (const cGH *GH,
diff --git a/src/NoneBoundary.c b/src/NoneBoundary.c
new file mode 100644
index 0000000..b4706e5
--- /dev/null
+++ b/src/NoneBoundary.c
@@ -0,0 +1,86 @@
+ /*@@
+ @file NoneBoundary.c
+ @date Sat Jan 4 05:43:35 CET 2003
+ @author David Rideout
+ @desc
+ Implements 'no boundary condition'. This can be used to
+ inform the Boundary thorn that this variable should have
+ boundary conditions applied to it, but then not actually
+ apply any local physical boundary condition. This is
+ useful e.g. if the physical boundary is being updated in
+ some other manner, but the symmetry boundaries should be
+ updated normally.
+
+ BndNone is also used as a dummy local physical boundary
+ condition, when the true physical bc is non-local.
+ @enddesc
+ @history
+ @hdate
+ @hauthor
+ @hdesc
+ @endhistory
+ @version $Header$
+ @@*/
+
+#include "cctk.h"
+#include "Boundary.h"
+
+/* the rcs ID and its dummy function to use it */
+static const char *rcsid = "$Header$";
+CCTK_FILEVERSION(CactusBase_Boundary_NoneBoundary_c);
+
+/********************************************************************
+ ******************** External Routines ************************
+ ********************************************************************/
+
+/*@@
+ @routine BndNone
+ @date 4 Jan 2003
+ @author David Rideout
+ @desc
+ Function which handles 'None' boundary condition
+ @enddesc
+ @calls
+ @history
+ @endhistory
+ @var GH
+ @vdesc Pointer to CCTK grid hierarchy
+ @vtype const cGH *
+ @vio in
+ @endvar
+ @var num_vars
+ @vdesc number of variables passed in through var_indices[]
+ @vtype int
+ @vio in
+ @endvar
+ @var var_indices
+ @vdesc array of variable indicies to which to apply this boundary
+ condition
+ @vtype int *
+ @vio in
+ @endvar
+ @var table_handles
+ @vdesc array of table handles which hold extra arguments
+ @vtype int
+ @vio in
+ @endvar
+ @returntype int
+ @returndesc
+ 0 success
+ @endreturndesc
+@@*/
+
+int BndNone(const cGH *GH, int num_vars, int *var_indices, int *table_handles)
+{
+#ifdef DEBUG
+ printf("BndNone(): got passed GH=%p, num_vars=%d, var_indices[0]=%d, table_handles[0]=%d\n", (const void *) GH, num_vars, var_indices[0], table_handles[0]);
+#endif
+
+ /* Ignore all input arguments */
+ GH = GH;
+ num_vars = num_vars;
+ var_indices = var_indices;
+ table_handles = table_handles;
+
+ return 0;
+}
diff --git a/src/Register.c b/src/Register.c
index 976743e..c060b72 100644
--- a/src/Register.c
+++ b/src/Register.c
@@ -67,8 +67,6 @@ void Boundary_RegisterBCs(CCTK_ARGUMENTS);
@vio in
@endvar
@returntype void
- @returndesc
- @endreturndesc
@@*/
void Boundary_RegisterBCs(CCTK_ARGUMENTS) {
@@ -81,6 +79,14 @@ void Boundary_RegisterBCs(CCTK_ARGUMENTS) {
"Boundary_RegisterPhysicalBC(cctkGH, &BndRadiative, "
"\"Radiative\") returned %d", err);
}
+
+ err = Boundary_RegisterPhysicalBC(cctkGH, (CCTK_FPOINTER) &BndNone,
+ "None");
+ if (err) {
+ CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Boundary_RegisterPhysicalBC(cctkGH, &BndNone, "
+ "\"None\") returned %d", err);
+ }
}
/********************************************************************
diff --git a/src/make.code.defn b/src/make.code.defn
index 2f59ce1..46bffe0 100644
--- a/src/make.code.defn
+++ b/src/make.code.defn
@@ -8,5 +8,6 @@ SRCS = ScalarBoundary.c\
FlatBoundary.c\
RadiationBoundary.c\
RobinBoundary.c\
+ NoneBoundary.c\
Boundary.c\
Register.c