Dear Dr Bangerth,

I tried using the VectorTools::project idea from step-25. However, my code
fails to compile, and I could not decipher the errors and do not know how
to fix this problem (have been stuck for a while).

The attached code tries to implement Step-52 (but for 1D), with homogenous
dirichelet BC  at the left edge and homogenous Neumann BC at the right
edge, with an initial value of 4/5*x*(1 - x/5) (a simple quadratic
function). I am also attaching the CMakeLists.txt (adapted from Step-52
suitably).

I'd appreciate help (from you and others here on the forum) to solve this
issue.

Krishna



On Tue, 14 Apr 2020 at 01:24, Wolfgang Bangerth <bange...@colostate.edu>
wrote:

> On 4/13/20 6:00 PM, Krishnakumar Gopalakrishnan wrote:
> > I am currently working on Step-52, which solves the diffusion equation.
> >
> > I now want to disable the Method of Manufactured Solutions (MMS) i.e.
> get rid
> > of the forcing function which produces an expected analytical solution,
> in the
> > direction towards solving my real-world problem.  I also have set the
> > absorption coefficient to zero, so that the diffusion equation reduces
> to a
> > form analogous to the heat-equation.
> >
> > Currently, the initial condition is set to be the zero vector.
> >
> > As a first step, I'd like to set my initial solution to be sin(b*x) *
> sin(b*y).
> >
> > I am currently interested in using only the embedded explicit method
> driver
> > function. Within this, I suspect that the lines of interest are the
> following:
> >
> > solution = 0.;
> > constraint_matrix.distribute(solution);
> >
> >
> > But I am not quite sure how can this initial condition be imposed. Any
> help
> > will be much appreciated.
>
> You will want to take a look at step-25. That program uses
> VectorTools::project(), but you can also use VectorTools::interpolate()
> instead.
>
> Best
>   W.
>
>
> --
> ------------------------------------------------------------------------
> Wolfgang Bangerth          email:                 bange...@colostate.edu
>                             www: http://www.math.colostate.edu/~bangerth/
>
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/l-aX46O2McY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/462c6c7a-341d-1657-559e-d7a2a3164771%40colostate.edu
> .
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CABvf3kby4Ju6HYu_bCVasyt3OBkvP%3DmPfx85E4C2Ozj6e%2Bd65g%40mail.gmail.com.
##
#  CMake script for the solid_diffusion program:
##

# Set the name of the project and target:
SET(PROJECT_NAME "solid_diffusion")
# SET(TARGET "solid_diffusion")
SET(TARGET ${PROJECT_NAME}.run)

SET(TARGET_SRC
    ${PROJECT_NAME}.cc
  )

# Define the output that should be cleaned:
SET(CLEAN_UP_FILES *.vtu *.pvd)

# Usually, you will not need to modify anything beyond this point...

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)

FIND_PACKAGE(deal.II 9.2.0 QUIET
  HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
  )
IF(NOT ${deal.II_FOUND})
  MESSAGE(FATAL_ERROR "\n"
    "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n"
    "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to 
cmake\n"
    "or set an environment variable \"DEAL_II_DIR\" that contains this path."
    )
ENDIF()

DEAL_II_INITIALIZE_CACHED_VARIABLES()
PROJECT(${TARGET})
DEAL_II_INVOKE_AUTOPILOT()

Attachment: solid_diffusion.cc
Description: Binary data

Reply via email to