vtf-logo

fsi/adlib-amroc/DetonatingCanister/src/SolidProblem.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // Copyright (C) 2003-2007 California Institute of Technology
00004 // Ralf Deiterding, ralf@amroc.net
00005 
00006 #ifndef ADLIB_SOLIDPROBLEM_H
00007 #define ADLIB_SOLIDPROBLEM_H
00008 
00009 #define OWN_ELC_COUPLED_ADLIBSOLVER
00010 #include "external_coupling/AdlibStdELCCoupledProblem.h"
00011 
00012 class SolidSolverSpecific : public AdlibELCCoupledSolver<DIM> {
00013   typedef AdlibELCCoupledSolver<DIM> base;
00014 public:
00015   SolidSolverSpecific(MPI_Comm solidComm, int numFluidNodes, int firstFluidNode) : 
00016   base(solidComm, numFluidNodes, firstFluidNode) {}
00017 
00018   virtual void Update(const double& dt) {
00019     // Boundary conditions 
00020     // No deformations behind initial detonation location,
00021     // in z-direction at far away upper end, 
00022     // and in x-,y-direction at nodes at outer radius
00023     for (register int n=0; n<adlib::nodes; n++) {
00024       int offset=3*n;
00025       double &x = adlib::coordinates[offset];
00026       double &y = adlib::coordinates[offset+1];
00027       double &z = adlib::coordinates[offset+2];
00028       double radius = std::sqrt(x*x+y*y);
00029       if (radius>=0.017) {
00030         for (register int m=0; m<2; m++) {
00031           adlib::boundary[offset+m] = 1;
00032           adlib::velocities[offset+m] = 0;
00033           adlib::displacements[offset+m] = 0;
00034         }
00035       }
00036       if (z>=0.095) {
00037         adlib::boundary[offset+2] = 1;
00038         adlib::velocities[offset+2] = 0;
00039         adlib::displacements[offset+2] = 0;
00040       }
00041       if (z<=0.015) {
00042         for (register int m=0; m<3; m++) {
00043           adlib::boundary[offset+m] = 1;
00044           adlib::velocities[offset+m] = 0;
00045           adlib::displacements[offset+m] = 0;
00046         }
00047       }
00048     }
00049     base::Update(dt);
00050   }
00051 };
00052 
00053 
00054 #endif
00055 

Generated on Fri Aug 24 13:02:34 2007 for Virtual Test Facility Coupled Applications by  doxygen 1.4.7