1 Introduction

In general relativity, the solution of the field equations of static axially symmetric source is referred to the Weyl metrics. It is well-known that Schwarzschild solution is the only static and asymptotically flat vacuum solution which has a regular horizon (Israel 1976). Zipoy-Voorhees solution belongs to the family of the Weyl metrics and has a correspondence with the Schwarzschild metric (Zipoy 1966; Voorhees 1970). This is the only solution for which the physical components of the Riemann tensor does not contain singularity. For all other Weyl solutions (there are as many distinct Weyl solutions as there are distinct harmonic functions), these components contain singularity (Weyl 1917,1919; Stephani et al. 2003). A natural question arises which is the better exact vacuum solution to describe the deviation from spherical to non-spherical axially symmetric static source? There is no unique answer to this question.

In the study of self-gravitating objects, the spherical symmetry plays an important role to describe the occurrence of white dwarfs, neutron stars and black holes. However, in the presence of strong gravitational fields, it is essential to deviate from spherical to non-spherical symmetries to find exact solutions. It is well-known that different spacetimes may satisfy the field equations for different physically meaningful energy-momentum tensors. Herrera and his collaborators (Herrera et al. 2000, 2001a, 2003; Herrera 2005) used the MQ spacetime and γ-metric as a source of Weyl solutions to illustrate deviations to non-spherical symmetry.

Tiwari et al. (1991) have discussed static axially symmetric (cylindrical coordinates) charged dust and found a new class of electromagnetic mass models. Tiwari and Ray generalized this work for static spherical symmetric spacetime (1991a) and for static axially symmetric spacetime (spherical coordinates) (1991b). Regardless of the symmetry conditions, they concluded that static charged dust distribution is of purely electromagnetic origin. Similarly, the electromagnetic mass models were obtained for the static Levi-Civita axially symmetric spacetime (Ray et al. 1993). They concluded that any charged dust source is of electromagnetic origin.

Many investigations are devoted to understand the interaction between electromagnetic and gravitational fields. Bekenstein (1971) was the first who extended the work from neutral to charge case by generalizing Oppenheimer-Volkoff equations (Oppenheimer and Volkoff 1939). Since then a large amount of work has been done in this scenario. Young and Bentley (1975) found exact solutions to the Einstein-Maxwell field equations for static axially symmetric distribution of matter. Ardavan and Partovi (1977) investigated dust solutions for axially symmetric spacetime with electromagnetic field. Tsagas and his collaborators (Tsagas 2005, 2007; Spyrou and Tsagas 2008) used electromagnetic field in many astrophysical scenarios. Sharif and his collaborators (Sharif and Abbas 2010, 2012; Sharif and Yousaf 2013a, 2013b, 2013c) have explored the effects of electromagnetic field on different aspects of spherical and cylindrical backgrounds. Pinheiro and Chan (2010, 2013) explored the effects of electromagnetic field and bulk viscosity on the collapsing process of spherical symmetric anisotropic star. They concluded that charge slows down the collapse rate.

Inhomogeneity and anisotropy play a key role to understand the formation of galaxies during the early stages of evolution. Inhomogeneous spherically symmetric models were first proposed by Tolman (1934) and later by Bondi (1947). Wainwright and Goode (1980) explored some new exact spatially inhomogeneous perfect fluid models with an equation of state P=, where P is the pressure and ρ is the energy density. Senovilla (1990) investigated inhomogeneous perfect fluid models and showed that curvature and matter invariants are regular and smooth everywhere in the absence of initial singularity. Bali and Tyagi (1990) also presented inhomogeneous models of plane symmetry with charged perfect fluid distribution. Sharif and Yousaf (2012a, 2012b, 2012c) have found several exact models of inhomogeneous and anisotropic distribution of matter.

Herrera et al. (2009, 2010, 2011a, 2011b) obtained a set of equations through the orthogonal splitting of the Reimann tensor named as structure scalars. They found the relationship between these scalars and fluid properties which describe the evolution of the shear tensor and expansion scalar of self-gravitating objects. The structure scalars have different physical meanings and play key role to find the inhomogeneity in matter configuration. Sharif and Bashir (2012) have analyzed energy density inhomogeneity in electromagnetic field through one of these structure scalars. Herrera et al. (2011a, 2011b) analyzed the structure scalars in spherical symmetry in the presence of electromagnetic field. They also studied cylindrically symmetric matter distribution in the framework of structure scalars (Herrera et al. 2012). Recently, we have studied the effects of electromagnetic field on structure scalars in the scenario of cylindrical and plane symmetries (Sharif and Bhatti 2012a, 2012b). In a recent paper, Herrera et al. (2013) found structure scalars for static axially symmetric spacetime and identified the inhomogeneity factor. They also found some analytic solutions and showed that in spherical limit, the solution corresponds to the Schwarzschild metric.

In this paper, we generalize this work in the presence of electromagnetic field to study these structure scalars with the same configuration. The paper is organized as follows. In the next section, we formulate the Einstein-Maxwell field equations and the electric part of the Weyl tensor for static axially symmetric spacetime. Section 3 investigates structure scalars and inhomogeneity factor. In Sect. 4, we explore analytic solutions for isotropic pressure as well as constant energy density. Section 5 provides anisotropic solution which has correspondence with the Weyl exterior. In the last section, we summarize the results.

2 Charged anisotropic source

The axially symmetric spacetime in spherical coordinates is given as (Herrera et al. 2013)

$$\begin{aligned} ds^2 =&-A^2(r,\theta)dt^{2}+B^2(r, \theta) \bigl(dr^{2}+r^2d\theta^2\bigr) \\ &{}+C^2(r,\theta)d\phi^2. \end{aligned}$$
(1)

In order to provide full description of the fluid, we assume that the system is filled with anisotropic fluid for which the energy-momentum tensor is

$$ T^{(m)}_{\alpha\beta}=(\rho+P)V_\alpha V_\beta+P g_{\alpha\beta}+\varPi_{\alpha\beta}, $$
(2)

where

$$ \begin{aligned} &\varPi_{\alpha\beta}=(P_{xx}-P_{zz}) \biggl(K_{\alpha}K_\beta -\frac{1}{3}h_{\alpha\beta}\biggr) \\ &\hphantom{\varPi_{\alpha\beta}=}{}+(P_{yy}- P_{zz}) \biggl(L_{\alpha}L_\beta-\frac{1}{3}h_{\alpha\beta} \biggr)+2P_{xy}K_{(\alpha} L_{\beta)}, \\ &P=\frac{1}{3}(P_{xx}+P_{yy}+P_{zz}), \qquad h_{\alpha\beta}=g_{\alpha\beta}+V_\alpha V_\beta, \end{aligned} $$

here ρ is the energy density, P xx P yy P zz are different pressures, P xy =P yx and P xx P yy P zz . Also, V α is the four velocity, K α and L α are unit four-vectors, α and β are the Lorentz indices. For comoving coordinate system, we have

$$ V_{\alpha}=-A\delta^{0}_{\alpha},\qquad K_{\alpha}=B\delta^{1}_{\alpha},\qquad L_{\alpha}=Br \delta^{2}_{\alpha}. $$
(3)

The energy-momentum tensor for electromagnetic field is (Sharif and Bhatti 2013)

$$ T^{(em)}_{\alpha\beta}=\frac{1}{4\pi} \biggl(F^{\gamma}_{\alpha}F_{\beta\gamma} -\frac{1}{4}F^{\gamma\delta}F_{\gamma\delta}g_{\alpha\beta} \biggr), $$
(4)

where F αβ =ϕ β,α ϕ α,β is an anti-symmetric tensor known as Maxwell field tensor and ϕ α represents the four potential. The Maxwell field equations are

$$ {F^{\alpha\beta}}_{;\beta}=\mu_0J^{\alpha}, \qquad F_{[\alpha\beta;\gamma]}=0, $$
(5)

where μ 0=4π is the magnetic permeability and J α is the four current. In comoving coordinates, we can assume that charge per unit length of the system is at rest, so the magnetic field will be zero. Thus the four potential and four current are

$$ \phi_{\alpha}={\phi} {\delta^{0}_{\alpha}}, \qquad J^{\alpha}={\sigma}V^{\alpha}, $$

here ϕ is the scalar potential and σ is the charge density, both are functions of r and θ. The non-zero components of the Maxwell field tensor are \(F_{01}=-F_{10}=-\frac{\partial\phi}{\partial r},~F_{02}=-F_{20}=-\frac{\partial\phi}{\partial\theta}\). Using these values, the first Maxwell field equation (5) yields

$$\begin{aligned} &\frac{\partial^2\phi}{\partial r^2}+\frac{\partial\phi}{\partial r} \biggl(-\frac{A'}{A}+ \frac{C'}{C}+\frac{1}{r} \biggr) =-4\pi{\sigma}AB^2, \end{aligned}$$
(6)
$$\begin{aligned} &\frac{\partial^2\phi}{\partial\theta^2}+\frac{\partial\phi}{\partial\theta} \biggl(-\frac{A_\theta}{A}+ \frac{C_\theta}{C} \biggr) =-4\pi{\sigma}AB^2r^2, \end{aligned}$$
(7)

where prime is the differentiation with respect to r. Integration of Eq. (6) yields \(\frac{\partial\phi}{\partial r}=-\frac{sA}{Cr}\), where

$$ s(r,\theta)=4\pi\int^r_{0}{\sigma} {B^2Cr}dr, $$
(8)

is the total amount of charge. Equation (7) gives charge as a function of θ which is not possible, so we neglect the second non-zero component of the Maxwell field tensor.

The Einstein-Maxwell field equations yield the following set of equations

$$\begin{aligned} &{\kappa} \biggl(\rho+\frac{s^2}{8{\pi}B^2C^2r^2} \biggr) \\ &\quad=-\frac{1}{B^2} \biggl[\frac{B''}{B}- \biggl(\frac{B'}{B} \biggr)^2 + \frac{1}{r} \biggl(\frac{B'}{B} +\frac{C'}{C} \biggr)+ \frac{C''}{C} \\ &\qquad {}+ \frac{1}{r^2} \biggl\{ \frac{B_{\theta\theta}}{B}- \biggl( \frac{B_\theta}{B} \biggr)^2 +\frac{C_{\theta\theta}}{C} \biggr\} \biggr], \end{aligned}$$
(9)
$$\begin{aligned} &{\kappa} \biggl(P_{xx}-\frac{s^2}{8{\pi}B^2C^2r^2} \biggr) \\ &\quad= \frac{1}{B^2} \biggl[\frac{A'B'}{AB}+\frac{B'C'}{BC}+\frac{A'C'}{AC} +\frac{1}{r} \biggl(\frac{A'}{A}+\frac{C'}{C} \biggr) \\ &\qquad {} +\frac{1}{r^2} \biggl(\frac{A_{\theta\theta}}{A}-\frac{B_\theta C_\theta}{BC}+ \frac{A_\theta C_\theta}{AC}-\frac{A_\theta B_\theta}{AB}+\frac{C_{\theta\theta}}{C} \biggr) \biggr], \end{aligned}$$
(10)
$$\begin{aligned} &{\kappa} \biggl(P_{yy}+\frac{s^2}{8{\pi}B^2C^2r^2} \biggr) \\ &\quad= \frac{1}{B^2} \biggl[\frac{A''}{A}+\frac{C''}{C}+ \frac{A'C'}{AC}-\frac{A'B'}{AB} -\frac{B'C'}{BC} \\ &\qquad {}+ \frac{1}{r^2} \biggl(\frac{A_\theta B_\theta}{AB}+ \frac{B_\theta C_\theta}{BC}+\frac{A_\theta C_\theta}{AC} \biggr) \biggr], \end{aligned}$$
(11)
$$\begin{aligned} &{\kappa} \biggl(P_{zz}+\frac{s^2}{8{\pi}B^2C^2r^2} \biggr) \\ &\quad= \frac{1}{B^2} \biggl[\frac{A''}{A}+\frac{B''}{B} - \biggl( \frac{B'}{B} \biggr)^2+\frac{1}{r} \biggl( \frac{A'}{A} +\frac{B'}{B} \biggr) \\ &\qquad {}+ \frac{1}{r^2} \biggl\{ \frac{A_{\theta\theta}}{A} + \frac{B_{\theta\theta}}{B}- \biggl(\frac{B_\theta}{B} \biggr)^2 \biggr\} \biggr], \end{aligned}$$
(12)
$$\begin{aligned} &{\kappa}P_{xy}=\frac{1}{B^2} \biggl[\frac{1}{r} \biggl\{ \frac{A'_\theta}{A} +\frac{B'C_\theta}{BC}-\frac{C'_\theta}{C} + \frac{B_\theta}{B} \biggl(\frac{A'}{A}+\frac{C'}{C} \biggr) \\ &\hphantom{{\kappa}P_{xy}=} {} +\frac{A_\theta B'}{AB} \biggr\} +\frac{1}{r^2} \biggl( \frac{A_\theta}{A} +\frac{C_\theta}{C} \biggr) \biggr]. \end{aligned}$$
(13)

The Weyl tensor can be decomposed in its electric and magnetic parts as

$$ E_{\alpha\beta}=C_{\alpha\nu\beta\delta} V^{\nu} V^{\delta}, \qquad H_{\alpha\beta}=\frac{1}{2}\eta_{\alpha\nu\epsilon\rho} {C^{\epsilon\rho}}_{\beta\delta}V^{\nu}V^{\delta}. $$

The electric part of the Weyl tensor for Eq. (1) is exactly the same as given in Eq. (24) of Herrera et al. (2013) while the scalars \(\mathcal{E}_{1},~\mathcal{E}_{2}\) and \(\mathcal{E}_{3}\) are given in the Appendix and the magnetic part vanishes identically (Herrera et al. 2013).

3 Structure scalars and inhomogeneity factors

In this section, we formulate structure scalars for the charged fluid from the orthogonal splitting of the Riemann tensor (Bel 1961). Structure scalars have their own importance for the study of inhomogeneity in the energy density and pressure anisotropy of the system and have utmost relevance in the collapsing relativistic fluids. For this purpose, we take the tensors known as the electric part and the dual of the Riemann tensor obtained through the decomposition of the Riemann tensor and split it into its trace and trace-free parts as given in Eqs. (26), (32) of Herrera et al. (2013).

Using Eqs. (9)–(13), we obtain the trace and trace-free parts in terms of the physical variables for the charged case as follows

$$\begin{aligned} &Y_T=\frac{\kappa}{2}(\rho+P_{xx}+P_{yy}+P_{zz})+ \frac{s^2}{B^2C^2r^2}, \end{aligned}$$
(14)
$$\begin{aligned} &Y_{TF1}=\mathcal{E}_1-\frac{\kappa}{2}P_{xy}, \end{aligned}$$
(15)
$$\begin{aligned} &Y_{TF2}=\mathcal{E}_2-\frac{\kappa}{2}(P_{xx}-P_{zz})+\frac{s^2}{B^2C^2r^2}, \end{aligned}$$
(16)
$$\begin{aligned} &Y_{TF3}=\mathcal{E}_3-\frac{\kappa}{2}(P_{yy}-P_{zz}), \end{aligned}$$
(17)
$$\begin{aligned} &X_T=\kappa\rho+ \frac{s^2}{B^2C^2r^2}, \end{aligned}$$
(18)
$$\begin{aligned} &X_{TF1}=-\biggl(\mathcal{E}_1+ \frac{\kappa}{2}P_{xy}\biggr), \end{aligned}$$
(19)
$$\begin{aligned} &X_{TF2}=-\mathcal{E}_2- \frac{\kappa}{2}(P_{xx}-P_{zz})+\frac{s^2}{B^2C^2r^2}, \end{aligned}$$
(20)
$$\begin{aligned} X_{TF3} =&-\mathcal{E}_3- \frac{\kappa}{2}(P_{yy}-P_{zz}). \end{aligned}$$
(21)

These scalar functions (trace and trace-free parts) Y T , X T , Y TF1, Y TF2, Y TF3, X TF1, X TF2, X TF3, are named as the structure scalars. The conservation law, T αβ ;β =0, yields the following non-vanishing components with the variation of the Lorentz indices

$$\begin{aligned} &\dot{\rho}=0, \end{aligned}$$
(22)
$$\begin{aligned} &P_{xx}'+\frac{A'}{A}( \rho+P_{xx})+\frac{B'}{B}(P_{xx}-P_{yy}) + \frac{C'}{C}(P_{xx}-P_{zz}) \\ &\qquad {}+\frac{1}{r} \biggl[P_{xy} \biggl(\frac{A_\theta}{A} +2\frac{B_\theta}{B}+ \frac{C_\theta}{C} \biggr) +P_{xy,\theta}+P_{xx}-P_{yy} \biggr] \\ &\qquad {}-\frac{ss'}{4\pi B^2C^2r^2} \\ &\quad =0, \end{aligned}$$
(23)
$$\begin{aligned} &P_{yy,\theta}+\frac{A_\theta}{A}(\rho+P_{yy})+ \frac{B_\theta}{B}(P_{yy}-P_{xx}) +\frac{C_\theta}{C}(P_{yy}-P_{xx}) \\ &\qquad {}+r \biggl[P_{xy} \biggl(\frac{A'}{A}+2 \frac{B'}{B}+\frac{C'}{C} \biggr) +P_{xy}' \biggr] \\ &\qquad {}+2P_{xy}+\frac{s^2}{4\pi B^2C^2r^2} \biggl(\frac{A_\theta}{A}- \frac{C_\theta}{C} \biggr) \\ &\quad =0. \end{aligned}$$
(24)

Equation (22) is a trivial result of staticity, while Eqs. (23) and (24) are the hydrostatic equilibrium equations.

There are two important differential equations which relate the Weyl tensor to various physical variables and can be found using Bianchi identities. Here we generalize these equations for static axially symmetric spacetime in the presence of electromagnetic field. These are given as follows

$$\begin{aligned} &\frac{\mathcal{E}_{1\theta}}{r}+\frac{1}{3}(2\mathcal{E}_2- \mathcal{E}_3) +\frac{\mathcal{E}_1}{r} \biggl(2\frac{B_\theta}{B}+\frac{C_\theta}{C} \biggr) \\ &\qquad {}+\mathcal{E}_2 \biggl(\frac{B'}{B}+ \frac{C'}{C}+\frac{1}{r} \biggr) -\mathcal{E}_3 \biggl( \frac{B'}{B} +\frac{1}{r} \biggr) \\ &\quad =\frac{\kappa}{6}(2\rho+P_{xx}+P_{yy}+P_{zz})' +\frac{\kappa}{2}\frac{A'}{A} (\rho+P_{xx}) \\ &\qquad {}+\frac{\kappa}{2} \frac{A_\theta}{A}P_{xy} +\frac{1}{B^2C^2r^2} \biggl[ss'-s^2 \biggl(\frac{B'}{B}+\frac{C'}{C}+\frac{1}{r} \biggr) \biggr], \end{aligned}$$
(25)
$$\begin{aligned} &\mathcal{E}'_{1}+\frac{1}{3r}(2 \mathcal{E}_3-\mathcal{E}_2)_{\theta} + \mathcal{E}_1 \biggl(2\frac{B'}{B}+\frac{C'}{C}+ \frac{2}{r} \biggr) \\ &\qquad {}-\mathcal{E}_2\frac{B_\theta}{Br}+ \frac{\mathcal{E}_3}{r} \biggl( \frac{B_\theta}{B}+\frac{C_\theta}{C} \biggr) \\ &\quad =\frac{\kappa}{6r}(2\rho+P_{xx}+P_{yy}+P_{zz})_{\theta} +\frac{\kappa}{2}\frac{A_\theta}{rA} (\rho+P_{yy}) \\ &\qquad {}+\frac{\kappa}{2} \frac{A'}{A}P_{xy} +\frac{s^2}{B^2C^2r^2} \biggl(\frac{A_\theta}{A}-\frac{B_\theta}{B} -\frac{C_\theta}{C}-\frac{1}{r} \biggr). \end{aligned}$$
(26)

We can write these equations in terms of structure scalars using Eqs. (19)–(21) as follows

$$\begin{aligned} \frac{8\pi\rho'}{3} =&-\frac{1}{r}\bigl[X_{TF1\theta}+X_{TF1} \bigl({\ln B^2C}\bigr)_\theta\bigr] \\ &{}- \biggl[ \frac{2}{3}X'_{TF2}+X_{TF2}(\ln BCr)' \biggr] \\ &{}+ \biggl[\frac{1}{3}X'_{TF3}+X_{TF3}( \ln Br)' \biggr] \\ &{}+ \biggl(\frac{2s^2}{3B^2C^2r^2} \biggr)', \end{aligned}$$
(27)
$$\begin{aligned} \frac{8\pi\rho_\theta}{3r} =&\frac{1}{r} \biggl[\frac{1}{3}X_{TF2\theta} +X_{TF2}(\ln B)_\theta \biggr] \\ &{}-\frac{1}{r} \biggl[ \frac{2}{3}X_{TF3\theta}+X_{TF3}(\ln BC)_\theta \biggr] \\ &{}-\bigl[X'_{TF1}+X_{TF1}\bigl(\ln B^2Cr^2\bigr)'\bigr] \\ &{}+\frac{s^2}{B^2C^2r^3} \biggl(\frac{2B_\theta}{3B} +\frac{2C_\theta}{C} \biggr). \end{aligned}$$
(28)

Now we find the inhomogeneity factor which is the combination of different geometrical and physical variables. The vanishing of this factor is a necessary and sufficient for the homogeneity of the energy density. This factor has already been found in literature for cylindrical, spherical and plane symmetric distributions and also in the presence of electromagnetic field. In spherical, cylindrical and plane symmetric cases, the inhomogeneity factor is identified as the trace-free part of the tensor X αβ (Herrera et al. 2011a, 2011b, 2012; Sharif and Bhatti 2012a, 2012b). We evaluate this factor in charged axially symmetric case. Equations (27) and (28) yield

$$X_{TF1}=X_{TF2}=X_{TF3}=0 \quad \Rightarrow \quad \rho'^{eff}=\rho^{eff}_\theta=0, $$

where

$$\begin{aligned} &\rho'^{eff}=\rho'- \frac{s}{2\pi B^2C^2r^2} \biggl[s'-s \biggl(\frac{B'}{B}+ \frac{C'}{C}+\frac{1}{r} \biggr) \biggr], \\ &\rho^{eff}_\theta=\rho_\theta- \frac{s^2}{4\pi B^2C^2r^2} \biggl(\frac{B_\theta}{B}+\frac{C_\theta}{C} \biggr). \end{aligned}$$

To determine these scalars as the inhomogeneity factors, we have to prove that the converse is also true, i.e.

$$\begin{aligned} \rho'^{eff}=\rho^{eff}_\theta=0 \quad \Rightarrow \quad X_{TF1}=X_{TF2}=X_{TF3}=0. \end{aligned}$$

The required proof to identify the inhomogeneity factor is exactly the same as in Herrera et al. (2013) but now for the ρ eff (which contains the charge contribution) suggests three structure scalars X TF1X TF2X TF3 as the inhomogeneity factor. We can have the uncharged matter distribution by replacing the effective energy density with the energy density.

4 Analytic solution of isotropic sphere

Here, we find analytic solution for a bounded spheroid having homogeneous energy density and isotropic pressure. We assume that ρ=ρ 0=constant, P xx =P yy =P zz =P and P xy =0. For the sake of convenience, we consider the boundary surface Σ defined by r=constant=r 1. To satisfy the Darmois conditions, we require that all the metric functions as well as r derivatives are continuous across Σ. Using this isotropic condition on Σ, it follows that \(P\overset{\varSigma}{=}0\) (Sharif and Yousaf 2012a, 2012b, 2012c). Conformally flat solutions provide an efficient tool to study the effects of local anisotropy, energy density inhomogeneity in the evolution of self-gravitating fluids. This motivates many authors to evaluate conformally flat solutions (Wang 1987; Herrera et al. 2001b; Di Prisco et al. 2011; Sharif and Yousaf 2012a, 2012c). It is found that charge affects the conformal flat condition (Sharif and Bashir 2012). Equations (15)–(17) and (19)–(21) show that such a solution is conformally flat in the absence of electromagnetic field. Using the above conditions in Eq. (23), we obtain

$$\begin{aligned} \rho_0+P =&\frac{\eta(\theta)}{A}+\frac{1}{4\pi A}\int \frac{ss'A}{B^2C^2r^2}dr, \end{aligned}$$
(29)

where η is an arbitrary function.

We know that charge on the boundary of any sphere is constant (Sharif and Bhatti 2012c). Thus, from the above boundary conditions, we can find

$$ A(r_1,\theta)=\frac{h}{\rho_0}=\mbox{constant}, \quad \eta=\mbox{constant}. $$
(30)

As our solution is conformally flat in the absence of charge, so using P xy =0 and \(\mathcal{E}_{1}=\mathcal{E}_{2}=\mathcal{E}_{3}=0\) in Eqs. (13) and in (A.6) of Herrera et al. (2013), it follows that

$$\begin{aligned} &\frac{A'_\theta}{A}-\frac{A_\theta}{A} \biggl(\frac{1}{r} + \frac{B'}{B} \biggr)-\frac{A'B_\theta}{AB}=0, \end{aligned}$$
(31)
$$\begin{aligned} &\frac{C'_\theta}{C} -\frac{C_\theta}{C} \biggl(\frac{1}{r}+ \frac{B'}{B} \biggr)-\frac{C'B_\theta}{CB}=0. \end{aligned}$$
(32)

Defining the auxiliary function \(\bar{A}(r,\theta)\) such that

$$ A(r,\theta)=\bar{A}(r,\theta)B(r,\theta), $$
(33)

and assuming

$$ C(r,\theta)=r\sin\theta B(r,\theta). $$
(34)

Equations (31) and (32) can be integrated to yield

$$ \begin{aligned} &\bar{A}(r,\theta)=\tilde{A}(r)+r\chi(\theta), \\ &B(r,\theta)= \frac{1}{R(r)+r\omega(\theta)}, \end{aligned} $$
(35)

where \(\bar{A},~\omega,~\chi\) and R are arbitrary functions of their argument. Using Eqs. (A.7), (A.8) of Herrera et al. (2013) with (34) and (35), we obtain

$$\begin{aligned} \tilde{A}(r)=fr^2+g, \qquad\chi=a \cos\theta, \end{aligned}$$
(36)

where fg and a are constants of integration.

The corresponding line element of the conformally flat solution is

$$\begin{aligned} ds^2&=\frac{1}{[R(r)+r\omega(\theta)]^2}\bigl[-\bigl(f r^2+g+ar\cos\theta\bigr)^2dt^2 \\ &\quad {}+dr^2+r^2d \theta^2+r^2\sin^2\theta d\phi^2 \bigr]. \end{aligned}$$
(37)

Using P xx P zz =0, P xx P yy =0 and Eqs. (9)–(13), it follows that

$$\begin{aligned} \omega(\theta)=b\cos\theta, \qquad R(r)=\gamma r^2+\delta, \end{aligned}$$
(38)

where bδ and γ are constants of integration. Finally, the line element of conformally flat, isotropic, incompressible fluid can be written in the form

$$\begin{aligned} ds^2&=\frac{1}{(\gamma r^2+\delta+rb\cos\theta)^2}\bigl[-\bigl(f r^2+g+ar\cos\theta\bigr)^2dt^2 \\ &\quad {}+dr^2+r^2d \theta^2+r^2\sin^2\theta d\phi^2 \bigr]. \end{aligned}$$
(39)

The physical quantities like energy density and pressure can easily be evaluated. Using Eq. (39) in (9), the energy density turns out to be

$$ \kappa\rho=12\gamma\delta-3b^2-\frac{s^2(\gamma r^2+\delta+br\cos\theta)^4}{r^4\sin^2\theta}. $$
(40)

The pressure is found by using the boundary condition \(P\overset{\varSigma}{=}0\) as well as Eqs. (29) and (30)

$$\begin{aligned} \kappa P =& \biggl(12\gamma\delta-3b^2-\frac{s^2(\gamma r^2+\delta+br\cos\theta)^4}{r^4\sin^2\theta} \biggr) \\ &{}\times \biggl(\frac{f r_1^2+g}{\gamma r_1^2+\delta}\frac{\gamma r^2+\delta+rb\cos\theta}{f r^2+g+ra\cos\theta} -1 \biggr) \\ &{}+2\frac{\gamma r^2+\delta+rb\cos\theta}{f r^2+g+ra\cos\theta} \\ &{}\times \int\frac{ss'}{r^4\sin^2\theta} \bigl[\bigl( \gamma r^2+\delta+rb\cos\theta\bigr)^3\bigl(f r^2+g \\ &{}+ra\cos\theta\bigr)-\bigl(fr_1^2+g \bigr) \bigl(\gamma r_1^2+\delta\bigr) \bigr]dr, \end{aligned}$$
(41)

where

$$\begin{aligned} \eta=\rho_0\frac{fr_1^2+g}{\gamma r_1^2+\delta},\qquad a=b\frac{f r_1^2+g}{\gamma r_1^2+\delta}. \end{aligned}$$

It would be interesting to recover the spherically symmetric case, i.e., a=0=b. For this purpose, we use the coordinate transformations

$$\begin{aligned} \bar{r}=\frac{r}{\gamma r^2+\delta},\qquad\bar{\theta}=\theta,\qquad\bar{t}=t, \qquad\bar{\phi}=\phi, \end{aligned}$$

where overbar denotes the usual Schwarzschild coordinates. It can easily be found from Eqs. (39) and (41) that these correspond to charged fluid and becomes the interior (not to be confused with the exterior) Schwarzschild metric (72)–(74) in Herrera et al. (2013) in the non charged case.

$$\begin{aligned} &g_{\bar{t}\bar{t}}=\frac{1}{4} \biggl[3 \biggl(1- \frac{2M}{\bar{r}_1} +\frac{Q^2}{\bar{r}^2_1} \biggr)^{\frac{1}{2}}- \biggl(1- \frac{2m(\bar{r})}{\bar{r}} +\frac{s^2}{\bar{r}^2} \biggr)^{\frac{1}{2}} \biggr], \\ &g_{\bar{r}\bar{r}}= \biggl[1-\frac{2m(\bar{r})}{\bar{r}} +\frac{s^2}{\bar{r}^2} \biggr]^{-1}, \\ &P=\rho \biggl[\frac{ (1-\frac{2m(\bar{r})}{\bar{r}} +\frac{s^2}{\bar{r}^2} )^{\frac{1}{2}}- (1-\frac{2M}{\bar{r}_1} +\frac{Q^2}{\bar{r}^2_1} )^{\frac{1}{2}}}{3 (1-\frac{2M}{\bar{r}_1} +\frac{Q^2}{\bar{r}^2_1} )^{\frac{1}{2}}- (1-\frac{2m(\bar{r})}{\bar{r}} +\frac{s^2}{\bar{r}^2} )^{\frac{1}{2}}} \biggr], \end{aligned}$$

where \(m(\bar{r}),~s,~\bar{r}_{1},~Q\) and M denote the mass function, charge in the interior, radius of the sphere, total charge on the boundary and the total mass, respectively. The following relationships are satisfied

$$\begin{aligned} &m=\frac{2\gamma\delta r^3}{(\gamma r^2+\delta)^3}+\frac{s^2}{2r}\bigl(\gamma r^2+ \delta\bigr) \\ &\hphantom{m}=\frac{\kappa\rho\bar{r}^3}{6} +\frac{s^2}{2r} \biggl(\frac{4}{3} \csc^2\theta-\cot^2\theta \biggr), \\ &m(\bar{r}_1)=M,\qquad s(\bar{r},\theta)=Q \quad \mbox{and} \quad r_1^2=\frac{g+\delta}{\gamma-f}. \end{aligned}$$

In order to satisfy the Darmois conditions, i.e., the continuity of the first and second fundamental forms, it is required that the metric functions and their r as well as θ derivatives are continuous across the hypersurface Σ. The continuity of g tt and g ϕϕ components at r=r 1 leads to any Weyl exterior solution A W (r 1,θ) from \(\sqrt{g_{tt}}\) on the boundary surface

$$\begin{aligned} &A_W(r_1,\theta)=\frac{fr_1^2+g+ar_1\cos\theta}{\gamma r_1^2+\delta+br_1\cos\theta}, \quad \\ &A_W(r_1,\theta)=\gamma r_1^2+ \delta+br_1\cos\theta. \end{aligned} $$

This cannot be satisfied unless a=0=b which corresponds to the static spherically symmetric case (since perfect fluid sources are spherical (Masood-ul-Alama 2007)). This solution does not have any correspondence with the Weyl exterior in this case when we get A(r 1,θ)=constant, though it has zero pressure on the surface.

5 Anisotropic sphere

Here, we find a solution which has the correspondence with the Weyl exterior. Since the result obtained in the last section is the consequence of our assumption (34), so for such a solution matchable to the Weyl exterior, we have to relax the condition of energy density inhomogeneity and isotropy of pressure. We assume \(\mathcal{E}_{1}=\mathcal{E}_{3}=P_{xy}=P_{yy}-P_{zz}=0\), P xx P yy and \(\mathcal{E}_{2}\neq0\), then Eqs. (13) with (A.9) of Herrera et al. (2013) yield Eqs. (31) and (32). Moreover, we define the auxiliary functions \(\tilde{A}(r,\theta)\) and R(r,θ) as

$$\begin{aligned} A(r,\theta)=r\tilde{A}(r,\theta)B(r,\theta),\qquad C(r,\theta)=rB(r, \theta)R(r,\theta), \end{aligned}$$

so that Eqs. (31) and (32) can be rewritten as

$$ \frac{R_\theta'}{R}=\frac{\tilde{A_\theta'}}{\tilde{A}} =rB \biggl( \frac{1}{rB} \biggr)_\theta'. $$
(42)

Using \(\mathcal{E}_{3}=P_{yy}-P_{zz}=0\) as well as Eqs. (A.8) and (A.11) of Herrera et al. (2013), we obtain

$$\begin{aligned} &\frac{R''}{R}-\frac{R'}{R} \biggl(\frac{\tilde{A}'}{\tilde{A}}- \frac{1}{r} \biggr) -\frac{1}{r^2} \biggl(\frac{\tilde{A}_\theta R_\theta}{\tilde{A}R}- \frac{\tilde{A}_{\theta\theta}}{\tilde{A}} \biggr)=0, \end{aligned}$$
(43)
$$\begin{aligned} &\frac{R'}{R} \biggl(\frac{1}{r}+\frac{\tilde{A}'}{\tilde{A}}+ \frac{B'}{B} \biggr) +\frac{1}{r^2} \biggl(\frac{\tilde{A}_\theta R_\theta}{\tilde{A}R}+ \frac{R_\theta B_\theta}{RB} \\ &\quad {}+2 \biggl(\frac{B_\theta}{B} \biggr)^2 - \frac{\tilde{A}_{\theta\theta}}{\tilde{A}}-\frac{B_{\theta\theta}}{B} \biggr)=0. \end{aligned}$$
(44)

To find a solution which satisfies the boundary condition, we consider

$$ R(r,\theta)=\bigl[\gamma\cos\theta+b(r_1)\bigr]\sin \theta, $$
(45)

such that Eqs. (42)–(44) turn out to be

$$\begin{aligned} &\tilde{A}(r,\theta)=p \biggl[\frac{\gamma}{2}\sin^2\theta -b(r_1)\cos\theta \biggr]+a(r), \\ &B(r,\theta)=\frac{1}{rq [\frac{\gamma}{2}\sin^2\theta -b(r_1)\cos\theta ]+b(r)}, \end{aligned}$$

where a(r), b(r) and pqγ are functions of integration and arbitrary constants, respectively, a(r), p and q have dimensions of \(\frac{1}{L}\), while the rest have no dimensions. The Einstein-Maxwell field equations for the above metric leads to

$$\begin{aligned} &\kappa\rho+ \biggl(\frac{s^2(rq\varGamma+b)^4}{r^4\sin^2\theta\varLambda^2} \biggr) \\ &\quad =(rq \varGamma+b)^2 \biggl[\frac{2b''}{rq\varGamma+b} -3 \biggl( \frac{q\varLambda\sin\theta}{rq\varGamma+b} \biggr)^2 \\ &\qquad{}-3 \biggl(\frac{q\varGamma+b'}{rq\varGamma+b} \biggr)^2 + \frac{1}{r} \biggl\{ \frac{4q\varSigma}{rq\varGamma+b} +4\frac{q\varLambda+b'}{rq\varGamma+b} \biggr\} \\ &\qquad{}+ \frac{1}{r^2} \biggl\{ \frac{b_1+4\gamma\cos\theta}{\varLambda}-1 \biggr\} \biggr], \\ &\kappa P_{xx}- \biggl(\frac{s^2(rq\varGamma+b)^4}{r^4\sin^2\theta\varLambda^2} \biggr) \\ &\quad =(rq \varGamma+b)^2 \biggl[-\frac{2a'(q\varGamma+b')}{(p\varGamma+a) (rq\varGamma+b)} \\ &\qquad{}+3 \biggl(\frac{q\varGamma+b'}{ rq\varGamma+b} \biggr)^2+3 \biggl( \frac{q\varLambda\sin\theta}{ rq\varGamma+b} \biggr)^2 \\ &\qquad{}+\frac{1}{r} \biggl\{ \frac{2a'}{ p\varGamma+a}-6\frac{q\varGamma+b'}{rq\varGamma+b} -4\frac{q\varSigma}{rq\varGamma+b} \\ &\qquad{}-2\frac{pq\varLambda^2\sin^2\theta}{ (rq\varGamma+b)(p\varGamma+a)} \biggr\} \\ &\qquad{}-\frac{1}{r^2} \biggl\{ 2 \frac{p\varSigma}{ p\varGamma+a}-\frac{b_1+4\gamma\cos\theta}{\varLambda}+3 \biggr\} \biggr], \\ &\kappa P_{yy}+ \biggl(\frac{s^2(rq\varGamma+b)^4}{r^4\sin^2\theta\varLambda^2} \biggr) \\ &\quad =\kappa P_{zz}+ \biggl(\frac{s^2(rq\varGamma+b)^4}{r^4\sin^2\theta\varLambda^2} \biggr) \\ &\quad =(rq\varGamma+b)^2 \biggl[\frac{a''}{p\varGamma+a} -2\frac{a'(q\varGamma+b')}{(p\varGamma+a)(rq\varGamma+b)} \\ &\qquad{}-2 \frac{b''}{ rq\varGamma+b}+3 \biggl(\frac{q\varGamma+b'}{rq\varGamma+b} \biggr)^2 +3 \biggl(\frac{q\varLambda\sin\theta}{rq\varGamma+b} \biggr)^2 \\ &\qquad{}+ \frac{1}{r} \biggl\{ 3\frac{a'}{p\varGamma+a} -2\frac{q\varSigma}{rq\varGamma+b}-4 \frac{q\varGamma+b'}{rq\varGamma+b} \\ &\qquad{}-2\frac{pq\varLambda^2\sin^2\theta}{ (rq\varGamma+b)} \frac{1}{(p\varGamma+a)} \biggr\} +\frac{1}{r^2} \biggl( \frac{p\varSigma}{p\varGamma+a}+1 \biggr) \biggr], \end{aligned}$$

where

$$\begin{aligned} \varLambda =&b_1+\gamma\cos\theta, \\ \varGamma =& \frac{\gamma\sin^2\theta}{2}-b_1\cos\theta,\quad b(r_1)=b_1, \\ \varSigma =&\varLambda\cos\theta-\gamma\sin^2\theta. \end{aligned}$$

These provide a variety of such solutions which have a correspondence with the Weyl metric. For this purpose, one has to choose reasonable constants of integration and functions of their arguments. Since electromagnetic mass models are those in which mass appears only due to the electromagnetic field. In view of the results obtained by Tiwari et al. (1991), Tiwari and Ray (1991a, 1991b), Ray et al. (1993), we can say that our investigation for charged anisotropic fluid distribution should provide electromagnetic mass model but in the absence of anisotropic pressure as electromagnetic mass model does not possess the character of normal matter. We (Sharif and Bhatti 2012a) have already obtained the mass function as a possible extension of Misner-Sharp mass function in cylindrical symmetry and found that it has the electromagnetic origin which depends on the anisotropic nature of pressure. Here, we have provided the basic equations required to construct the electromagnetic mass model but such a model is beyond the scope of this work. One can find that charged dust case is of purely electromagnetic origin.

6 Conclusions

In this paper, we have investigated the effects of electromagnetic field on structure scalars of static axially symmetric spacetime having anisotropic fluid in the interior as a Weyl source. We have found eight structure scalars in this scenario unlike the usual spherical symmetry where there are only five such scalars. These scalar functions have the following properties:

  • Y T and X T correspond to the energy density of the charged fluid.

  • Y TF1Y TF2 and Y TF3 describe the energy density inhomogeneity due to scalar parts of the Weyl tensor as it tends to make the object more inhomogeneous as the evolution proceeds. Also, they describe the local anisotropy of pressure for a system in equilibrium. These indicate that charge increases the inhomogeneity as well as anisotropy of the matter configuration.

  • We have evaluated that the necessary and sufficient condition for the vanishing of the derivative of the effective energy density is the vanishing of the scalar associated with the trace-free part of the dual of the Riemann tensor, i.e., X TF1X TF2 and X TF3. This reflects the importance of these scalars as the inhomogeneity factors. It is found that the inhomogeneity is increased due to the presence of electromagnetic field.

  • The static solution of the field equations can be expressed in terms of structure scalars (Sharif and Bhatti 2012a). It is found that charge destroys conformal flatness and our results will be conformally flat only in the absence of charge. These solutions lead to homogeneous energy density (Sharif and Yousaf 2012a, 2012c).

  • For constant energy density and isotropic pressure, we have found a solution which corresponds to a charged fluid and becomes the interior in the spherical limit. This type of solution has no such correspondence with the Weyl exterior solutions. In order to overcome this issue, we have found another solution which has the correspondence with the Weyl exterior.

  • All our results reduce to charge free case when we take s=0 (Herrera et al. 2013).