  We use density--functional theory to study the structure of two-dimensional
defects inside a circular nematic nanocavity. The density, nematic order
parameter, and director fields, as well as the defect core energy and core
radius, are obtained in a thermodynamically consistent way for defects with
topological charge $k=+1$ (with radial and tangential symmetries) and $k=+1/2$.
An independent calculation of the fluid elastic constants, within the same
theory, allows us to connect with the local free--energy density predicted by
elastic theory, which in turn provides a criterion to define a defect core
boundary and a defect core free energy for the two types of defects. The radial
and tangential defects turn out to have very different properties, a feature
that a previous Maier--Saupe theory could not account for due to the simplified
nature of the interactions --which caused all elastic constants to be equal. In
the case with two $k=+1/2$ defects in the cavity, the elastic r\'egime cannot
be reached due to the small radii of the cavities considered, but some trends
can already be obtained.
